Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1283030 > unrolled thread

[PATCH 1/7] spi: lm70llp: remove multiple blank lines

Started bySudip Mukherjee <sudipm.mukherjee@gmail.com>
First post2015-12-03 14:10 +0100
Last post2015-12-03 14:10 +0100
Articles 8 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/7] spi: lm70llp: remove multiple blank lines Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-12-03 14:10 +0100
    [PATCH 3/7] spi: lm70llp: remove cast to void Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-12-03 14:10 +0100
    [PATCH 7/7] spi: lm70llp: use new parport device model Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-12-03 14:10 +0100
    [PATCH 6/7] spi: lm70llp: remove printk Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-12-03 14:10 +0100
      Re: [PATCH 6/7] spi: lm70llp: remove printk Mark Brown <broonie@kernel.org> - 2015-12-04 13:20 +0100
    [PATCH 4/7] spi: lm70llp: correct alignment Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-12-03 14:10 +0100
    [PATCH 5/7] spi: lm70llp: remove space Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-12-03 14:10 +0100
    [PATCH 2/7] spi: lm70llp: add blank line after declaration Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-12-03 14:10 +0100

#1283030 — [PATCH 1/7] spi: lm70llp: remove multiple blank lines

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2015-12-03 14:10 +0100
Subject[PATCH 1/7] spi: lm70llp: remove multiple blank lines
Message-ID<qBBO1-5tU-1@gated-at.bofh.it>
checkpatch complains about multiple blank lines.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/spi/spi-lm70llp.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/spi/spi-lm70llp.c b/drivers/spi/spi-lm70llp.c
index ba72347..eb4b421 100644
--- a/drivers/spi/spi-lm70llp.c
+++ b/drivers/spi/spi-lm70llp.c
@@ -23,11 +23,9 @@
 #include <linux/sysfs.h>
 #include <linux/workqueue.h>
 
-
 #include <linux/spi/spi.h>
 #include <linux/spi/spi_bitbang.h>
 
-
 /*
  * The LM70 communicates with a host processor using a 3-wire variant of
  * the SPI/Microwire bus interface. This driver specifically supports an
@@ -88,7 +86,6 @@ struct spi_lm70llp {
 /* REVISIT : ugly global ; provides "exclusive open" facility */
 static struct spi_lm70llp *lm70llp;
 
-
 /*-------------------------------------------------------------------*/
 
 static inline struct spi_lm70llp *spidev_to_pp(struct spi_device *spi)
@@ -319,7 +316,6 @@ static void spi_lm70llp_detach(struct parport *p)
 	lm70llp = NULL;
 }
 
-
 static struct parport_driver spi_lm70llp_drv = {
 	.name =		DRVNAME,
 	.attach =	spi_lm70llp_attach,
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1283032 — [PATCH 3/7] spi: lm70llp: remove cast to void

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2015-12-03 14:10 +0100
Subject[PATCH 3/7] spi: lm70llp: remove cast to void
Message-ID<qBBO1-5tU-13@gated-at.bofh.it>
In reply to#1283030
checkpatch was complaining about space after cast. But the cast to void
is not required at that place.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/spi/spi-lm70llp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-lm70llp.c b/drivers/spi/spi-lm70llp.c
index 7037028..133e76c 100644
--- a/drivers/spi/spi-lm70llp.c
+++ b/drivers/spi/spi-lm70llp.c
@@ -294,7 +294,7 @@ out_off_and_release:
 out_parport_unreg:
 	parport_unregister_device(pd);
 out_free_master:
-	(void) spi_master_put(master);
+	spi_master_put(master);
 out_fail:
 	pr_info("%s: spi_lm70llp probe fail, status %d\n", DRVNAME, status);
 }
@@ -315,7 +315,7 @@ static void spi_lm70llp_detach(struct parport *p)
 	parport_release(pp->pd);
 	parport_unregister_device(pp->pd);
 
-	(void) spi_master_put(pp->bitbang.master);
+	spi_master_put(pp->bitbang.master);
 
 	lm70llp = NULL;
 }
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1283033 — [PATCH 7/7] spi: lm70llp: use new parport device model

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2015-12-03 14:10 +0100
Subject[PATCH 7/7] spi: lm70llp: use new parport device model
Message-ID<qBBO2-5tU-17@gated-at.bofh.it>
In reply to#1283030
Modify spi-lm70llp driver to use the new parallel port device model.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/spi/spi-lm70llp.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-lm70llp.c b/drivers/spi/spi-lm70llp.c
index 39cf5dc..9537248 100644
--- a/drivers/spi/spi-lm70llp.c
+++ b/drivers/spi/spi-lm70llp.c
@@ -198,6 +198,7 @@ static void spi_lm70llp_attach(struct parport *p)
 	struct spi_lm70llp	*pp;
 	struct spi_master	*master;
 	int			status;
