[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191118101934.22526-3-patrick.rudolph@9elements.com>
Date: Mon, 18 Nov 2019 11:19:30 +0100
From: patrick.rudolph@...ements.com
To: linux-kernel@...r.kernel.org
Cc: coreboot@...eboot.org, Arthur Heymans <arthur@...ymans.xyz>,
Patrick Rudolph <patrick.rudolph@...ements.com>,
Thomas Gleixner <tglx@...utronix.de>,
Allison Randal <allison@...utok.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Alexios Zavras <alexios.zavras@...el.com>
Subject: [PATCH v3 2/3] firmware: google: Unregister driver_info on failure and exit in gsmi
From: Arthur Heymans <arthur@...ymans.xyz>
Fix a bug where the kernel module couldn't be loaded after unloading,
as the platform driver wasn't released on exit.
Signed-off-by: Arthur Heymans <arthur@...ymans.xyz>
Signed-off-by: Patrick Rudolph <patrick.rudolph@...ements.com>
---
-v2:
Add missing s-o-b.
-v3:
No changes.
---
drivers/firmware/google/gsmi.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/firmware/google/gsmi.c b/drivers/firmware/google/gsmi.c
index edaa4e5d84ad..974c769b75cf 100644
--- a/drivers/firmware/google/gsmi.c
+++ b/drivers/firmware/google/gsmi.c
@@ -1016,6 +1016,9 @@ static __init int gsmi_init(void)
dma_pool_destroy(gsmi_dev.dma_pool);
platform_device_unregister(gsmi_dev.pdev);
pr_info("gsmi: failed to load: %d\n", ret);
+#ifdef CONFIG_PM
+ platform_driver_unregister(&gsmi_driver_info);
+#endif
return ret;
}
@@ -1037,6 +1040,9 @@ static void __exit gsmi_exit(void)
gsmi_buf_free(gsmi_dev.name_buf);
dma_pool_destroy(gsmi_dev.dma_pool);
platform_device_unregister(gsmi_dev.pdev);
+#ifdef CONFIG_PM
+ platform_driver_unregister(&gsmi_driver_info);
+#endif
}
module_init(gsmi_init);
--
2.21.0
Powered by blists - more mailing lists