From patchwork Mon Apr 1 05:19:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 10879145 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 67FBD186D for ; Mon, 1 Apr 2019 05:20:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B360286A7 for ; Mon, 1 Apr 2019 05:20:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D24E286C0; Mon, 1 Apr 2019 05:20:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DA274286A7 for ; Mon, 1 Apr 2019 05:20:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Fm4inr/6uCaaYXBdPKP0QuUpENClurLMHxPXgF8ESVo=; b=hQcYg+FvA5nUJ9 rqwtqAs74yrlsc3u8odGEXbAk2rH8tZdRPV8DUwQ0KGLdiPLc1kfnCB8B/UuIOpmBpsZLoIa33gOF K7+tdbEUbVoV5wTC4NKEHRW62y0OLdy6tuBwMEuw9Ephybbky1zD04TUv1lAdwIH4dbWqYj0QrH1Y WaibZshzZ2WOgZHKmfU6R3PmjAzc319n6FdWw8lRc1UC7LwrJ3VDQ3bS/4+JX6WYGzb5jY5iFSeVY Wj6Sh1UaCgggYiuTBeQHN0WJyt3jDRLk474nCo1lVgv6hmNliJyFZ/6SHxiM/ADRdqgfb3PgZJSnX FBCch3OCmhAfXps7EC4A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hApMY-00084R-P1; Mon, 01 Apr 2019 05:20:02 +0000 Received: from mail-eopbgr30056.outbound.protection.outlook.com ([40.107.3.56] helo=EUR03-AM5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hApMV-00083x-9Q for linux-arm-kernel@lists.infradead.org; Mon, 01 Apr 2019 05:20:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gjQ29Bb99KvaZDOBdO3VWLYAcE53MgZC/WyoEBCX+II=; b=GhXih6vpWSFZAhnaWzU1StA3jOAEgDcyUlko1C2RnfEFsbfrhEEnTqYQJ7hFxxvHEtS8Hhfz/Zz0xWlGL9ZMpLI6s4dRnEHe2UVjIVzvOYM0mvuj06yWj+FLdeyJNTk14R2R+IRAMF4Jc76+BfIsYTMX88wj8rYPdoYxuD6AAWk= Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com (52.134.72.18) by DB3PR0402MB3673.eurprd04.prod.outlook.com (52.134.70.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.16; Mon, 1 Apr 2019 05:19:55 +0000 Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::f1b4:a1fb:cfd1:3f08]) by DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::f1b4:a1fb:cfd1:3f08%7]) with mapi id 15.20.1750.017; Mon, 1 Apr 2019 05:19:55 +0000 From: Anson Huang To: "dmitry.torokhov@gmail.com" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , "linux-input@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] input: imx6ul_tsc: use devm_platform_ioremap_resource() to simplify code Thread-Topic: [PATCH] input: imx6ul_tsc: use devm_platform_ioremap_resource() to simplify code Thread-Index: AQHU6EqK7YCFSFAUiEmCAJSqda9wGQ== Date: Mon, 1 Apr 2019 05:19:55 +0000 Message-ID: <1554095712-15413-1-git-send-email-Anson.Huang@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK2PR06CA0006.apcprd06.prod.outlook.com (2603:1096:202:2e::18) To DB3PR0402MB3916.eurprd04.prod.outlook.com (2603:10a6:8:10::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=anson.huang@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 64ae32ec-6b8a-4a9d-e3ca-08d6b661ad18 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DB3PR0402MB3673; x-ms-traffictypediagnostic: DB3PR0402MB3673: x-microsoft-antispam-prvs: x-forefront-prvs: 0994F5E0C5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(346002)(376002)(136003)(396003)(199004)(189003)(71190400001)(305945005)(14454004)(110136005)(52116002)(6506007)(26005)(6436002)(2201001)(102836004)(2906002)(105586002)(486006)(6116002)(5660300002)(106356001)(6512007)(36756003)(66066001)(53936002)(99286004)(478600001)(68736007)(7736002)(2501003)(8936002)(386003)(2616005)(3846002)(97736004)(186003)(86362001)(8676002)(25786009)(6486002)(476003)(4326008)(256004)(81156014)(81166006)(316002)(50226002)(71200400001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0402MB3673; H:DB3PR0402MB3916.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: oxCBVGRklem4sc5YMAkG41wQpL9h8VmrFR4Lf1dG+cy4DFDnxNyFaJS96qd1mu4au1hf3MdMccdGJiOf9N6IqF72wNgIVElpWuJDRdSeNezQaUdOrs95SQV5ZAZ2K8YcdRuImXA9xvbKrYtnYsHtkUY9nkAxh/xe26JBcyVAu15ZoWrh+Uhx5Kv9z4OvNImBhQ17/69QNVXvmXLht7inNMv1js9I9VJ8gEJXR46OOLRZwsgRmYNEffyv34nXjxitkuAVAHNt0PtIvabW0kCoJtAH/1YFQ0wEX9mMz6MlxnTTrnbfnl45vhUmxQM6kiCpQgL0Wd1aPaSaB57q2O3WZgxopdr6c6vHslEYyQZrZ409W9ADtdPY4FsnQe2ciNuNrhgzOHwUqltCiJp6erTnMsFxWgjYz1AXxPVJfrEIEo0= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 64ae32ec-6b8a-4a9d-e3ca-08d6b661ad18 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2019 05:19:55.4008 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0402MB3673 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190331_221959_331166_9617912F X-CRM114-Status: UNSURE ( 9.78 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dl-linux-imx Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use the new helper devm_platform_ioremap_resource() which wraps the platform_get_resource() and devm_ioremap_resource() together, to simplify the code. Signed-off-by: Anson Huang Reviewed-by: Mukesh Ojha --- drivers/input/touchscreen/imx6ul_tsc.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/input/touchscreen/imx6ul_tsc.c b/drivers/input/touchscreen/imx6ul_tsc.c index c10fc59..e04eecd 100644 --- a/drivers/input/touchscreen/imx6ul_tsc.c +++ b/drivers/input/touchscreen/imx6ul_tsc.c @@ -364,8 +364,6 @@ static int imx6ul_tsc_probe(struct platform_device *pdev) struct device_node *np = pdev->dev.of_node; struct imx6ul_tsc *tsc; struct input_dev *input_dev; - struct resource *tsc_mem; - struct resource *adc_mem; int err; int tsc_irq; int adc_irq; @@ -403,16 +401,14 @@ static int imx6ul_tsc_probe(struct platform_device *pdev) return err; } - tsc_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - tsc->tsc_regs = devm_ioremap_resource(&pdev->dev, tsc_mem); + tsc->tsc_regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(tsc->tsc_regs)) { err = PTR_ERR(tsc->tsc_regs); dev_err(&pdev->dev, "failed to remap tsc memory: %d\n", err); return err; } - adc_mem = platform_get_resource(pdev, IORESOURCE_MEM, 1); - tsc->adc_regs = devm_ioremap_resource(&pdev->dev, adc_mem); + tsc->adc_regs = devm_platform_ioremap_resource(pdev, 1); if (IS_ERR(tsc->adc_regs)) { err = PTR_ERR(tsc->adc_regs); dev_err(&pdev->dev, "failed to remap adc memory: %d\n", err);