netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] move am79c961's probe function to .devinit.text
       [not found] ` <1247345591-22643-1-git-send-email-u.kleine-koenig@pengutronix.de>
@ 2009-07-11 20:52   ` Uwe Kleine-König
  0 siblings, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2009-07-11 20:52 UTC (permalink / raw)
  To: Greg KH, linux-kernel; +Cc: Roel Kluin, Russell King, netdev, Andrew Morton

A pointer to am79c961_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Roel Kluin <12o3l@tiscali.nl>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: netdev@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/net/arm/am79c961a.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/arm/am79c961a.c b/drivers/net/arm/am79c961a.c
index 627bc75..51b19f2 100644
--- a/drivers/net/arm/am79c961a.c
+++ b/drivers/net/arm/am79c961a.c
@@ -680,7 +680,7 @@ static const struct net_device_ops am79c961_netdev_ops = {
 #endif
 };
 
-static int __init am79c961_probe(struct platform_device *pdev)
+static int __devinit am79c961_probe(struct platform_device *pdev)
 {
 	struct resource *res;
 	struct net_device *dev;
-- 
1.6.3.1


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

* [PATCH] macsonic, jazzsonic - fix oops on module unload
       [not found]                           ` <alpine.OSX.2.00.0907220032230.796@silk.local>
@ 2009-07-21 15:40                             ` Finn Thain
  2009-07-21 19:22                               ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Finn Thain @ 2009-07-21 15:40 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Greg KH, Uwe Kleine-König


Set the driver data before using it. Fixes an oops when doing rmmod.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>

--- a/drivers/net/macsonic.c	2009-07-22 00:47:46.000000000 +1000
+++ b/drivers/net/macsonic.c	2009-07-22 00:49:39.000000000 +1000
@@ -575,6 +575,7 @@
  	lp = netdev_priv(dev);
  	lp->device = &pdev->dev;
  	SET_NETDEV_DEV(dev, &pdev->dev);
+	platform_set_drvdata(pdev, dev);

  	/* This will catch fatal stuff like -ENOMEM as well as success */
  	err = mac_onboard_sonic_probe(dev);
--- a/drivers/net/jazzsonic.c	2009-07-22 00:47:52.000000000 +1000
+++ b/drivers/net/jazzsonic.c	2009-07-22 00:52:41.000000000 +1000
@@ -222,6 +222,7 @@
  	lp = netdev_priv(dev);
  	lp->device = &pdev->dev;
  	SET_NETDEV_DEV(dev, &pdev->dev);
+	platform_set_drvdata(pdev, dev);

  	netdev_boot_setup_check(dev);


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

* Re: [PATCH] macsonic, jazzsonic - fix oops on module unload
  2009-07-21 15:40                             ` [PATCH] macsonic, jazzsonic - fix oops on module unload Finn Thain
@ 2009-07-21 19:22                               ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2009-07-21 19:22 UTC (permalink / raw)
  To: fthain; +Cc: netdev, gregkh, u.kleine-koenig

From: Finn Thain <fthain@telegraphics.com.au>
Date: Wed, 22 Jul 2009 01:40:02 +1000 (EST)

> 
> Set the driver data before using it. Fixes an oops when doing rmmod.
> 
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>

Applied, thanks.

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

end of thread, other threads:[~2009-07-21 19:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20090711170548.GC5205@suse.de>
     [not found] ` <1247345591-22643-1-git-send-email-u.kleine-koenig@pengutronix.de>
2009-07-11 20:52   ` [PATCH] move am79c961's probe function to .devinit.text Uwe Kleine-König
     [not found] ` <1247345591-22643-8-git-send-email-u.kleine-koenig@pengutronix.de>
     [not found]   ` <1247345591-22643-9-git-send-email-u.kleine-koenig@pengutronix.de>
     [not found]     ` <1247345591-22643-10-git-send-email-u.kleine-koenig@pengutronix.de>
     [not found]       ` <1247345591-22643-11-git-send-email-u.kleine-koenig@pengutronix.de>
     [not found]         ` <1247345591-22643-12-git-send-email-u.kleine-koenig@pengutronix.de>
     [not found]           ` <1247345591-22643-13-git-send-email-u.kleine-koenig@pengutronix.de>
     [not found]             ` <1247345591-22643-14-git-send-email-u.kleine-koenig@pengutronix.de>
     [not found]               ` <1247345591-22643-15-git-send-email-u.kleine-koenig@pengutronix.de>
     [not found]                 ` <1247345591-22643-16-git-send-email-u.kleine-koenig@pengutronix.de>
     [not found]                   ` <1247345591-22643-17-git-send-email-u.kleine-koenig@pengutronix.de>
     [not found]                     ` <1247345591-22643-18-git-send-email-u.kleine-koenig@pengutronix.de>
     [not found]                       ` <1247345591-22643-19-git-send-email-u.kleine-koenig@pengutronix.de>
     [not found]                         ` <1247345591-22643-20-git-send-email-u.kleine-koenig@pengutronix.de>
     [not found]                           ` <alpine.OSX.2.00.0907220032230.796@silk.local>
2009-07-21 15:40                             ` [PATCH] macsonic, jazzsonic - fix oops on module unload Finn Thain
2009-07-21 19:22                               ` David Miller

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).