Skip to content

Commit

Permalink
staging: ram_console: Fix section mismatches
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: John Stultz <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
bebarino authored and gregkh committed Mar 9, 2012
1 parent 3ee0206 commit 06caa41
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/staging/android/ram_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void ram_console_enable_console(int enabled)
ram_console.flags &= ~CON_ENABLED;
}

static int ram_console_driver_probe(struct platform_device *pdev)
static int __init ram_console_probe(struct platform_device *pdev)
{
struct ram_console_platform_data *pdata = pdev->dev.platform_data;
struct persistent_ram_zone *prz;
Expand All @@ -75,17 +75,14 @@ static int ram_console_driver_probe(struct platform_device *pdev)
}

static struct platform_driver ram_console_driver = {
.probe = ram_console_driver_probe,
.driver = {
.name = "ram_console",
},
};

static int __init ram_console_module_init(void)
{
int err;
err = platform_driver_register(&ram_console_driver);
return err;
return platform_driver_probe(&ram_console_driver, ram_console_probe);
}

static ssize_t ram_console_read_old(struct file *file, char __user *buf,
Expand Down

0 comments on commit 06caa41

Please sign in to comment.