isa: refactor code to remove nested blocks

Remove nested blocks in isa_bus_init(). This will make the module
easy-to-understand and make the code clearer.
Previous discussion regarding this change can be found
at below link:
https://lore.kernel.org/all/20260504063518.515620-1-wbg@kernel.org/

Acked-by: William Breathitt Gray <wbg@kernel.org>
Suggested-by: William Breathitt Gray <wbg@kernel.org>
Signed-off-by: Syed Nayyar Waris <syednwaris@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lore.kernel.org/all/20260504063518.515620-1-wbg@kernel.org/
Link: https://patch.msgid.link/20260701205857.GA4113@syednwaris
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
This commit is contained in:
Syed Nayyar Waris
2026-07-03 23:14:59 +02:00
committed by Danilo Krummrich
parent e7e09a8546
commit 0fa8e47dea
+9 -7
View File
@@ -166,14 +166,16 @@ static int __init isa_bus_init(void)
int error;
error = bus_register(&isa_bus_type);
if (!error) {
isa_bus = root_device_register("isa");
if (IS_ERR(isa_bus)) {
error = PTR_ERR(isa_bus);
bus_unregister(&isa_bus_type);
}
if (error)
return error;
isa_bus = root_device_register("isa");
if (IS_ERR(isa_bus)) {
bus_unregister(&isa_bus_type);
return PTR_ERR(isa_bus);
}
return error;
return 0;
}
postcore_initcall(isa_bus_init);