Skip to contentSkip to conversation

hwmon: fix devm_platform_ioremap_resource.cocci warnings

PATCH Applied Julia Lawall 3 participants 3 messages Sep 3, 2019 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: fix devm_platform_ioremap_resource.cocci warnings

From: kbuild test robot <[email protected]>

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 <[email protected]>

---

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(-)
drivers/hwmon/as370-hwmon.c +1 -3
@@ -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);
 
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · On Tue, 3 Sep 2019 06:47:52 +0200 (CEST) Julia Lawall wrote:

From: kbuild test robot <[email protected]>

Use devm_platform_ioremap_resource helper which wraps platform_get_resource() and devm_ioremap_resource() together.

Quoted 6 lines

Generated by: scripts/coccinelle/api/devm_platform_ioremap_resource.cocci

Fixes 658e687b4218 ("hwmon: Add Synaptics AS370 PVT sensor driver")
CC Jisheng Zhang <[email protected]>

Thanks

maintainer Applied
#2 lore raw
In reply to Julia Lawall
Quoted 5 lines · Julia Lawall

From: kbuild test robot <[email protected]>

Use devm_platform_ioremap_resource helper which wraps platform_get_resource() and devm_ioremap_resource() together.

Quoted 7 lines

Generated by: scripts/coccinelle/api/devm_platform_ioremap_resource.cocci

Fixes 658e687b4218 ("hwmon: Add Synaptics AS370 PVT sensor driver")
CC Jisheng Zhang <[email protected]>

Applied to hwmon-next.

Thanks,
Guenter

Quoted 32 lines

---

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(-)
drivers/hwmon/as370-hwmon.c +1 -3
@@ -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);