Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1412649ybn; Wed, 25 Sep 2019 18:02:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+242dIVsfOv+93R2zMfA6S/90jY29Zq427jRXz3u8IB0PCAovl98Wcd11Utp7JDqjmykN X-Received: by 2002:a17:906:7d8:: with SMTP id m24mr918474ejc.196.1569459744651; Wed, 25 Sep 2019 18:02:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569459744; cv=none; d=google.com; s=arc-20160816; b=bb9aIAhGQVUtdU4i6LwdxlNukPhwh9PB5P4CQUuyXxwcn1nTEc/EhDim1+dBDCqII7 fK6vdMx5zBUzzj9e/QC3fmc+ceNYhJG6NVWnIOlfrA9hE4D9eP1gZRqUjTVx/scUOr06 /iyyrLNkEhxMJeF0qcGAZttCtEh6pwMVvCVv0dAuMiCpzEo6OV5jhw06fE38UvaWOwdM y/l8pbs1XIofRmrb/N3jfVM2rLcze4/tB+VblMhOkJI/yM3LLz/AiLI2ofC3FVIXR9NY nFIcPpCygC7Y2dyXZ28pkriH+UbjGWv6VvdAxDO97yIEVLm/cMpoCYZMssLhn0uinAhb Qnbw== 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=q3RrwovnpBMZKBGwVLjNQCR3kBqs01uXqPEX6CQk3PE=; b=JTyVL4gldPMFIMLwm6CKKGU/rVni+qGTthb3F47BZrnjSZdS+7JzAqwCEvXR06JScg lpPyS7BO+c2kPklj8N1bqWitrORCP3WeZ+npoGvJUXA6NkVsVdZvteIWEKi/yzBMiOxZ AizJWYYT/9jStyvQaX85tptaHjtbCuSGeJa4dMt5D9xl5pk6UaFVRHdE6iS4cEIRML25 j524GgFLkFAzmbu7R3oc2Y6RpIK+8/3K3kD3rcjuV6P8u+yLpUvx+JKZzIHQW99eVgFA B6KRIHHiohG08wwcL7FrZw7dcb6L3OOMI7vP03eS+GbB1vkNqjn3efR9cJzyUhx8pGU4 lTTw== 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 w11si436184edi.442.2019.09.25.18.02.00; Wed, 25 Sep 2019 18:02:24 -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 S2504368AbfIXJo1 (ORCPT + 99 others); Tue, 24 Sep 2019 05:44:27 -0400 Received: from inva021.nxp.com ([92.121.34.21]:58946 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725884AbfIXJo1 (ORCPT ); Tue, 24 Sep 2019 05:44:27 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 8BFCA2001B0; Tue, 24 Sep 2019 11:44:25 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 5B85720038C; Tue, 24 Sep 2019 11:44:21 +0200 (CEST) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id DCE10402EE; Tue, 24 Sep 2019 17:44:15 +0800 (SGT) From: Anson Huang 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 1/2] pwm: pwm-mxs: use devm_platform_ioremap_resource() to simplify code Date: Tue, 24 Sep 2019 17:42:48 +0800 Message-Id: <1569318169-12327-1-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 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 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 --- - This is a resend version of patch: https://patchwork.kernel.org/patch/11048365/ --- 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