ARM: OMAP: Fix section mismatch warnings in omap-rng
PATCH 1/1 ARM: OMAP: Fix section mismatch warnings in omap-rng
ARM: OMAP: Fix warnings
WARNING: drivers/char/hw_random/omap-rng.o - Section
mismatch: reference to .init.text: from .data between '$d' (at offset 0x0) and 'omap_rng_ops'
WARNING: drivers/char/hw_random/omap-rng.o - Section
mismatch: reference to .exit.text: from .data between '$d' (at offset 0x4) and 'omap_rng_ops'
drivers/char/hw_random/omap-rng.c +2 -2
@@ -83,7 +83,7 @@ static struct hwrng omap_rng_ops = { .data_read = omap_rng_data_read, }; -static int __init omap_rng_probe (struct platform_device *pdev) +static int __devinit omap_rng_probe (struct platform_device *pdev) {struct resource *res, *mem;int ret;
@@ -133,7 +133,7 @@ static int __init omap_rng_probe(structreturn 0 ; } -static int __exit omap_rng_remove(struct platform_device *pdev) +static int __devexit omap_rng_remove(struct platform_device *pdev) {struct resource *mem =dev_get_drvdata (&pdev->dev);
Quoted 12 lines · Felipe Balbi
Hello Dirk,
drivers/char/hw_random/omap-rng.c static struct hwrng omap_rng_ops = {
Quoted 4 lines
drivers/char/hw_random/omap-rng.c +2
-2-static int __init omap_rng_probe(struct platform_device *pdev) +static int __devinit omap_rng_probe(struct platform_device *pdev) -static int __exit omap_rng_remove(struct platform_device *pdev) +static int __devexit omap_rng_remove(struct platform_device *pdev)Actually, this will only be true if
CONFIG_HOTPLUGis set to "y". This way__devinitis defined to "null".
Quoted 2 lines
If we set
CONFIG_HOTPLUGto "n" the same Section mismatch issue will appear.
Ah, yes, I see. Anybody with a better patch for this?
Thanks
Dirk
Quoted 1 line
Ah, yes, I see. Anybody with a better patch for this?
How about this.
======== CUT HERE
Keep omap_rng_probe() out of its platform_driver, addressing a section mismatch problem.
drivers/char/hw_random/omap-rng.c +1 -2
@@ -179,7 +179,6 @@ static struct platform_driver omap_rng_d .name = "omap_rng", .owner = THIS_MODULE, }, - .probe = omap_rng_probe, .remove = __exit_p(omap_rng_remove), .suspend = omap_rng_suspend, .resume = omap_rng_resume
@@ -190,7 +189,7 @@ static int __init omap_rng_init(void)if (!cpu_is_omap16xx () && !cpu_is_omap24xx ())return -ENODEV ; -return platform_driver_register (&omap_rng_driver); +return platform_driver_probe (&omap_rng_driver, omap_rng_probe); } static void __exit omap_rng_exit(void)
Hello Dirk,
drivers/char/hw_random/omap-rng.c static struct hwrng omap_rng_ops = {
Quoted 4 lines
drivers/char/hw_random/omap-rng.c +2
-2-static int __init omap_rng_probe(struct platform_device *pdev) +static int __devinit omap_rng_probe(struct platform_device *pdev) -static int __exit omap_rng_remove(struct platform_device *pdev) +static int __devexit omap_rng_remove(struct platform_device *pdev)
Actually, this will only be true if CONFIG_HOTPLUG is set to "y". This way __devinit is defined to "null".
If we set CONFIG_HOTPLUG to "n" the same Section mismatch issue will appear.
Maybe this is not the better way to do it.
Signature · 9 lines
Best Regards, Felipe Balbi [email protected] Nokia Institute of Technology - INdT Kernel Developers Team +55 92 8127 0839