* [PATCH v2 4/8] spi: lm70llp: correct alignment
2015-12-07 10:47 [PATCH v2 1/8] spi: lm70llp: remove multiple blank lines Sudip Mukherjee
@ 2015-12-07 10:47 ` Sudip Mukherjee
2015-12-07 10:47 ` [PATCH v2 5/8] spi: lm70llp: remove space Sudip Mukherjee
` (4 subsequent siblings)
5 siblings, 0 replies; 13+ messages in thread
From: Sudip Mukherjee @ 2015-12-07 10:47 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-kernel, linux-spi, Sudip Mukherjee
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
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 5/8] spi: lm70llp: remove space
2015-12-07 10:47 [PATCH v2 1/8] spi: lm70llp: remove multiple blank lines Sudip Mukherjee
2015-12-07 10:47 ` [PATCH v2 4/8] spi: lm70llp: correct alignment Sudip Mukherjee
@ 2015-12-07 10:47 ` Sudip Mukherjee
2015-12-07 10:47 ` [PATCH v2 6/8] spi: lm70llp: use new parport device model Sudip Mukherjee
` (3 subsequent siblings)
5 siblings, 0 replies; 13+ messages in thread
From: Sudip Mukherjee @ 2015-12-07 10:47 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-kernel, linux-spi, Sudip Mukherjee
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
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 6/8] spi: lm70llp: use new parport device model
2015-12-07 10:47 [PATCH v2 1/8] spi: lm70llp: remove multiple blank lines Sudip Mukherjee
2015-12-07 10:47 ` [PATCH v2 4/8] spi: lm70llp: correct alignment Sudip Mukherjee
2015-12-07 10:47 ` [PATCH v2 5/8] spi: lm70llp: remove space Sudip Mukherjee
@ 2015-12-07 10:47 ` Sudip Mukherjee
2015-12-07 10:47 ` [PATCH v2 7/8] spi: lm70llp: use dev_warn Sudip Mukherjee
` (2 subsequent siblings)
5 siblings, 0 replies; 13+ messages in thread
From: Sudip Mukherjee @ 2015-12-07 10:47 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-kernel, linux-spi, Sudip Mukherjee
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 62d0f6d..9d45a63 100644
--- a/drivers/spi/spi-lm70llp.c
+++ b/drivers/spi/spi-lm70llp.c
@@ -197,6 +197,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) {
printk(KERN_WARNING
@@ -228,9 +229,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;
@@ -322,8 +325,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
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 7/8] spi: lm70llp: use dev_warn
2015-12-07 10:47 [PATCH v2 1/8] spi: lm70llp: remove multiple blank lines Sudip Mukherjee
` (2 preceding siblings ...)
2015-12-07 10:47 ` [PATCH v2 6/8] spi: lm70llp: use new parport device model Sudip Mukherjee
@ 2015-12-07 10:47 ` Sudip Mukherjee
[not found] ` <1449485255-1103-7-git-send-email-sudipm.mukherjee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
[not found] ` <1449485255-1103-1-git-send-email-sudipm.mukherjee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-12-07 20:07 ` [PATCH v2 1/8] spi: lm70llp: remove multiple blank lines Mark Brown
5 siblings, 1 reply; 13+ messages in thread
From: Sudip Mukherjee @ 2015-12-07 10:47 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-kernel, linux-spi, Sudip Mukherjee
As we have a struct device available it is better to use dev_warn()
instead of printk.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/spi/spi-lm70llp.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-lm70llp.c b/drivers/spi/spi-lm70llp.c
index 9d45a63..393eb2b 100644
--- a/drivers/spi/spi-lm70llp.c
+++ b/drivers/spi/spi-lm70llp.c
@@ -249,9 +249,8 @@ 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);
+ dev_warn(&pd->dev, "spi_bitbang_start failed with status %d\n",
+ status);
goto out_off_and_release;
}
@@ -278,7 +277,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);
+ dev_warn(&pd->dev, "spi_new_device failed\n");
status = -ENODEV;
goto out_bitbang_stop;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
[parent not found: <1449485255-1103-1-git-send-email-sudipm.mukherjee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* [PATCH v2 2/8] spi: lm70llp: add blank line after declaration
[not found] ` <1449485255-1103-1-git-send-email-sudipm.mukherjee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-12-07 10:47 ` Sudip Mukherjee
2015-12-07 10:47 ` [PATCH v2 3/8] spi: lm70llp: remove cast to void Sudip Mukherjee
2015-12-07 10:47 ` [PATCH v2 8/8] spi: lm70llp: remove printk Sudip Mukherjee
2 siblings, 0 replies; 13+ messages in thread
From: Sudip Mukherjee @ 2015-12-07 10:47 UTC (permalink / raw)
To: Mark Brown
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-spi-u79uwXL29TY76Z2rM5mHXA, Sudip Mukherjee
checkpatch complains about missing blank line after declaration.
Signed-off-by: Sudip Mukherjee <sudip-ofJRbWXBVFamYgehrs7/Lw@public.gmane.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-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 3/8] spi: lm70llp: remove cast to void
[not found] ` <1449485255-1103-1-git-send-email-sudipm.mukherjee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-12-07 10:47 ` [PATCH v2 2/8] spi: lm70llp: add blank line after declaration Sudip Mukherjee
@ 2015-12-07 10:47 ` Sudip Mukherjee
2015-12-07 10:47 ` [PATCH v2 8/8] spi: lm70llp: remove printk Sudip Mukherjee
2 siblings, 0 replies; 13+ messages in thread
From: Sudip Mukherjee @ 2015-12-07 10:47 UTC (permalink / raw)
To: Mark Brown
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-spi-u79uwXL29TY76Z2rM5mHXA, Sudip Mukherjee
checkpatch was complaining about space after cast. But the cast to void
is not required at that place.
Signed-off-by: Sudip Mukherjee <sudip-ofJRbWXBVFamYgehrs7/Lw@public.gmane.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-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 8/8] spi: lm70llp: remove printk
[not found] ` <1449485255-1103-1-git-send-email-sudipm.mukherjee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-12-07 10:47 ` [PATCH v2 2/8] spi: lm70llp: add blank line after declaration Sudip Mukherjee
2015-12-07 10:47 ` [PATCH v2 3/8] spi: lm70llp: remove cast to void Sudip Mukherjee
@ 2015-12-07 10:47 ` Sudip Mukherjee
2 siblings, 0 replies; 13+ messages in thread
From: Sudip Mukherjee @ 2015-12-07 10:47 UTC (permalink / raw)
To: Mark Brown
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-spi-u79uwXL29TY76Z2rM5mHXA, Sudip Mukherjee
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-ofJRbWXBVFamYgehrs7/Lw@public.gmane.org>
---
drivers/spi/spi-lm70llp.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-lm70llp.c b/drivers/spi/spi-lm70llp.c
index 393eb2b..8fe83d0 100644
--- a/drivers/spi/spi-lm70llp.c
+++ b/drivers/spi/spi-lm70llp.c
@@ -14,6 +14,8 @@
* GNU General Public License for more details.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
@@ -200,9 +202,7 @@ static void spi_lm70llp_attach(struct parport *p)
struct pardev_cb lm70llp_cb;
if (lm70llp) {
- printk(KERN_WARNING
- "%s: spi_lm70llp instance already loaded. Aborting.\n",
- DRVNAME);
+ pr_warn("spi_lm70llp instance already loaded. Aborting.\n");
return;
}
@@ -298,7 +298,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-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/8] spi: lm70llp: remove multiple blank lines
2015-12-07 10:47 [PATCH v2 1/8] spi: lm70llp: remove multiple blank lines Sudip Mukherjee
` (4 preceding siblings ...)
[not found] ` <1449485255-1103-1-git-send-email-sudipm.mukherjee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-12-07 20:07 ` Mark Brown
2015-12-08 4:33 ` Sudip Mukherjee
5 siblings, 1 reply; 13+ messages in thread
From: Mark Brown @ 2015-12-07 20:07 UTC (permalink / raw)
To: Sudip Mukherjee; +Cc: linux-kernel, linux-spi
[-- Attachment #1: Type: text/plain, Size: 311 bytes --]
On Mon, Dec 07, 2015 at 04:17:28PM +0530, Sudip Mukherjee wrote:
> checkpatch complains about multiple blank lines.
Please don't resubmit already applied patches, please submit against the
latest development code for the subsystem you're submitting to (unless
the change is a bug fix that should go to Linus).
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/8] spi: lm70llp: remove multiple blank lines
2015-12-07 20:07 ` [PATCH v2 1/8] spi: lm70llp: remove multiple blank lines Mark Brown
@ 2015-12-08 4:33 ` Sudip Mukherjee
2015-12-08 12:49 ` Mark Brown
0 siblings, 1 reply; 13+ messages in thread
From: Sudip Mukherjee @ 2015-12-08 4:33 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-kernel, linux-spi
On Mon, Dec 07, 2015 at 08:07:37PM +0000, Mark Brown wrote:
> On Mon, Dec 07, 2015 at 04:17:28PM +0530, Sudip Mukherjee wrote:
> > checkpatch complains about multiple blank lines.
>
> Please don't resubmit already applied patches, please submit against the
> latest development code for the subsystem you're submitting to (unless
> the change is a bug fix that should go to Linus).
I think there is some confusion. I am not seeing v1 of these patches in
for-next branch of your spi tree. And in review of v1 you said to use
dev_*. And for that last 2 patch of v1 changed and one extra came so I
sent the whole series as v2.
regards
sudip
^ permalink raw reply [flat|nested] 13+ messages in thread