summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2021-05-29 10:29:53 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-06-02 08:40:24 +0200
commitaf2a7f5dffcc2315b22b7477b584294214df95d3 (patch)
tree00090217befb147125cb0945f5b14f8c09e96501 /drivers/base
parent5134329187c962332bbe4c31d1c62982949552cf (diff)
downloadbarebox-af2a7f5dffcc2315b22b7477b584294214df95d3.tar.gz
driver: have dev_set_name() return 0 on success
Align the return code with Linux, where the function returns 0, not the device name length on success. No functional change, as no one checks the error code anyway. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210529082953.2034104-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/driver.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index f60533c59e..1fa3f6c6fa 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -480,9 +480,7 @@ int dev_set_name(struct device_d *dev, const char *fmt, ...)
*/
free(oldname);
- WARN_ON(err < 0);
-
- return err;
+ return WARN_ON(err < 0) ? err : 0;
}
EXPORT_SYMBOL_GPL(dev_set_name);