Skip to content

Commit 8281d62

Browse files
jhnikulagroeck
authored andcommitted
hwmon: (tmp108) Do not fail in I3C probe when I3C regmap is a module
I3C device probe fails when CONFIG_REGMAP_I3C=m: p3t1085_i3c 0-23615290090: error -ENODEV: Failed to register i3c regmap Fix this by using the IS_ENABLED(CONFIG_REGMAP_I3C) macro in the code. Fixes: c40655e ("hwmon: (tmp108) Add support for I3C device") Signed-off-by: Jarkko Nikula <[email protected]> Message-ID: <[email protected]> [groeck: Remove #ifdef entirely; it is not needed due to dead code elimination] Signed-off-by: Guenter Roeck <[email protected]>
1 parent 228a115 commit 8281d62

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

drivers/hwmon/tmp108.c

-5
Original file line numberDiff line numberDiff line change
@@ -452,12 +452,7 @@ static int p3t1085_i3c_probe(struct i3c_device *i3cdev)
452452
struct device *dev = i3cdev_to_dev(i3cdev);
453453
struct regmap *regmap;
454454

455-
#ifdef CONFIG_REGMAP_I3C
456455
regmap = devm_regmap_init_i3c(i3cdev, &tmp108_regmap_config);
457-
#else
458-
regmap = ERR_PTR(-ENODEV);
459-
#endif
460-
461456
if (IS_ERR(regmap))
462457
return dev_err_probe(dev, PTR_ERR(regmap),
463458
"Failed to register i3c regmap\n");

0 commit comments

Comments
 (0)