diff mbox

[v3,5/5] i2c: pca-platform: use dev_warn/dev_info instead of printk

Message ID 20170626004434.2757-6-chris.packham@alliedtelesis.co.nz
State Accepted
Headers show

Commit Message

Chris Packham June 26, 2017, 12:44 a.m. UTC
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
 drivers/i2c/busses/i2c-pca-platform.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Wolfram Sang June 27, 2017, 7:55 p.m. UTC | #1
On Mon, Jun 26, 2017 at 12:44:34PM +1200, Chris Packham wrote:
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>

Applied to for-next, thanks!
Andy Shevchenko June 28, 2017, 9:28 a.m. UTC | #2
On Mon, Jun 26, 2017 at 3:44 AM, Chris Packham
<chris.packham@alliedtelesis.co.nz> wrote:

On the first glance I have thought this is _the_ only patch that
doesn't make my eyes hurt.

Not a chance! Where is the commit message?

Code below though looks fine.

> @@ -107,8 +107,8 @@ static int i2c_pca_pf_waitforcompletion(void *pd)
>  static void i2c_pca_pf_dummyreset(void *pd)
>  {
>         struct i2c_pca_pf_data *i2c = pd;
> -       printk(KERN_WARNING "%s: No reset-pin found. Chip may get stuck!\n",
> -               i2c->adap.name);
> +
> +       dev_warn(&i2c->adap.dev, "No reset-pin found. Chip may get stuck!\n");
>  }
>
>  static void i2c_pca_pf_resetchip(void *pd)
> @@ -236,7 +236,7 @@ static int i2c_pca_pf_probe(struct platform_device *pdev)
>
>         platform_set_drvdata(pdev, i2c);
>
> -       printk(KERN_INFO "%s registered.\n", i2c->adap.name);
> +       dev_info(&pdev->dev, "registered.\n");
>
>         return 0;
>  }
> --
> 2.13.0
>
Wolfram Sang June 28, 2017, 9:37 a.m. UTC | #3
> Not a chance! Where is the commit message?

Don't you think $subject is clear enough?
Andy Shevchenko June 28, 2017, 10:57 a.m. UTC | #4
On Wed, Jun 28, 2017 at 12:37 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
>
>> Not a chance! Where is the commit message?
>
> Don't you think $subject is clear enough?

I would add the comment at least on how the output is changed since
pr_*("%s:"..., i2c->adap.name,...)  to dev_*(&pdev->dev, ...)
replacement.
Wolfram Sang June 28, 2017, 12:01 p.m. UTC | #5
On Wed, Jun 28, 2017 at 01:57:01PM +0300, Andy Shevchenko wrote:
> On Wed, Jun 28, 2017 at 12:37 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
> >
> >> Not a chance! Where is the commit message?
> >
> > Don't you think $subject is clear enough?
> 
> I would add the comment at least on how the output is changed since
> pr_*("%s:"..., i2c->adap.name,...)  to dev_*(&pdev->dev, ...)
> replacement.

Yes, that could have been done.
diff mbox

Patch

diff --git a/drivers/i2c/busses/i2c-pca-platform.c b/drivers/i2c/busses/i2c-pca-platform.c
index 7db481cbf402..395eca0cbb1f 100644
--- a/drivers/i2c/busses/i2c-pca-platform.c
+++ b/drivers/i2c/busses/i2c-pca-platform.c
@@ -107,8 +107,8 @@  static int i2c_pca_pf_waitforcompletion(void *pd)
 static void i2c_pca_pf_dummyreset(void *pd)
 {
 	struct i2c_pca_pf_data *i2c = pd;
-	printk(KERN_WARNING "%s: No reset-pin found. Chip may get stuck!\n",
-		i2c->adap.name);
+
+	dev_warn(&i2c->adap.dev, "No reset-pin found. Chip may get stuck!\n");
 }
 
 static void i2c_pca_pf_resetchip(void *pd)
@@ -236,7 +236,7 @@  static int i2c_pca_pf_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, i2c);
 
-	printk(KERN_INFO "%s registered.\n", i2c->adap.name);
+	dev_info(&pdev->dev, "registered.\n");
 
 	return 0;
 }