Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: ram_console: Fix section mismatches

WARNING: vmlinux.o(.text+0xfcf6e): Section mismatch in reference
from the function ram_console_driver_probe() to the function
.init.text:persistent_ram_init_ringbuffer()
The function ram_console_driver_probe() references
the function __init persistent_ram_init_ringbuffer().
This is often because ram_console_driver_probe lacks a __init
annotation or the annotation of persistent_ram_init_ringbuffer is
wrong.

Move this driver to platform_driver_probe() because ram console
devices aren't going to be added and removed at runtime. Also
shorten the probe function name since driver is redundant and
makes the function name long.

Cc: Android Kernel Team <kernel-team@android.com>
Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Stephen Boyd and committed by
Greg Kroah-Hartman
06caa417 3ee0206b

+2 -5
+2 -5
drivers/staging/android/ram_console.c
··· 50 50 ram_console.flags &= ~CON_ENABLED; 51 51 } 52 52 53 - static int ram_console_driver_probe(struct platform_device *pdev) 53 + static int __init ram_console_probe(struct platform_device *pdev) 54 54 { 55 55 struct ram_console_platform_data *pdata = pdev->dev.platform_data; 56 56 struct persistent_ram_zone *prz; ··· 75 75 } 76 76 77 77 static struct platform_driver ram_console_driver = { 78 - .probe = ram_console_driver_probe, 79 78 .driver = { 80 79 .name = "ram_console", 81 80 }, ··· 82 83 83 84 static int __init ram_console_module_init(void) 84 85 { 85 - int err; 86 - err = platform_driver_register(&ram_console_driver); 87 - return err; 86 + return platform_driver_probe(&ram_console_driver, ram_console_probe); 88 87 } 89 88 90 89 static ssize_t ram_console_read_old(struct file *file, char __user *buf,