aboutsummaryrefslogtreecommitdiff
path: root/drivers/hwmon/jz4740-hwmon.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2019-04-01 10:36:41 -0700
committerGuenter Roeck <linux@roeck-us.net>2019-04-15 17:19:53 -0700
commit5aaa58734d8876640fe0a730c699ce7b9ea90b1c (patch)
treeacd0b331c6dd2a07c4309dfb2dea42abc275d28d /drivers/hwmon/jz4740-hwmon.c
parent2f2defda176cc885ca1356601a2aa5aef53ae253 (diff)
hwmon: (jz4740) Use devm_platform_ioremap_resource
The new helper devm_platform_ioremap_resource() wraps platform_get_resource() and devm_ioremap_resource() together. Use it to simplify the code. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/jz4740-hwmon.c')
-rw-r--r--drivers/hwmon/jz4740-hwmon.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/hwmon/jz4740-hwmon.c b/drivers/hwmon/jz4740-hwmon.c
index 2d40a2e771d7..7d5947595b45 100644
--- a/drivers/hwmon/jz4740-hwmon.c
+++ b/drivers/hwmon/jz4740-hwmon.c
@@ -94,7 +94,6 @@ static int jz4740_hwmon_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct jz4740_hwmon *hwmon;
struct device *hwmon_dev;
- struct resource *mem;
hwmon = devm_kzalloc(dev, sizeof(*hwmon), GFP_KERNEL);
if (!hwmon)
@@ -109,8 +108,7 @@ static int jz4740_hwmon_probe(struct platform_device *pdev)
return hwmon->irq;
}
- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- hwmon->base = devm_ioremap_resource(&pdev->dev, mem);
+ hwmon->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(hwmon->base))
return PTR_ERR(hwmon->base);