summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2026-04-24 17:31:27 +0200
committerDanilo Krummrich <dakr@kernel.org>2026-05-02 17:50:50 +0200
commit1a262c768f5b5a1ebbdec8cfa588f75d3a825a8d (patch)
treed09a1c74144a336c1be960466efb9254066ca713
parent580a795105dae2ef1622df72a27a8fb0605e2f6b (diff)
downloadlinux-1a262c768f5b5a1ebbdec8cfa588f75d3a825a8d.tar.gz
linux-1a262c768f5b5a1ebbdec8cfa588f75d3a825a8d.zip
driver core: faux: clean up init error handling
Clean up the faux bus init error handling by naming the labels after what they do (rather than from where they are jumped to) and separating the success path more clearly by returning explicit zero. Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://patch.msgid.link/20260424153127.2647405-3-johan@kernel.org Signed-off-by: Danilo Krummrich <dakr@kernel.org>
-rw-r--r--drivers/base/faux.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/base/faux.c b/drivers/base/faux.c
index 3d1d1eafb473..a8329f88222e 100644
--- a/drivers/base/faux.c
+++ b/drivers/base/faux.c
@@ -244,20 +244,20 @@ int __init faux_bus_init(void)
ret = bus_register(&faux_bus_type);
if (ret)
- goto error_bus;
+ goto err_deregister_root;
ret = driver_register(&faux_driver);
if (ret)
- goto error_driver;
+ goto err_deregister_bus;
faux_bus_root = root;
- return ret;
+ return 0;
-error_driver:
+err_deregister_bus:
bus_unregister(&faux_bus_type);
-
-error_bus:
+err_deregister_root:
root_device_unregister(root);
+
return ret;
}