On Thu, Mar 26, 2015 at 3:31 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:


On Wed, 25 Mar 2015, Helen Fornazier wrote:

> This patch fixes the following checkpatch.pl warning:
>
> WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...
> +               printk(KERN_ERR "DGNC: sysfs driver_create_file failed!\n");
>
> Signed-off-by: Helen Fornazier <helen.fornazier@gmail.com>
> ---
>  drivers/staging/dgnc/dgnc_sysfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/dgnc/dgnc_sysfs.c b/drivers/staging/dgnc/dgnc_sysfs.c
> index 2df889e..65551d1 100644
> --- a/drivers/staging/dgnc/dgnc_sysfs.c
> +++ b/drivers/staging/dgnc/dgnc_sysfs.c
> @@ -75,7 +75,7 @@ void dgnc_create_driver_sysfiles(struct pci_driver *dgnc_driver)
>       rc |= driver_create_file(driverfs, &driver_attr_maxboards);
>       rc |= driver_create_file(driverfs, &driver_attr_pollrate);
>       if (rc)
> -             printk(KERN_ERR "DGNC: sysfs driver_create_file failed!\n");
> +             pr_err("DGNC: sysfs driver_create_file failed!\n");

The dgnc_driver should give you access to a device-typed field so you can
use dev_err.

julia


I though about that and I saw that other parts of the code uses dev_err, but inside the dgnc_create_driver_sysfiles function I couldn't figure it out how to get the "structure device" object to use inside the dev_err function.
 
>  }
>
>
> --
> 1.9.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1427328593-6576-1-git-send-email-helen.fornazier%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>



--
Helen Fornazier