Staging: media: replace pr_* with dev_*
authorHaneen Mohammed <hamohammed.sa@gmail.com>
Wed, 18 Mar 2015 10:09:50 +0000 (13:09 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2015 10:21:33 +0000 (11:21 +0100)
This patch replace pr_err/pr_info with dev_err/dev_infi, when
appropriate device structure is found.

Issues found using the following Coccinelle script. pr_err/dev_err was
substituted with pr_info/dev_info in the later case.

@r exists@
identifier f, s, i;
position p;
@@
f(...,struct s *i,...) {
<+...
when != i == NULL
pr_err@p(...);
...+>
}
@rr@
identifier r.s, s2, fld;
@@

struct s {
...
struct s2 *fld;
...
};

@rrr@
identifier rr.s2, fld2;
@@

struct s2 {
...
struct device fld2;
...
};
@@
identifier r.i, r.s, rr.fld, rrr.fld2;
position r.p;
@@

-pr_err@p
+dev_err
   (
+ &i->fld->fld2,
...)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/davinci_vpfe/dm365_ipipeif.c
drivers/staging/media/lirc/lirc_sasem.c

index ceeef18630cc83d13899839de8c2749fffeff8a9..17e105e7d892db8c02945f5db4c66926e0f0dbff 100644 (file)
@@ -209,7 +209,7 @@ static int ipipeif_hw_setup(struct v4l2_subdev *sd)
        /* Combine all the fields to make CFG1 register of IPIPEIF */
        tmp = val = get_oneshot_mode(ipipeif->input);
        if (tmp < 0) {
-               pr_err("ipipeif: links setup required");
+               dev_err(&sd->devnode->dev, "ipipeif: links setup required");
                return -EINVAL;
        }
        val <<= ONESHOT_SHIFT;
index b9c53e2d5d29a39d9391c3d3876eaddbcfbb8b2b..0c9e08247d7f7d6d8f8babc9cc8227862282f4c6 100644 (file)
@@ -172,7 +172,8 @@ static void delete_context(struct sasem_context *context)
        kfree(context);
 
        if (debug)
-               pr_info("%s: context deleted\n", __func__);
+               dev_info(&context->dev->dev, "%s: context deleted\n",
+                        __func__);
 }
 
 static void deregister_from_lirc(struct sasem_context *context)
@@ -182,10 +183,12 @@ static void deregister_from_lirc(struct sasem_context *context)
 
        retval = lirc_unregister_driver(minor);
        if (retval)
-               pr_err("%s: unable to deregister from lirc (%d)\n",
+               dev_err(&context->dev->dev,
+                       "%s: unable to deregister from lirc (%d)\n",
                       __func__, retval);
        else
-               pr_info("Deregistered Sasem driver (minor:%d)\n", minor);
+               dev_info(&context->dev->dev,
+                        "Deregistered Sasem driver (minor:%d)\n", minor);
 
 }