Skip to content

Commit 2806c6b

Browse files
Dan Carpentergregkh
authored andcommitted
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: eaa0d30 ("driver core: auxiliary bus: add device creation helpers") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Jerome Brunet <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8117b01 commit 2806c6b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/base/auxiliary.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,13 +481,13 @@ struct auxiliary_device *__devm_auxiliary_device_create(struct device *dev,
481481
int ret;
482482

483483
auxdev = auxiliary_device_create(dev, modname, devname, platform_data, id);
484-
if (IS_ERR(auxdev))
485-
return auxdev;
484+
if (!auxdev)
485+
return NULL;
486486

487487
ret = devm_add_action_or_reset(dev, auxiliary_device_destroy,
488488
auxdev);
489489
if (ret)
490-
return ERR_PTR(ret);
490+
return NULL;
491491

492492
return auxdev;
493493
}

0 commit comments

Comments
 (0)