Re: [staging-next 2/4] staging/mei: use pr_err instead of printk(KERN_ERR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 19, 2012 at 05:58:41PM +0200, Tomas Winkler wrote:
> pr_ format is more compact and enable utilizing of pr_fmt macro
> 
> Signed-off-by: Tomas Winkler <tomas.winkler@xxxxxxxxx>
> ---
>  drivers/staging/mei/main.c |   17 ++++++++---------
>  1 files changed, 8 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/staging/mei/main.c b/drivers/staging/mei/main.c
> index 383ae9f..fd987ac 100644
> --- a/drivers/staging/mei/main.c
> +++ b/drivers/staging/mei/main.c
> @@ -962,7 +962,7 @@ static int __devinit mei_probe(struct pci_dev *pdev,
>  	/* enable pci dev */
>  	err = pci_enable_device(pdev);
>  	if (err) {
> -		printk(KERN_ERR "mei: Failed to enable pci device.\n");
> +		pr_err("failed to enable pci device.\n");

No, use dev_err() here.

>  		goto end;
>  	}
>  	/* set PCI host mastering  */
> @@ -970,7 +970,7 @@ static int __devinit mei_probe(struct pci_dev *pdev,
>  	/* pci request regions for mei driver */
>  	err = pci_request_regions(pdev, mei_driver_name);
>  	if (err) {
> -		printk(KERN_ERR "mei: Failed to get pci regions.\n");
> +		pr_err("failed to get pci regions.\n");

And here.

>  		goto disable_device;
>  	}
>  	/* allocates and initializes the mei dev structure */
> @@ -982,7 +982,7 @@ static int __devinit mei_probe(struct pci_dev *pdev,
>  	/* mapping  IO device memory */
>  	dev->mem_addr = pci_iomap(pdev, 0, 0);
>  	if (!dev->mem_addr) {
> -		printk(KERN_ERR "mei: mapping I/O device memory failure.\n");
> +		pr_err("mapping I/O device memory failure.\n");

And here.

>  		err = -ENOMEM;
>  		goto free_device;
>  	}
> @@ -1001,13 +1001,13 @@ static int __devinit mei_probe(struct pci_dev *pdev,
>  			IRQF_SHARED, mei_driver_name, dev);
>  
>  	if (err) {
> -		printk(KERN_ERR "mei: request_threaded_irq failure. irq = %d\n",
> +		pr_err("request_threaded_irq failure. irq = %d\n",
>  		       pdev->irq);

And here.

And odds are, everywhere else in this patch.

A driver should almost never have any pr_* functions called.  Your 1/4
patch in this series is about all that it would ever have.  Everything
else should use the dev_* functions instead.

I can't take this patch, sorry.

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux