Skip to content

Commit ab0fd09

Browse files
harshimogalapalligroeck
authored andcommitted
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: 0ab88e2 ("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>
1 parent 41de744 commit ab0fd09

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/hwmon/gpd-fan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,8 @@ static int gpd_fan_probe(struct platform_device *pdev)
615615
const struct device *hwdev;
616616

617617
res = platform_get_resource(pdev, IORESOURCE_IO, 0);
618-
if (IS_ERR(res))
619-
return dev_err_probe(dev, PTR_ERR(res),
618+
if (!res)
619+
return dev_err_probe(dev, -EINVAL,
620620
"Failed to get platform resource\n");
621621

622622
region = devm_request_region(dev, res->start,

0 commit comments

Comments
 (0)