Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757428Ab3ENMwf (ORCPT ); Tue, 14 May 2013 08:52:35 -0400 Received: from mail-ie0-f179.google.com ([209.85.223.179]:59896 "EHLO mail-ie0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756770Ab3ENMwc (ORCPT ); Tue, 14 May 2013 08:52:32 -0400 MIME-Version: 1.0 In-Reply-To: <1368370791-32630-1-git-send-email-laurent.navet@gmail.com> References: <1368370791-32630-1-git-send-email-laurent.navet@gmail.com> Date: Tue, 14 May 2013 14:52:31 +0200 Message-ID: Subject: Re: [PATCH] drivers: pinctrl: vt8500: use devm_ioremap_resource() From: Linus Walleij To: Laurent Navet , Grant Likely Cc: Tony Prisk , Stephen Warren , Olof Johansson , Axel Lin , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1965 Lines: 51 On Sun, May 12, 2013 at 4:59 PM, Laurent Navet wrote: > Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource. Oh is that deprecated? I had no clue :-/ Can you point to some rationale about this so I'm not totally misguided in my world..? > Found with coccicheck and this semantic patch: > scripts/coccinelle/api/devm_ioremap_resource.cocci > > Signed-off-by: Laurent Navet Seems OK if the deprecation is ongoing. Tony can I have your ACK? > drivers/pinctrl/vt8500/pinctrl-wmt.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c b/drivers/pinctrl/vt8500/pinctrl-wmt.c > index ab63104..e877082 100644 > --- a/drivers/pinctrl/vt8500/pinctrl-wmt.c > +++ b/drivers/pinctrl/vt8500/pinctrl-wmt.c > @@ -569,10 +569,10 @@ int wmt_pinctrl_probe(struct platform_device *pdev, > struct resource *res; > > res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - data->base = devm_request_and_ioremap(&pdev->dev, res); > - if (!data->base) { > + data->base = devm_ioremap_resource(&pdev->dev, res); > + if (IS_ERR(data->base)) { > dev_err(&pdev->dev, "failed to map memory resource\n"); > - return -EBUSY; > + return PTR_ERR(data->base); > } Grant is just going to *not* love this type of patches replacing nullchecks with IS_ERR() stuff all over the kernel. We had a discussion whether the compiler can be made to annotate and typecheck pointers to avoid doing mistakes with pointers containing error codes like this. (Vague but you maybe know what I'm after.) Yours, Linus Walleij -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/