mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
staging: greybus: vibrator: return device_create() errors
gb_vibrator_probe() maps any device_create() failure to -EINVAL. This loses the real errno returned by the driver core, such as -ENOMEM, and makes probe failures harder to diagnose correctly. Return PTR_ERR(dev) instead so callers receive the actual failure reason while preserving the existing cleanup path. Signed-off-by: Alfie Varghese <alfievarghese22@gmail.com> Link: https://patch.msgid.link/20260618113439.569-1-alfievarghese22@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
443063a342
commit
3d2718e3b1
|
|
@ -161,7 +161,7 @@ static int gb_vibrator_probe(struct gb_bundle *bundle,
|
|||
dev = device_create(&vibrator_class, &bundle->dev,
|
||||
MKDEV(0, 0), vib, "vibrator%d", vib->minor);
|
||||
if (IS_ERR(dev)) {
|
||||
retval = -EINVAL;
|
||||
retval = PTR_ERR(dev);
|
||||
goto err_ida_remove;
|
||||
}
|
||||
vib->dev = dev;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user