Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1610935ybi; Wed, 17 Jul 2019 18:42:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjzITAHDuPV0z/dbhW9N/N0wXw/dzd9t4c+0hMIeXvs69XwebgDbpLQ7wWcfXGid0Glgh4 X-Received: by 2002:a17:90a:cb8e:: with SMTP id a14mr17963649pju.124.1563414133323; Wed, 17 Jul 2019 18:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563414133; cv=none; d=google.com; s=arc-20160816; b=DKluWIaJjpwVacTwmdIXhVuDY+WpLuUT3PnJDe5L6p8kSfkQ7oqEzuuZJkhz3c5wCG XuD+wvYRWdCe7GhyLpPxKeivUrbABfkM4omM9jLb723abSqkw2lqU7UzVzWxMpbWxe4W NwIatu2swzNlyTm3wYleZgtqLOR7uBTlZB9JwLYxrVX1aShcXrvu2x5eYqf2BEO6ilRB ep2tljUhLY6I/E7IXl2R0q6HQEoMbwG8KptCvf5VvdiAR+EjnT6A8af1KgYWwLJnJu06 ksWRnjfbZ3rm1lRngfINiQYj40R/Nn9SaKiUF+b1YDeCJK4fwFfO9+pQEO///cnPo80i e7fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=j4I5aoG3Jzmigp+fheztyfDoiukYiPLxXSxRECJIQzQ=; b=NjdpU7cuCytRnvDFX9Enu4+/ruSJe/Lnav12c5AcbElcqwXo3+Khc+h2HR1ggu6kyB l8d7wO/zb9yrnTDxC0Jx2e8cTxrt/sFUuvN/nZv//ojs9pcYuP8t4KTFe8psZqvM2+Yq 777f3IbuiXCOQu5MB5j2ly7iiZzOAjQhbtg2jtUq0hlc4ynj7PL1c27CN/KyU7OivT6B 5XPf1XbA8h8Cr0fUWgLDVg0Xq2qDcs1/jKqFOOxPJBRSN2IBqoz2F7wQpl47DqHWn7iv 98eBWe60zDkH4CH7latwdxunt/sQX/vEjFxb85T06dc/JfJ2UXmbydbCHGR1df5d7NBA j0yA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z19si133200pfa.19.2019.07.17.18.41.57; Wed, 17 Jul 2019 18:42:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731588AbfGRBl0 (ORCPT + 99 others); Wed, 17 Jul 2019 21:41:26 -0400 Received: from inva020.nxp.com ([92.121.34.13]:51822 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727793AbfGRBl0 (ORCPT ); Wed, 17 Jul 2019 21:41:26 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 73D7B1A0210; Thu, 18 Jul 2019 03:41:24 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 9E42E1A0038; Thu, 18 Jul 2019 03:41:19 +0200 (CEST) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 6A8BA402C3; Thu, 18 Jul 2019 09:41:13 +0800 (SGT) From: Anson.Huang@nxp.com To: thierry.reding@gmail.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH] pwm: mxs: use devm_platform_ioremap_resource() to simplify code Date: Thu, 18 Jul 2019 09:32:05 +0800 Message-Id: <20190718013205.24919-1-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.9.5 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anson Huang 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 --- drivers/pwm/pwm-mxs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pwm/pwm-mxs.c b/drivers/pwm/pwm-mxs.c index 04c0f6b..b14376b 100644 --- a/drivers/pwm/pwm-mxs.c +++ b/drivers/pwm/pwm-mxs.c @@ -126,15 +126,13 @@ static int mxs_pwm_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; struct mxs_pwm_chip *mxs; - struct resource *res; int ret; mxs = devm_kzalloc(&pdev->dev, sizeof(*mxs), GFP_KERNEL); if (!mxs) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - mxs->base = devm_ioremap_resource(&pdev->dev, res); + mxs->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(mxs->base)) return PTR_ERR(mxs->base); -- 2.7.4