From patchwork Mon Apr 1 05:28:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 10879151 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 D767B922 for ; Mon, 1 Apr 2019 05:28:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDC7B287C1 for ; Mon, 1 Apr 2019 05:28:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1A05287C5; Mon, 1 Apr 2019 05:28:22 +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 6207C287C1 for ; Mon, 1 Apr 2019 05:28:22 +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=SqdUwKnYG0G5XsPgnbmiZR3x2UJPRfD2XfWR7ta6DJo=; b=RNB9XHAErI9J/b f3M8RMFjMhfPntZ7wCLik5imZm/FkKSu7afxvMzlXMdEAVi1ZahzWSMttwp8MJEeXfwmc9zpmB84d vonTv5m+cBPgKg1FljxZ10s7t5o7xSCjAkAIyy+T5Qr6QlWI63RzjfKzjwJJZO35KsOljIFFs8YGb 8ns2Np3tlZgCfjbUauLHcOE2VG3G5P6h3SBw5GrCNO4om0Heh2p9Z4Agdg22kYXuj1mN/fEmga8zZ RY8PCg4m2IigAWAUC0bZtiJCmEHeeJG5OlnJa3gbE5riwBpoLPclh47s6FI96aU7ki6LYnrWKO0q+ SQQdWEy9PdmocT59WYaA==; 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 1hApUa-00035g-8J; Mon, 01 Apr 2019 05:28:20 +0000 Received: from mail-eopbgr80089.outbound.protection.outlook.com ([40.107.8.89] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hApUX-00035K-0Z for linux-arm-kernel@lists.infradead.org; Mon, 01 Apr 2019 05:28:18 +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=prxdrieTjztn3fVK8eoXmD3VqIKmnlN/sx+DVExpxE8=; b=RkWvcl/RpdLYOMAbqNdiik54xAGfUO3u5rX6voa1vCAyvOlR/G13DIqG5OyHI4aHQ9L53jxxdrvocS9x119Egqs0vYw/3hADPRoz5etA+rvMFtP6sENVKp0F99z1ChQqUJUqvDlHv+Thn87WidPz9b1ZxggVe4i/kK1EnCrir94= Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com (52.134.72.18) by DB3PR0402MB3867.eurprd04.prod.outlook.com (52.134.65.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.19; Mon, 1 Apr 2019 05:28:12 +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:28:12 +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: keyboard: imx: use devm_platform_ioremap_resource() to simplify code Thread-Topic: [PATCH] input: keyboard: imx: use devm_platform_ioremap_resource() to simplify code Thread-Index: AQHU6EuzUpMy3ucHfEurgMtAlpFGjg== Date: Mon, 1 Apr 2019 05:28:12 +0000 Message-ID: <1554096209-17870-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: HK2PR02CA0142.apcprd02.prod.outlook.com (2603:1096:202:16::26) 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: 8a868263-07a4-40d2-c902-08d6b662d571 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:DB3PR0402MB3867; x-ms-traffictypediagnostic: DB3PR0402MB3867: x-microsoft-antispam-prvs: x-forefront-prvs: 0994F5E0C5 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(39860400002)(136003)(366004)(199004)(189003)(81156014)(8936002)(6116002)(7736002)(6506007)(386003)(25786009)(102836004)(316002)(3846002)(52116002)(5660300002)(81166006)(26005)(186003)(68736007)(110136005)(97736004)(2906002)(486006)(53936002)(106356001)(105586002)(8676002)(86362001)(2616005)(476003)(4326008)(50226002)(6436002)(305945005)(256004)(14454004)(99286004)(2501003)(71190400001)(71200400001)(6512007)(2201001)(66066001)(6486002)(36756003)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0402MB3867; 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: OSwRe4e+krqcXS7S8xgFZG7L0gewHkJEHnFclR/bsPaVw+VoX9+TpEnkc4C/gEnwnxjPNp/W4DC1MD7rlC3JWyChPwE8uzUfhGh8DgLr5jAHtJ5s4gm875Mqaq1LzJLw68qT/42CzShWHzRJLemr9zAoQIRV+vxsNpvQRFwa0hYPGZ5yOZ0VMNOKcyEB6e0eH8dsMrPXiQrSK9C0U94n0X9C3ZX8AU8yGTf9wl9RNCvToAVxBVJ+nefvDByii93tOQbT+uB/jW/mS2Pq0pHXpKCXEolW7frxgMBmHFM8L2LBwUbb1jvqRk1oPjjeOu6R05aj8mq6J9xlu5QcH/jdKbyjU4s6BTNszQtqXsQ7FzkBA86J9mTewGUF7W3YBlxY49e4LE/Us5FQ1tS/GR0suBmCHHl/vFwdDrkBk0cUc30= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a868263-07a4-40d2-c902-08d6b662d571 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2019 05:28:12.8271 (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: DB3PR0402MB3867 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190331_222817_053336_E518CF88 X-CRM114-Status: UNSURE ( 9.95 ) 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/keyboard/imx_keypad.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c index 539cb67..cf08f4a 100644 --- a/drivers/input/keyboard/imx_keypad.c +++ b/drivers/input/keyboard/imx_keypad.c @@ -422,7 +422,6 @@ static int imx_keypad_probe(struct platform_device *pdev) dev_get_platdata(&pdev->dev); struct imx_keypad *keypad; struct input_dev *input_dev; - struct resource *res; int irq, error, i, row, col; if (!keymap_data && !pdev->dev.of_node) { @@ -455,8 +454,7 @@ static int imx_keypad_probe(struct platform_device *pdev) timer_setup(&keypad->check_matrix_timer, imx_keypad_check_for_events, 0); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - keypad->mmio_base = devm_ioremap_resource(&pdev->dev, res); + keypad->mmio_base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(keypad->mmio_base)) return PTR_ERR(keypad->mmio_base);