lkml.org 
[lkml]   [2022]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] firmware: coreboot: Register bus in module init
Quoting Brian Norris (2022-10-19 18:10:53)
[...]
> [ 0.114560] do_initcall_level+0x134/0x160
> [ 0.114571] do_initcalls+0x60/0xa0
> [ 0.114579] do_basic_setup+0x28/0x34
> [ 0.114588] kernel_init_freeable+0xf8/0x150
> [ 0.114596] kernel_init+0x2c/0x12c
> [ 0.114607] ret_from_fork+0x10/0x20
> [ 0.114624] Code: 5280002b 1100054a b900092a f9800011 (885ffc01)
> [ 0.114631] ---[ end trace 0000000000000000 ]---
>
> Fixes: b81e3140e412 ("firmware: coreboot: Make bus registration symmetric")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>

> diff --git a/drivers/firmware/google/coreboot_table.c b/drivers/firmware/google/coreboot_table.c
> index c52bcaa9def6..9ca21feb9d45 100644
> --- a/drivers/firmware/google/coreboot_table.c
> +++ b/drivers/firmware/google/coreboot_table.c
> @@ -199,6 +194,32 @@ static struct platform_driver coreboot_table_driver = {
> .of_match_table = of_match_ptr(coreboot_of_match),
> },
> };
> -module_platform_driver(coreboot_table_driver);
> +
> +static int __init coreboot_table_driver_init(void)
> +{
> + int ret;
> +
> + ret = bus_register(&coreboot_bus_type);
> + if (ret)
> + return ret;
> +
> + ret = platform_driver_register(&coreboot_table_driver);
> + if (ret) {
> + bus_unregister(&coreboot_bus_type);
> + return ret;
> + }
> +
> + return 0;

This could be 'return ret' and two lines could be saved, but that is
super nitpick so whatever.

\
 
 \ /
  Last update: 2022-10-21 02:04    [W:0.103 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site