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: eaa0d30216 ("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>
This commit is contained in:
Dan Carpenter 2025-04-23 13:04:26 +03:00 committed by Greg Kroah-Hartman
parent 8117b017f3
commit 2806c6b8f3

View File

@ -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;
}