From patchwork Tue Aug 27 07:05:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Vishwanathrao Badarkhe, Manish" X-Patchwork-Id: 2850007 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 46F08BF546 for ; Tue, 27 Aug 2013 07:06:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 36CB12026C for ; Tue, 27 Aug 2013 07:06:31 +0000 (UTC) Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E19D120259 for ; Tue, 27 Aug 2013 07:06:29 +0000 (UTC) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r7R76Tbt028558 for ; Tue, 27 Aug 2013 02:06:29 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r7R76TwY019230 for ; Tue, 27 Aug 2013 02:06:29 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.2.342.3; Tue, 27 Aug 2013 02:06:28 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id r7R76SRB006341 for ; Tue, 27 Aug 2013 02:06:28 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id B7BF080626 for ; Tue, 27 Aug 2013 02:06:28 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dlelxv90.itg.ti.com (dlelxv90.itg.ti.com [172.17.2.17]) by linux.omap.com (Postfix) with ESMTP id CCDC180626 for ; Tue, 27 Aug 2013 02:05:35 -0500 (CDT) Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r7R75ZZT016749; Tue, 27 Aug 2013 02:05:35 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Tue, 27 Aug 2013 02:05:35 -0500 Received: from udx0190826 (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id r7R75Ynk005510; Tue, 27 Aug 2013 02:05:35 -0500 Received: from x0190826 by udx0190826 with local (Exim 4.76) (envelope-from ) id 1VEDLK-0002LA-CF; Tue, 27 Aug 2013 12:35:34 +0530 From: "Vishwanathrao Badarkhe, Manish" To: , , Subject: [PATCH] pinctrl: pinctrl-single: Convert to devm_ioremap_resource() Date: Tue, 27 Aug 2013 12:35:34 +0530 Message-ID: <1377587134-8967-1-git-send-email-manishv.b@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 CC: , X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: Errors-To: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Vishwanathrao Badarkhe, Manish" Convert devm_request_mem_region() and devm_ioremap() to devm_ioremap_resource() which provides more consistent error handling to manage resource. Signed-off-by: Vishwanathrao Badarkhe, Manish --- :100644 100644 7323cca... b0fef18... M drivers/pinctrl/pinctrl-single.c drivers/pinctrl/pinctrl-single.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index 7323cca..b0fef18 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c @@ -1556,24 +1556,9 @@ static int pcs_probe(struct platform_device *pdev) "pinctrl-single,bit-per-mux"); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(pcs->dev, "could not get resource\n"); - return -ENODEV; - } - - pcs->res = devm_request_mem_region(pcs->dev, res->start, - resource_size(res), DRIVER_NAME); - if (!pcs->res) { - dev_err(pcs->dev, "could not get mem_region\n"); - return -EBUSY; - } - - pcs->size = resource_size(pcs->res); - pcs->base = devm_ioremap(pcs->dev, pcs->res->start, pcs->size); - if (!pcs->base) { - dev_err(pcs->dev, "could not ioremap\n"); - return -ENODEV; - } + pcs->base = devm_ioremap_resource(pcs->dev, res); + if (IS_ERR(pcs->base)) + return PTR_ERR(pcs->base); INIT_RADIX_TREE(&pcs->pgtree, GFP_KERNEL); INIT_RADIX_TREE(&pcs->ftree, GFP_KERNEL);