[1/2] pstore/ram: Register to module device table

Message ID 20240110210600.787703-2-nfraprado@collabora.com
State New
Headers
Series Enable PSTORE_RAM as a module in the arm64 defconfig |

Commit Message

Nícolas F. R. A. Prado Jan. 10, 2024, 9:05 p.m. UTC
  Register the compatible for this module on the module device table so
it can be automatically loaded when a matching DT node is present,
allowing logging of panics and oopses without any intervention.

Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
---

 fs/pstore/ram.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

AngeloGioacchino Del Regno Jan. 11, 2024, 12:11 p.m. UTC | #1
Il 10/01/24 22:05, Nícolas F. R. A. Prado ha scritto:
> Register the compatible for this module on the module device table so
> it can be automatically loaded when a matching DT node is present,
> allowing logging of panics and oopses without any intervention.
> 
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
  
Kees Cook Jan. 11, 2024, 6:22 p.m. UTC | #2
On Wed, Jan 10, 2024 at 06:05:02PM -0300, Nícolas F. R. A. Prado wrote:
> Register the compatible for this module on the module device table so
> it can be automatically loaded when a matching DT node is present,
> allowing logging of panics and oopses without any intervention.
> 
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

Ah-ha! Yeah, good idea.

Reviewed-by: Kees Cook <keescook@chromium.org>
  

Patch

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index 88b34fdbf759..b1a455f42e93 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -893,6 +893,7 @@  static const struct of_device_id dt_match[] = {
 	{ .compatible = "ramoops" },
 	{}
 };
+MODULE_DEVICE_TABLE(of, dt_match);
 
 static struct platform_driver ramoops_driver = {
 	.probe		= ramoops_probe,