linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* spi_s3c24xx: fix section mismatch and __devexit code
@ 2008-08-08 10:02 Ben Dooks
       [not found] ` <20080808100250.288677484-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Dooks @ 2008-08-08 10:02 UTC (permalink / raw)
  To: david-b-yBeKhBN/0LDR7s880joybQ,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: Ben Dooks

[-- Attachment #1: simtec/simtec-s3c24xx-spi-section-mismatch.patch --]
[-- Type: text/plain, Size: 2389 bytes --]

Fix the section mismatch warning generated by the iconrrect
naming of s3c24xx_spidrv which should be s3c24xx_spi_driver:

WARNING: drivers/spi/spi_s3c24xx.o(.data+0x4): Section mismatch in reference from the variable s3c24xx_spidrv to the (unknown reference) .exit.text:(unknown)

As noted below, the exit function should be marked __devexit
in case the platform device is capable of being removed.

Signed-off-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>

Index: linux-2.6.27-rc2-quilt1/drivers/spi/spi_s3c24xx.c
===================================================================
--- linux-2.6.27-rc2-quilt1.orig/drivers/spi/spi_s3c24xx.c	2008-08-07 12:37:43.000000000 +0100
+++ linux-2.6.27-rc2-quilt1/drivers/spi/spi_s3c24xx.c	2008-08-07 12:40:12.000000000 +0100
@@ -387,7 +387,7 @@ static int __init s3c24xx_spi_probe(stru
 	return err;
 }
 
-static int __exit s3c24xx_spi_remove(struct platform_device *dev)
+static int __devexit s3c24xx_spi_remove(struct platform_device *dev)
 {
 	struct s3c24xx_spi *hw = platform_get_drvdata(dev);
 
@@ -436,8 +436,8 @@ static int s3c24xx_spi_resume(struct pla
 #endif
 
 MODULE_ALIAS("platform:s3c2410-spi");
-static struct platform_driver s3c24xx_spidrv = {
-	.remove		= __exit_p(s3c24xx_spi_remove),
+static struct platform_driver s3c24xx_spi_driver = {
+	.remove		= __devexit_p(s3c24xx_spi_remove),
 	.suspend	= s3c24xx_spi_suspend,
 	.resume		= s3c24xx_spi_resume,
 	.driver		= {
@@ -448,12 +448,12 @@ static struct platform_driver s3c24xx_sp
 
 static int __init s3c24xx_spi_init(void)
 {
-        return platform_driver_probe(&s3c24xx_spidrv, s3c24xx_spi_probe);
+        return platform_driver_probe(&s3c24xx_spi_driver, s3c24xx_spi_probe);
 }
 
 static void __exit s3c24xx_spi_exit(void)
 {
-        platform_driver_unregister(&s3c24xx_spidrv);
+        platform_driver_unregister(&s3c24xx_spi_driver);
 }
 
 module_init(s3c24xx_spi_init);

-- 
Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: spi_s3c24xx: fix section mismatch and __devexit code
       [not found] ` <20080808100250.288677484-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
@ 2008-09-11 17:50   ` David Brownell
  0 siblings, 0 replies; 2+ messages in thread
From: David Brownell @ 2008-09-11 17:50 UTC (permalink / raw)
  To: Ben Dooks; +Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Friday 08 August 2008, Ben Dooks wrote:
> Fix the section mismatch warning generated by the iconrrect
> naming of s3c24xx_spidrv which should be s3c24xx_spi_driver:
> 
> WARNING: drivers/spi/spi_s3c24xx.o(.data+0x4): Section mismatch
> in reference from the variable s3c24xx_spidrv
> to the (unknown reference) .exit.text:(unknown)  

Right ... I dislike such rude reactions to not following
a naming convention, but that's what we're stuck with.


> As noted below, the exit function should be marked __devexit
> in case the platform device is capable of being removed.

But these devices aren't capable of hotplugging ... and
if they were, it would be inappropriate to use the more
memory-efficient platform_driver_probe() call.

Any objection if I just take this __devexit bit out and
then send the patch along?

- dave

 
> Signed-off-by: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
> 
> Index: linux-2.6.27-rc2-quilt1/drivers/spi/spi_s3c24xx.c
> ===================================================================
> --- linux-2.6.27-rc2-quilt1.orig/drivers/spi/spi_s3c24xx.c	2008-08-07 12:37:43.000000000 +0100
> +++ linux-2.6.27-rc2-quilt1/drivers/spi/spi_s3c24xx.c	2008-08-07 12:40:12.000000000 +0100
> @@ -387,7 +387,7 @@ static int __init s3c24xx_spi_probe(stru
>  	return err;
>  }
>  
> -static int __exit s3c24xx_spi_remove(struct platform_device *dev)
> +static int __devexit s3c24xx_spi_remove(struct platform_device *dev)
>  {
>  	struct s3c24xx_spi *hw = platform_get_drvdata(dev);
>  
> @@ -436,8 +436,8 @@ static int s3c24xx_spi_resume(struct pla
>  #endif
>  
>  MODULE_ALIAS("platform:s3c2410-spi");
> -static struct platform_driver s3c24xx_spidrv = {
> -	.remove		= __exit_p(s3c24xx_spi_remove),
> +static struct platform_driver s3c24xx_spi_driver = {
> +	.remove		= __devexit_p(s3c24xx_spi_remove),
>  	.suspend	= s3c24xx_spi_suspend,
>  	.resume		= s3c24xx_spi_resume,
>  	.driver		= {
> @@ -448,12 +448,12 @@ static struct platform_driver s3c24xx_sp
>  
>  static int __init s3c24xx_spi_init(void)
>  {
> -        return platform_driver_probe(&s3c24xx_spidrv, s3c24xx_spi_probe);
> +        return platform_driver_probe(&s3c24xx_spi_driver, s3c24xx_spi_probe);
>  }
>  
>  static void __exit s3c24xx_spi_exit(void)
>  {
> -        platform_driver_unregister(&s3c24xx_spidrv);
> +        platform_driver_unregister(&s3c24xx_spi_driver);
>  }
>  
>  module_init(s3c24xx_spi_init);
> 
> 

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-11 17:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-08 10:02 spi_s3c24xx: fix section mismatch and __devexit code Ben Dooks
     [not found] ` <20080808100250.288677484-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2008-09-11 17:50   ` David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).