mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-17 19:30:11 -05:00
hwmon: (gpd-fan) Fix return value when platform_get_resource() fails
When platform_get_resource() fails it returns NULL and not an error
pointer, accordingly change the error handling.
Fixes: 0ab88e2394 ("hwmon: add GPD devices sensor driver")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Link: https://lore.kernel.org/r/20251010204359.94300-1-harshit.m.mogalapalli@oracle.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
committed by
Guenter Roeck
parent
41de7440e6
commit
ab0fd09d25
@@ -615,8 +615,8 @@ static int gpd_fan_probe(struct platform_device *pdev)
|
||||
const struct device *hwdev;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_IO, 0);
|
||||
if (IS_ERR(res))
|
||||
return dev_err_probe(dev, PTR_ERR(res),
|
||||
if (!res)
|
||||
return dev_err_probe(dev, -EINVAL,
|
||||
"Failed to get platform resource\n");
|
||||
|
||||
region = devm_request_region(dev, res->start,
|
||||
|
||||
Reference in New Issue
Block a user