From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753416AbdCMU5V (ORCPT ); Mon, 13 Mar 2017 16:57:21 -0400 Received: from mail-qk0-f174.google.com ([209.85.220.174]:34577 "EHLO mail-qk0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750902AbdCMU5O (ORCPT ); Mon, 13 Mar 2017 16:57:14 -0400 Subject: Re: [PATCH] staging: android: ion: Replace pr_err with dev_err To: simran singhal References: <20170313135624.GA9869@singhal-Inspiron-5558> Cc: Sumit Semwal , Greg Kroah-Hartman , =?UTF-8?Q?Arve_Hj=c3=b8nnev=c3=a5g?= , Riley Andrews , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, outreachy-kernel@googlegroups.com From: Laura Abbott Message-ID: <1d40e93b-d384-353a-43e9-cdfb976d7168@redhat.com> Date: Mon, 13 Mar 2017 13:57:08 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170313135624.GA9869@singhal-Inspiron-5558> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/13/2017 06:56 AM, simran singhal wrote: > All devm functions has a device structure as the first argument which is > required by dev_{err,info,dbg} printing functions. > This patch converts pr_err to dev_err as dev_* is preferred after calls > to devm functions. > > Done using coccinelle: > > @r1 exists@ > expression e,e1; > identifier f =~ "^devm_"; > identifier g =~ "^pcim_"; > identifier h =~ "^dmam_"; > @@ > e=\(f\|g\|h\)(e1,...); > <+... > ( > - pr_info( > + dev_info(e1, > ...); > | > - pr_err( > + dev_err(e1, > ...); > | > - pr_debug( > + dev_dbg(e1, > ...); > ) > ...+> > > Signed-off-by: simran singhal > --- > drivers/staging/android/ion/ion_test.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/android/ion/ion_test.c b/drivers/staging/android/ion/ion_test.c > index 5abf8320..0ab7d11 100644 > --- a/drivers/staging/android/ion/ion_test.c > +++ b/drivers/staging/android/ion/ion_test.c > @@ -255,7 +255,7 @@ static int __init ion_test_probe(struct platform_device *pdev) > testdev->misc.parent = &pdev->dev; > ret = misc_register(&testdev->misc); > if (ret) { > - pr_err("failed to register misc device.\n"); > + dev_err(&pdev->dev, "failed to register misc device.\n"); > return ret; > } > > Acked-by: Laura Abbott