+	struct pardev_cb	lm70llp_cb;
 
 	if (lm70llp) {
 		pr_warn("spi_lm70llp instance already loaded. Aborting.\n");
@@ -227,9 +228,11 @@ static void spi_lm70llp_attach(struct parport *p)
 	 * Parport hookup
 	 */
 	pp->port = p;
-	pd = parport_register_device(p, DRVNAME,
-				     NULL, NULL, NULL,
-				     PARPORT_FLAG_EXCL, pp);
+	memset(&lm70llp_cb, 0, sizeof(lm70llp_cb));
+	lm70llp_cb.private = pp;
+	lm70llp_cb.flags = PARPORT_FLAG_EXCL;
+	pd = parport_register_dev_model(p, DRVNAME, &lm70llp_cb, 0);
+
 	if (!pd) {
 		status = -ENOMEM;
 		goto out_free_master;
@@ -319,8 +322,9 @@ static void spi_lm70llp_detach(struct parport *p)
 
 static struct parport_driver spi_lm70llp_drv = {
 	.name =		DRVNAME,
-	.attach =	spi_lm70llp_attach,
+	.match_port =	spi_lm70llp_attach,
 	.detach =	spi_lm70llp_detach,
+	.devmodel =	true,
 };
 
 static int __init init_spi_lm70llp(void)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1283034 — [PATCH 6/7] spi: lm70llp: remove printk

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2015-12-03 14:10 +0100
Subject[PATCH 6/7] spi: lm70llp: remove printk
Message-ID<qBBO2-5tU-25@gated-at.bofh.it>
In reply to#1283030
Using pr_* macros are more prefferable than using printk. Start using
pr_* family of macros and define pr_fmt to be used with it.
While at it remove DRVNAME from an existing pr_info() as the name is now
being printed by pr_fmt.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/spi/spi-lm70llp.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/spi-lm70llp.c b/drivers/spi/spi-lm70llp.c
index 62d0f6d..39cf5dc 100644
--- a/drivers/spi/spi-lm70llp.c
+++ b/drivers/spi/spi-lm70llp.c
@@ -13,6 +13,7 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  */
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/init.h>
 #include <linux/module.h>
@@ -199,9 +200,7 @@ static void spi_lm70llp_attach(struct parport *p)
 	int			status;
 
 	if (lm70llp) {
-		printk(KERN_WARNING
-			"%s: spi_lm70llp instance already loaded. Aborting.\n",
-			DRVNAME);
+		pr_warn("spi_lm70llp instance already loaded. Aborting.\n");
 		return;
 	}
 
@@ -246,9 +245,7 @@ static void spi_lm70llp_attach(struct parport *p)
 	 */
 	status = spi_bitbang_start(&pp->bitbang);
 	if (status < 0) {
-		printk(KERN_WARNING
-			"%s: spi_bitbang_start failed with status %d\n",
-			DRVNAME, status);
+		pr_warn("spi_bitbang_start failed with status %d\n", status);
 		goto out_off_and_release;
 	}
 
@@ -275,7 +272,7 @@ static void spi_lm70llp_attach(struct parport *p)
 		dev_dbg(&pp->spidev_lm70->dev, "spidev_lm70 at %s\n",
 			dev_name(&pp->spidev_lm70->dev));
 	else {
-		printk(KERN_WARNING "%s: spi_new_device failed\n", DRVNAME);
+		pr_warn("spi_new_device failed\n");
 		status = -ENODEV;
 		goto out_bitbang_stop;
 	}
@@ -296,7 +293,7 @@ out_parport_unreg:
 out_free_master:
 	spi_master_put(master);
 out_fail:
-	pr_info("%s: spi_lm70llp probe fail, status %d\n", DRVNAME, status);
+	pr_info("spi_lm70llp probe fail, status %d\n", status);
 }
 
 static void spi_lm70llp_detach(struct parport *p)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1283773 — Re: [PATCH 6/7] spi: lm70llp: remove printk

FromMark Brown <broonie@kernel.org>
Date2015-12-04 13:20 +0100
SubjectRe: [PATCH 6/7] spi: lm70llp: remove printk
Message-ID<qBXvc-2xR-9@gated-at.bofh.it>
In reply to#1283034

[Multipart message — attachments visible in raw view] — view raw

On Thu, Dec 03, 2015 at 06:29:58PM +0530, Sudip Mukherjee wrote:
> Using pr_* macros are more prefferable than using printk. Start using
> pr_* family of macros and define pr_fmt to be used with it.
> While at it remove DRVNAME from an existing pr_info() as the name is now
> being printed by pr_fmt.

> @@ -246,9 +245,7 @@ static void spi_lm70llp_attach(struct parport *p)
>  	 */
>  	status = spi_bitbang_start(&pp->bitbang);
>  	if (status < 0) {
> -		printk(KERN_WARNING
> -			"%s: spi_bitbang_start failed with status %d\n",
> -			DRVNAME, status);
> +		pr_warn("spi_bitbang_start failed with status %d\n", status);
>  		goto out_off_and_release;
>  	}
>  

When we have a struct device available it's even better to use
dev_warn() and so on.

[toc] | [prev] | [next] | [standalone]


#1283035 — [PATCH 4/7] spi: lm70llp: correct alignment

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2015-12-03 14:10 +0100
Subject[PATCH 4/7] spi: lm70llp: correct alignment
Message-ID<qBBO2-5tU-21@gated-at.bofh.it>
In reply to#1283030
checkpatch complains about the allignment with open parenthesis.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/spi/spi-lm70llp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-lm70llp.c b/drivers/spi/spi-lm70llp.c
index 133e76c..5f526ce 100644
--- a/drivers/spi/spi-lm70llp.c
+++ b/drivers/spi/spi-lm70llp.c
@@ -229,8 +229,8 @@ static void spi_lm70llp_attach(struct parport *p)
 	 */
 	pp->port = p;
 	pd = parport_register_device(p, DRVNAME,
-			NULL, NULL, NULL,
-			PARPORT_FLAG_EXCL, pp);
+				     NULL, NULL, NULL,
+				     PARPORT_FLAG_EXCL, pp);
 	if (!pd) {
 		status = -ENOMEM;
 		goto out_free_master;
@@ -273,7 +273,7 @@ static void spi_lm70llp_attach(struct parport *p)
 	pp->spidev_lm70 = spi_new_device(pp->bitbang.master, &pp->info);
 	if (pp->spidev_lm70)
 		dev_dbg(&pp->spidev_lm70->dev, "spidev_lm70 at %s\n",
-				dev_name(&pp->spidev_lm70->dev));
+			dev_name(&pp->spidev_lm70->dev));
 	else {
 		printk(KERN_WARNING "%s: spi_new_device failed\n", DRVNAME);
 		status = -ENODEV;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1283036 — [PATCH 5/7] spi: lm70llp: remove space

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2015-12-03 14:10 +0100
Subject[PATCH 5/7] spi: lm70llp: remove space
Message-ID<qBBO3-5tU-27@gated-at.bofh.it>
In reply to#1283030
checkpatch complains about space before closing brace.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/spi/spi-lm70llp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-lm70llp.c b/drivers/spi/spi-lm70llp.c
index 5f526ce..62d0f6d 100644
--- a/drivers/spi/spi-lm70llp.c
+++ b/drivers/spi/spi-lm70llp.c
@@ -166,7 +166,7 @@ static inline int getmiso(struct spi_device *s)
 {
 	struct spi_lm70llp *pp = spidev_to_pp(s);
 
-	return ((SIO == (parport_read_status(pp->port) & SIO)) ? 0 : 1 );
+	return ((SIO == (parport_read_status(pp->port) & SIO)) ? 0 : 1);
 }
 
 /*--------------------------------------------------------------------*/
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1283037 — [PATCH 2/7] spi: lm70llp: add blank line after declaration

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2015-12-03 14:10 +0100
Subject[PATCH 2/7] spi: lm70llp: add blank line after declaration
Message-ID<qBBO3-5tU-35@gated-at.bofh.it>
In reply to#1283030
checkpatch complains about missing blank line after declaration.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/spi/spi-lm70llp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/spi/spi-lm70llp.c b/drivers/spi/spi-lm70llp.c
index eb4b421..7037028 100644
--- a/drivers/spi/spi-lm70llp.c
+++ b/drivers/spi/spi-lm70llp.c
@@ -119,12 +119,14 @@ static inline void assertCS(struct spi_lm70llp *pp)
 static inline void clkHigh(struct spi_lm70llp *pp)
 {
 	u8 data = parport_read_data(pp->port);
+
 	parport_write_data(pp->port, data | SCLK);
 }
 
 static inline void clkLow(struct spi_lm70llp *pp)
 {
 	u8 data = parport_read_data(pp->port);
+
 	parport_write_data(pp->port, data & ~SCLK);
 }
 
@@ -163,8 +165,10 @@ static inline void setmosi(struct spi_device *s, int is_on)
 static inline int getmiso(struct spi_device *s)
 {
 	struct spi_lm70llp *pp = spidev_to_pp(s);
+
 	return ((SIO == (parport_read_status(pp->port) & SIO)) ? 0 : 1 );
 }
+
 /*--------------------------------------------------------------------*/
 
 #include "spi-bitbang-txrx.h"
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web