netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: netdev@vger.kernel.org
Cc: nico@cam.org
Subject: [RESEND/UPDATED patch 2.6.25] smc91x section fix
Date: Fri, 18 Apr 2008 20:01:17 -0700	[thread overview]
Message-ID: <200804182001.18234.david-b@pacbell.net> (raw)
In-Reply-To: <200802242233.12764.david-b@pacbell.net>

From: David Brownell <dbrownell@users.sourceforge.net>

Section fixup:

  WARNING: drivers/net/built-in.o(.text+0x1a2c): Section mismatch
	in reference from the function smc_drv_probe()
	to the function .init.text:smc_probe()
  The function smc_drv_probe() references
  the function __init smc_probe().
  This is often because smc_drv_probe lacks a __init
  annotation or the annotation of smc_probe is wrong.

Also switch to platform_driver_probe(), and mark exit code as such.
Total footprint shrinkage is about 2KB on ARMv5.

Note that few platform devices are actually hotpluggable, and these
smc devices are evidently not exceptions to that rule ... else there
would have been oopsing in this driver from the smc_probe() problem.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
Changes since earlier version:  use platform_driver_probe(), add
the __exit annotations, not how we can know this driver doesn't
need to use hotplug-supporting "__devinit" annotations.

 drivers/net/smc91x.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- g26.orig/drivers/net/smc91x.c	2008-04-18 19:13:57.000000000 -0700
+++ g26/drivers/net/smc91x.c	2008-04-18 19:15:57.000000000 -0700
@@ -2097,7 +2097,8 @@ static inline void smc_request_datacs(st
 	}
 }
 
-static void smc_release_datacs(struct platform_device *pdev, struct net_device *ndev)
+static void __exit smc_release_datacs(struct platform_device *pdev,
+		struct net_device *ndev)
 {
 	if (SMC_CAN_USE_DATACS) {
 		struct smc_local *lp = netdev_priv(ndev);
@@ -2124,7 +2125,7 @@ static void smc_release_datacs(struct pl
  *	0 --> there is a device
  *	anything else, error
  */
-static int smc_drv_probe(struct platform_device *pdev)
+static int __init smc_drv_probe(struct platform_device *pdev)
 {
 	struct net_device *ndev;
 	struct resource *res, *ires;
@@ -2214,7 +2215,7 @@ static int smc_drv_probe(struct platform
 	return ret;
 }
 
-static int smc_drv_remove(struct platform_device *pdev)
+static int __exit smc_drv_remove(struct platform_device *pdev)
 {
 	struct net_device *ndev = platform_get_drvdata(pdev);
 	struct smc_local *lp = netdev_priv(ndev);
@@ -2278,8 +2279,7 @@ static int smc_drv_resume(struct platfor
 }
 
 static struct platform_driver smc_driver = {
-	.probe		= smc_drv_probe,
-	.remove		= smc_drv_remove,
+	.remove		= __exit_p(smc_drv_remove),
 	.suspend	= smc_drv_suspend,
 	.resume		= smc_drv_resume,
 	.driver		= {
@@ -2299,7 +2299,7 @@ static int __init smc_init(void)
 #endif
 #endif
 
-	return platform_driver_register(&smc_driver);
+	return platform_driver_probe(&smc_driver, smc_drv_probe);
 }
 
 static void __exit smc_cleanup(void)

  parent reply	other threads:[~2008-04-19  3:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-25  3:34 [patch 2.6.25-rc3] smc91x section fix David Brownell
2008-02-25  6:02 ` Sam Ravnborg
2008-02-25  6:33   ` David Brownell
2008-02-25 20:11     ` Sam Ravnborg
2008-04-19  3:01     ` David Brownell [this message]
2008-04-25  6:02       ` [RESEND/UPDATED patch 2.6.25] " Jeff Garzik
2008-07-25 20:11       ` David Brownell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200804182001.18234.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=netdev@vger.kernel.org \
    --cc=nico@cam.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).