[OPW,kernel] Staging: iio: fix printk(KERN_ERR ..
diff mbox

Message ID 1381060591-6075-1-git-send-email-ebru.akagunduz@gmail.com
State Changes Requested
Headers show

Commit Message

Ebru Akagündüz Oct. 6, 2013, 11:56 a.m. UTC
Fix checkpatch.pl issues with prefer netdev_err(netdev, ... then dev_err(dev, ..
then pr_err(...  to printk(KERN_ERR  in lis3l02dq_core.c

Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
---
 drivers/staging/iio/accel/lis3l02dq_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Josh Triplett Oct. 6, 2013, 9:20 p.m. UTC | #1
On Sun, Oct 06, 2013 at 02:56:31PM +0300, Ebru Akagunduz wrote:
> Fix checkpatch.pl issues with prefer netdev_err(netdev, ... then dev_err(dev, ..
> then pr_err(...  to printk(KERN_ERR  in lis3l02dq_core.c
> 
> Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>

Reviewed-by: Josh Triplett <josh@joshtriplett.org>

> ---
>  drivers/staging/iio/accel/lis3l02dq_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/iio/accel/lis3l02dq_core.c b/drivers/staging/iio/accel/lis3l02dq_core.c
> index bb852dc..0d5dd5d 100644
> --- a/drivers/staging/iio/accel/lis3l02dq_core.c
> +++ b/drivers/staging/iio/accel/lis3l02dq_core.c
> @@ -694,7 +694,7 @@ static int lis3l02dq_probe(struct spi_device *spi)
>  				  lis3l02dq_channels,
>  				  ARRAY_SIZE(lis3l02dq_channels));
>  	if (ret) {
> -		printk(KERN_ERR "failed to initialize the buffer\n");
> +		pr_err("failed to initialize the buffer\n");
>  		goto error_unreg_buffer_funcs;
>  	}
>  
> -- 
> 1.8.1.2
> 
> -- 
> You received this message because you are subscribed to the Google Groups "opw-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to opw-kernel+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
Greg KH Oct. 7, 2013, 4:59 a.m. UTC | #2
On Sun, Oct 06, 2013 at 02:56:31PM +0300, Ebru Akagunduz wrote:
> Fix checkpatch.pl issues with prefer netdev_err(netdev, ... then dev_err(dev, ..
> then pr_err(...  to printk(KERN_ERR  in lis3l02dq_core.c
> 
> Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com>
> ---
>  drivers/staging/iio/accel/lis3l02dq_core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/iio/accel/lis3l02dq_core.c b/drivers/staging/iio/accel/lis3l02dq_core.c
> index bb852dc..0d5dd5d 100644
> --- a/drivers/staging/iio/accel/lis3l02dq_core.c
> +++ b/drivers/staging/iio/accel/lis3l02dq_core.c
> @@ -694,7 +694,7 @@ static int lis3l02dq_probe(struct spi_device *spi)
>  				  lis3l02dq_channels,
>  				  ARRAY_SIZE(lis3l02dq_channels));
>  	if (ret) {
> -		printk(KERN_ERR "failed to initialize the buffer\n");
> +		pr_err("failed to initialize the buffer\n");

This patch, as-is, is fine, but it really should be a call to dev_err()
here, as you do have access to a 'struct device' in the 'struct
spi_device' structure.

So could you change this patch to use dev_err() instead?  It's a much
more verbose call than a "bare" pr_err() in that is shows the driver and
exact device that caused the error message to be printed out, which
makes things much easier for a user to deal with.

thanks,

greg k-h

Patch
diff mbox

diff --git a/drivers/staging/iio/accel/lis3l02dq_core.c b/drivers/staging/iio/accel/lis3l02dq_core.c
index bb852dc..0d5dd5d 100644
--- a/drivers/staging/iio/accel/lis3l02dq_core.c
+++ b/drivers/staging/iio/accel/lis3l02dq_core.c
@@ -694,7 +694,7 @@  static int lis3l02dq_probe(struct spi_device *spi)
 				  lis3l02dq_channels,
 				  ARRAY_SIZE(lis3l02dq_channels));
 	if (ret) {
-		printk(KERN_ERR "failed to initialize the buffer\n");
+		pr_err("failed to initialize the buffer\n");
 		goto error_unreg_buffer_funcs;
 	}