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 <Jisheng.Zhang@synaptics.com>
Signed-off-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Reviewed-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Link: https://lore.kernel.org/r/alpine.DEB.2.21.1909030646180.3228@hadrien
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
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;
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);