From patchwork Tue Sep 3 04:47:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 11127169 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 15E98112C for ; Tue, 3 Sep 2019 04:47:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ED33F21881 for ; Tue, 3 Sep 2019 04:47:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725839AbfICEry (ORCPT ); Tue, 3 Sep 2019 00:47:54 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:35132 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725440AbfICEry (ORCPT ); Tue, 3 Sep 2019 00:47:54 -0400 X-IronPort-AV: E=Sophos;i="5.64,461,1559512800"; d="scan'208";a="318029627" Received: from abo-12-105-68.mrs.modulonet.fr (HELO hadrien) ([85.68.105.12]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Sep 2019 06:47:52 +0200 Date: Tue, 3 Sep 2019 06:47:52 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Jisheng Zhang cc: Guenter Roeck , Jean Delvare , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, kbuild-all@01.org Subject: [PATCH] hwmon: fix devm_platform_ioremap_resource.cocci warnings Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: kbuild test robot Use devm_platform_ioremap_resource helper which wraps platform_get_resource() and devm_ioremap_resource() together. Generated by: scripts/coccinelle/api/devm_platform_ioremap_resource.cocci Fixes: 658e687b4218 ("hwmon: Add Synaptics AS370 PVT sensor driver") CC: Jisheng Zhang Signed-off-by: kbuild test robot Signed-off-by: Julia Lawall Reviewed-by: Jisheng Zhang --- tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next head: 9c551fac9ea9629cdc6deb205292c2bbe7b38917 commit: 658e687b4218b42d03a5b0b79a292c9c48f1ddaf [32/34] hwmon: Add Synaptics AS370 PVT sensor driver :::::: branch date: 7 hours ago :::::: commit date: 7 hours ago Please take the patch only if it's a positive warning. Thanks! as370-hwmon.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/drivers/hwmon/as370-hwmon.c +++ b/drivers/hwmon/as370-hwmon.c @@ -103,7 +103,6 @@ static const struct hwmon_chip_info as37 static int as370_hwmon_probe(struct platform_device *pdev) { - struct resource *res; struct device *hwmon_dev; struct as370_hwmon *hwmon; struct device *dev = &pdev->dev; @@ -112,8 +111,7 @@ static int as370_hwmon_probe(struct plat if (!hwmon) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - hwmon->base = devm_ioremap_resource(&pdev->dev, res); + hwmon->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(hwmon->base)) return PTR_ERR(hwmon->base);