diff options
author | Yangtao Li <frank.li@vivo.com> | 2023-07-04 17:43:06 +0800 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2023-08-21 06:04:29 -0700 |
commit | c0cf96d7e3f004fac3cc36434eeeb01fa5a38dae (patch) | |
tree | 2fa6215954823f601943186f4b74e3e522af2062 | |
parent | 46290c6bc0b102dc30250ded4f359174a384c957 (diff) |
hwmon: (bt1-pvt) Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230704094306.21933-1-frank.li@vivo.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r-- | drivers/hwmon/bt1-pvt.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/hwmon/bt1-pvt.c b/drivers/hwmon/bt1-pvt.c index 8d402a627306..b77ebac2e0ce 100644 --- a/drivers/hwmon/bt1-pvt.c +++ b/drivers/hwmon/bt1-pvt.c @@ -891,15 +891,8 @@ static struct pvt_hwmon *pvt_create_data(struct platform_device *pdev) static int pvt_request_regs(struct pvt_hwmon *pvt) { struct platform_device *pdev = to_platform_device(pvt->dev); - struct resource *res; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - dev_err(pvt->dev, "Couldn't find PVT memresource\n"); - return -EINVAL; - } - - pvt->regs = devm_ioremap_resource(pvt->dev, res); + pvt->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(pvt->regs)) return PTR_ERR(pvt->regs); |