summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2025-04-23 13:04:26 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-25 16:01:47 +0200
commit2806c6b8f3d1e406f2b7e3266ddd21100fbe7151 (patch)
tree57590eeca12872c560e359aef533cdfa2464bcf1
parent8117b017f3826b18a426f22de1e001767bc50fd3 (diff)
driver core: auxiliary bus: Fix IS_ERR() vs NULL mixup in __devm_auxiliary_device_create()
This code was originally going to use error pointers but we decided it should return NULL instead. The error pointer code in __devm_auxiliary_device_create() was left over from the first version. Update it to use NULL. No callers have been merged yet, so that makes this change simple and self contained. Fixes: eaa0d30216c1 ("driver core: auxiliary bus: add device creation helpers") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Jerome Brunet <jbrunet@baylibre.com> Reviewed-by: Leon Romanovsky <leon@kernel.org> Link: https://lore.kernel.org/r/aAi7Kg3aTguFD0fU@stanley.mountain Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/base/auxiliary.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/base/auxiliary.c b/drivers/base/auxiliary.c
index a6d46c2759be..fd7efd2c94e1 100644
--- a/drivers/base/auxiliary.c
+++ b/drivers/base/auxiliary.c
@@ -481,13 +481,13 @@ struct auxiliary_device *__devm_auxiliary_device_create(struct device *dev,
int ret;
auxdev = auxiliary_device_create(dev, modname, devname, platform_data, id);
- if (IS_ERR(auxdev))
- return auxdev;
+ if (!auxdev)
+ return NULL;
ret = devm_add_action_or_reset(dev, auxiliary_device_destroy,
auxdev);
if (ret)
- return ERR_PTR(ret);
+ return NULL;
return auxdev;
}