driver core: Return proper error code when dev_set_name() fails
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 17 Aug 2023 09:12:21 +0000 (12:12 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 22 Aug 2023 14:57:32 +0000 (16:57 +0200)
commitd21fdd07cea418c0d98c8a15fc95b8b8970801e7
tree192ce8fea3ec101507a6479403ed12039eddff71
parent1b28cb81dab7c1eedc6034206f4e8d644046ad31
driver core: Return proper error code when dev_set_name() fails

Whe device_add() tries to assign a device name with help of
dev_set_name() the error path explicitly uses -EINVAL, while
the function may return something different.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230817091221.463721-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/core.c