mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Finn Thain <fthain@telegraphics.com.au>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Greg KH <gregkh@suse.de>,
	linux-kernel@vger.kernel.org, Jeff Garzik <jgarzik@redhat.com>,
	"David S. Miller" <davem@davemloft.net>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] move macsonic's probe function to .devinit.text
Date: Wed, 22 Jul 2009 01:14:36 +1000 (EST)	[thread overview]
Message-ID: <alpine.OSX.2.00.0907220032230.796@silk.local> (raw)
In-Reply-To: <1247345591-22643-20-git-send-email-u.kleine-koenig@pengutronix.de>



On Sat, 11 Jul 2009, Uwe Kleine-K?nig wrote:

> A pointer to mac_sonic_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.

This patch works for me (tested on a Quadra 630). I still get an oops on 
rmmod, but that's a separate issue. I'll send a patch for that.

Finn

>
> Various other functions that are called by mac_sonic_probe need to move 
> to .devinit.text, too.
>
> 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: Jeff Garzik <jgarzik@redhat.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Finn Thain <fthain@telegraphics.com.au>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> ---
> drivers/net/macsonic.c |   14 +++++++-------
> 1 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c
> index acd143d..8f492c7 100644
> --- a/drivers/net/macsonic.c
> +++ b/drivers/net/macsonic.c
> @@ -179,7 +179,7 @@ static const struct net_device_ops macsonic_netdev_ops = {
> 	.ndo_set_mac_address	= eth_mac_addr,
> };
>
> -static int __init macsonic_init(struct net_device *dev)
> +static int __devinit macsonic_init(struct net_device *dev)
> {
> 	struct sonic_local* lp = netdev_priv(dev);
>
> @@ -223,7 +223,7 @@ static int __init macsonic_init(struct net_device *dev)
> 	return 0;
> }
>
> -static int __init mac_onboard_sonic_ethernet_addr(struct net_device *dev)
> +static int __devinit mac_onboard_sonic_ethernet_addr(struct net_device *dev)
> {
> 	struct sonic_local *lp = netdev_priv(dev);
> 	const int prom_addr = ONBOARD_SONIC_PROM_BASE;
> @@ -288,7 +288,7 @@ static int __init mac_onboard_sonic_ethernet_addr(struct net_device *dev)
> 	} else return 0;
> }
>
> -static int __init mac_onboard_sonic_probe(struct net_device *dev)
> +static int __devinit mac_onboard_sonic_probe(struct net_device *dev)
> {
> 	/* Bwahahaha */
> 	static int once_is_more_than_enough;
> @@ -409,7 +409,7 @@ static int __init mac_onboard_sonic_probe(struct net_device *dev)
> 	return macsonic_init(dev);
> }
>
> -static int __init mac_nubus_sonic_ethernet_addr(struct net_device *dev,
> +static int __devinit mac_nubus_sonic_ethernet_addr(struct net_device *dev,
> 						unsigned long prom_addr,
> 						int id)
> {
> @@ -424,7 +424,7 @@ static int __init mac_nubus_sonic_ethernet_addr(struct net_device *dev,
> 	return 0;
> }
>
> -static int __init macsonic_ident(struct nubus_dev *ndev)
> +static int __devinit macsonic_ident(struct nubus_dev *ndev)
> {
> 	if (ndev->dr_hw == NUBUS_DRHW_ASANTE_LC &&
> 	    ndev->dr_sw == NUBUS_DRSW_SONIC_LC)
> @@ -449,7 +449,7 @@ static int __init macsonic_ident(struct nubus_dev *ndev)
> 	return -1;
> }
>
> -static int __init mac_nubus_sonic_probe(struct net_device *dev)
> +static int __devinit mac_nubus_sonic_probe(struct net_device *dev)
> {
> 	static int slots;
> 	struct nubus_dev* ndev = NULL;
> @@ -562,7 +562,7 @@ static int __init mac_nubus_sonic_probe(struct net_device *dev)
> 	return macsonic_init(dev);
> }
>
> -static int __init mac_sonic_probe(struct platform_device *pdev)
> +static int __devinit mac_sonic_probe(struct platform_device *pdev)
> {
> 	struct net_device *dev;
> 	struct sonic_local *lp;
>

  parent reply	other threads:[~2009-07-21 15:22 UTC|newest]

Thread overview: 190+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-16  5:13 [GIT PATCH] USB patches for 2.6.30-git Greg KH
     [not found] ` <1245129858-23818-12-git-send-email-gregkh@suse.de>
2009-06-16  6:05   ` [PATCH 012/143] USB: move twl4030_usb's probe function to .devinit.text Uwe Kleine-König
2009-06-16  6:20     ` Greg KH
2009-06-16  9:14       ` Uwe Kleine-König
2009-06-16 16:21         ` Greg KH
2009-06-16 17:59           ` Uwe Kleine-König
2009-06-16 18:00             ` Greg KH
2009-06-16 18:23               ` Uwe Kleine-König
2009-06-19 13:42                 ` [PATCH] platform_driver_register: warn if probe is in .init.text Uwe Kleine-König
2009-06-19 14:11                   ` Greg KH
2009-06-19 14:43                     ` Uwe Kleine-König
2009-06-29  7:55                       ` Uwe Kleine-König
2009-07-11  3:34                         ` Greg KH
2009-07-11 10:00                           ` Uwe Kleine-König
2009-07-11 17:05                             ` Greg KH
2009-07-11 20:52                               ` [PATCH] move acornfb's probe function to .devinit.text Uwe Kleine-König
2009-07-11 20:52                                 ` [PATCH] move am79c961's " Uwe Kleine-König
2009-07-11 20:52                                   ` [PATCH] move arcfb's " Uwe Kleine-König
2009-07-11 20:52                                     ` [PATCH] move at91_ether's " Uwe Kleine-König
2009-07-11 20:52                                       ` [PATCH] move cfag12864bfb's " Uwe Kleine-König
2009-07-11 20:52                                         ` [PATCH] move leds-clevo-mail's " Uwe Kleine-König
2009-07-11 20:52                                           ` [PATCH] move cobalt-lcd's " Uwe Kleine-König
2009-07-11 20:52                                             ` [PATCH] move corgi-ssp's " Uwe Kleine-König
2009-07-11 20:52                                               ` [PATCH] move efifb's " Uwe Kleine-König
2009-07-11 20:52                                                 ` [PATCH] move epson1355fb's " Uwe Kleine-König
2009-07-11 20:52                                                   ` [PATCH] move sh_flctl's " Uwe Kleine-König
2009-07-11 20:52                                                     ` [PATCH] move gbefb's " Uwe Kleine-König
2009-07-11 20:52                                                       ` [PATCH] move h1940-bt's " Uwe Kleine-König
2009-07-11 20:52                                                         ` [PATCH] move hgafb's " Uwe Kleine-König
2009-07-11 20:52                                                           ` [PATCH] move hitfb's " Uwe Kleine-König
2009-07-11 20:52                                                             ` [PATCH] move hp680-bl's " Uwe Kleine-König
2009-07-11 20:52                                                               ` [PATCH] move hp-wmi's " Uwe Kleine-König
2009-07-11 20:52                                                                 ` [PATCH] move jazzsonic's " Uwe Kleine-König
2009-07-11 20:52                                                                   ` [PATCH] move jornada_ssp's " Uwe Kleine-König
2009-07-11 20:52                                                                     ` [PATCH] move macsonic's " Uwe Kleine-König
2009-07-11 20:52                                                                       ` [PATCH] move meth's " Uwe Kleine-König
2009-07-11 20:52                                                                         ` [PATCH] move omap24xxcam's " Uwe Kleine-König
2009-07-11 20:52                                                                           ` [PATCH] move omap_hdq's " Uwe Kleine-König
2009-07-11 20:52                                                                             ` [PATCH] move i2c_omap's " Uwe Kleine-König
2009-07-11 20:52                                                                               ` [PATCH] move mmci-omap-hs's " Uwe Kleine-König
2009-07-11 20:52                                                                                 ` [PATCH] move orion_nand's " Uwe Kleine-König
2009-07-11 20:52                                                                                   ` [PATCH] move q40fb's " Uwe Kleine-König
2009-07-11 20:52                                                                                     ` [PATCH] move s3c241xfb's " Uwe Kleine-König
2009-07-11 20:52                                                                                       ` [PATCH] move sa11x0-fb's " Uwe Kleine-König
2009-07-11 20:52                                                                                         ` [PATCH] move sb1250-mac's " Uwe Kleine-König
2009-07-11 20:52                                                                                           ` [PATCH] move sgiseeq's " Uwe Kleine-König
2009-07-11 20:53                                                                                             ` [PATCH] move sgivwfb's " Uwe Kleine-König
2009-07-11 20:53                                                                                               ` [PATCH] move sgiwd93's " Uwe Kleine-König
2009-07-11 20:53                                                                                                 ` [PATCH] move sharpsl-pm's " Uwe Kleine-König
2009-07-11 20:53                                                                                                   ` [PATCH] move sh_mobile_lcdc_fb's " Uwe Kleine-König
2009-07-11 20:53                                                                                                     ` [PATCH] move snirm_53c710's " Uwe Kleine-König
2009-07-11 20:53                                                                                                       ` [PATCH] move stk17ta8's " Uwe Kleine-König
2009-07-11 20:53                                                                                                         ` [PATCH] move omap_udc's " Uwe Kleine-König
2009-07-11 20:53                                                                                                           ` [PATCH] move vesafb's " Uwe Kleine-König
2009-07-11 20:53                                                                                                             ` [PATCH] move vfb's " Uwe Kleine-König
2009-07-11 20:53                                                                                                               ` [PATCH] move vga16fb's " Uwe Kleine-König
2009-07-11 20:53                                                                                                                 ` [PATCH] move w100fb's " Uwe Kleine-König
2009-07-11 20:53                                                                                                                   ` [PATCH] move xtsonic's " Uwe Kleine-König
2009-07-11 22:26                                                                                                                   ` [PATCH] move w100fb's " Ian molton
2009-07-11 22:30                                                                                                           ` [PATCH] move omap_udc's " David Brownell
2009-07-12  8:35                                                                                                             ` Uwe Kleine-König
2009-07-12  8:47                                                                                                               ` Russell King
2009-07-12  9:30                                                                                                                 ` David Brownell
2009-07-12 13:17                                                                                                                 ` Russell King
2009-07-12 20:07                                                                                                                   ` David Brownell
2009-07-12 22:21                                                                                                                   ` David Brownell
2009-07-13  9:10                                                                                                                     ` Uwe Kleine-König
2009-07-13 21:31                                                                                                                       ` David Brownell
2009-07-12  9:37                                                                                                               ` David Brownell
2009-07-12 20:48                                                                                                             ` Uwe Kleine-König
2009-07-12 22:12                                                                                                               ` David Brownell
2009-07-13  9:12                                                                                                               ` [PATCH] don't add clevo_mail_led_driver's probe function to the driver struct Uwe Kleine-König
2009-08-13  9:59                                                                                                         ` [PATCH] move stk17ta8's probe function to .devinit.text Jiri Kosina
2009-10-09 15:24                                                                                                         ` Jiri Kosina
2009-10-09 18:33                                                                                                           ` Alessandro Zummo
2009-10-09 21:22                                                                                                             ` Jiri Kosina
2009-10-09 21:55                                                                                                               ` Alessandro Zummo
2009-07-12  0:36                                                                                           ` [PATCH] move sb1250-mac's " Maciej W. Rozycki
2009-07-13 19:37                                                                                   ` [PATCH] move orion_nand's " Nicolas Pitre
2009-07-14  8:09                                                                                     ` Uwe Kleine-König
2009-07-14 16:12                                                                                       ` Nicolas Pitre
2009-07-14 17:17                                                                                         ` Uwe Kleine-König
2009-07-21 20:46                                                                                         ` [PATCH] register orion_nand using platform_driver_probe Uwe Kleine-König
2009-07-21 22:26                                                                                           ` Nicolas Pitre
2009-07-22  5:17                                                                                             ` Uwe Kleine-König
2009-07-11 22:29                                                                                 ` [PATCH] move mmci-omap-hs's probe function to .devinit.text David Brownell
2009-07-21 20:36                                                                                   ` [PATCH] register mmci-omap-hs using platform_driver_probe Uwe Kleine-König
2009-07-22 17:38                                                                                     ` David Brownell
2009-07-21 15:14                                                                       ` Finn Thain [this message]
2009-07-21 19:20                                                                         ` [PATCH] move macsonic's probe function to .devinit.text Uwe Kleine-König
2009-07-21 19:20                                                                         ` David Miller
2009-07-21 19:40                                                                           ` Uwe Kleine-König
2009-07-21 19:41                                                                             ` David Miller
2009-09-19 23:09                                                     ` [PATCH] move sh_flctl's " David Woodhouse
2009-09-21  7:43                                                       ` Uwe Kleine-König
2009-07-13 13:51                                                 ` [PATCH] move efifb's " Peter Jones
2009-07-13  8:44                                               ` [PATCH] move corgi-ssp's " Eric Miao
2009-07-13  9:01                                                 ` Uwe Kleine-König
2009-07-11 22:27                                       ` [PATCH] move at91_ether's " David Brownell
2009-07-21 20:11                                         ` [PATCH] register at91_ether using platform_driver_probe Uwe Kleine-König
2009-07-22 17:37                                           ` David Brownell
2009-07-22 17:46                                           ` Andrew Victor
2009-07-22 18:24                                             ` David Miller
2009-09-07 14:19                               ` [PATCH] platform_driver_register: warn if probe is in .init.text Uwe Kleine-König
2010-01-22 17:06                                 ` Uwe Kleine-König
2010-01-22 17:38                                   ` Greg KH
2010-01-22 19:49                                     ` Uwe Kleine-König
2010-01-22 23:49                                       ` Dmitry Torokhov
2010-01-23  9:49                                         ` Uwe Kleine-König
2010-01-25 17:14                                           ` Dmitry Torokhov
2010-01-25 19:25                                             ` Uwe Kleine-König
2010-01-25 19:31                                               ` Dmitry Torokhov
2010-01-23 20:35                                       ` [PATCH 01/29] move acornfb's probe function to .devinit.text Uwe Kleine-König
2010-01-23 23:25                                         ` Alexey Dobriyan
2010-01-23 23:28                                         ` Alexey Dobriyan
2010-01-26  8:46                                           ` Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 02/29] move am79c961's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 03/29] move arcfb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 04/29] move cfag12864bfb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 05/29] move cobalt-lcd's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 06/29] move corgi-ssp's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 07/29] move efifb's " Uwe Kleine-König
2010-01-26 16:20                                         ` Peter Jones
2010-01-23 20:35                                       ` [PATCH 08/29] move epson1355fb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 09/29] move gbefb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 10/29] move h1940-bt's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 11/29] move hgafb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 12/29] move hitfb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 13/29] move hp-wmi's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 14/29] move jornada_ssp's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 15/29] move omap24xxcam's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 16/29] move omap_hdq's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 17/29] move i2c_omap's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 18/29] move q40fb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 19/29] move s3c241xfb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 20/29] move sa11x0-fb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 21/29] move sgivwfb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 22/29] move sgiwd93's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 23/29] move sharpsl-pm's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 24/29] move sh_mobile_lcdc_fb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 25/29] move snirm_53c710's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 26/29] move vesafb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 27/29] move vfb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 28/29] move vga16fb's " Uwe Kleine-König
2010-01-23 20:35                                       ` [PATCH 29/29] move w100fb's " Uwe Kleine-König
2010-01-24 21:09                                       ` [PATCH] platform_driver_register: warn if probe is in .init.text OGAWA Hirofumi
2010-01-26  8:47                                         ` Uwe Kleine-König
2010-01-28  1:14                                           ` Greg KH
2010-01-30 20:44                                             ` Uwe Kleine-König
2010-01-30 20:46                                               ` [PATCH 1/7] modpost: members of *driver structs should not point to __init functions Uwe Kleine-König
2010-01-30 20:46                                               ` [PATCH 2/7] modpost: define ALL_XYX{IN,EX}IT_SECTIONS Uwe Kleine-König
2010-01-30 20:46                                               ` [PATCH 3/7] modpost: give most mismatch constants a better name Uwe Kleine-König
2010-01-30 20:46                                               ` [PATCH 4/7] modpost: pass around const struct sectioncheck * instead of enum mismatch Uwe Kleine-König
2010-01-30 20:46                                               ` [PATCH 5/7] modpost: remove now unused NO_MISMATCH constant Uwe Kleine-König
2010-01-30 20:46                                               ` [PATCH 6/7] modpost: make symbol white list a per mismatch type variable Uwe Kleine-König
2010-01-30 20:46                                               ` [PATCH 7/7] modpost: don't allow *driver to reference .init.* Uwe Kleine-König
2010-01-31 16:02                                               ` [PATCH] platform_driver_register: warn if probe is in .init.text Sam Ravnborg
2010-01-31 20:13                                                 ` Uwe Kleine-König
2010-02-02 15:25                                                   ` Michal Marek
2010-02-01 14:57                                               ` [PATCH] i2c/imx: don't add probe function to the driver struct Uwe Kleine-König
2010-01-26  8:59                                     ` [PATCH] platform_driver_register: warn if probe is in .init.text Uwe Kleine-König
2010-01-26 14:30                                       ` Greg KH
2010-01-28 18:02                                       ` Greg KH
2010-02-03  9:42                                         ` Uwe Kleine-König
2010-02-03 15:08                                           ` Greg KH
2010-02-04 19:56                                             ` [PATCH 1/9] platform-drivers: move probe to .devinit.text in arch/arm Uwe Kleine-König
2010-02-04 20:56                                               ` Dmitry Eremin-Solenikov
2010-02-04 21:09                                                 ` Kristoffer Ericson
2010-02-04 21:20                                               ` Arnaud Patard
2010-02-04 19:56                                             ` [PATCH 2/9] platform-drivers: move probe to .devinit.text in drivers/scsi Uwe Kleine-König
2010-02-04 20:25                                               ` Ralf Baechle
2010-02-04 21:31                                                 ` Uwe Kleine-König
2010-02-04 19:56                                             ` [PATCH 4/9] x86: move hp-wmi's probe function to .devinit.text Uwe Kleine-König
2010-02-04 20:05                                               ` Matthew Garrett
2010-02-04 19:56                                             ` [PATCH 5/9] i2c: move i2c_omap's " Uwe Kleine-König
2010-02-04 19:56                                             ` [PATCH 6/9] w1: move omap_hdq's " Uwe Kleine-König
2010-02-04 19:56                                             ` [PATCH 7/9] media: move omap24xxcam's " Uwe Kleine-König
2010-02-04 19:56                                             ` [PATCH 8/9] auxdisplay: move cfag12864bfb's " Uwe Kleine-König
2010-02-04 19:56                                             ` [PATCH 9/9] net: move am79c961's " Uwe Kleine-König
2010-02-04 20:05                                               ` David Miller
2010-02-04 20:06                                                 ` Uwe Kleine-König
2010-02-12 20:11                                                   ` David Miller
2010-02-17 20:46                                                   ` Greg KH
2009-09-21  7:54                               ` [PATCH] platform_driver_register: warn if probe is in .init.text Uwe Kleine-König
2009-07-11 18:59                             ` Greg KH
2009-07-11 20:46                               ` Uwe Kleine-König
2009-07-16 22:58                                 ` Greg KH
2009-07-17  8:34                                   ` Uwe Kleine-König
  -- strict thread matches above, loose matches on Subject: below --
2009-03-27 23:26 [PATCH 25/58] move macsonic's probe function to .devinit.text Uwe Kleine-König
2009-03-28 19:33 ` [PATCH] " Uwe Kleine-König
2009-01-12 22:12 platform_driver's probe functions must not be located in .init.text Uwe Kleine-König
2009-01-12 22:24 ` [PATCH] move macsonic's probe function to .devinit.text Uwe Kleine-König

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=alpine.OSX.2.00.0907220032230.796@silk.local \
    --to=fthain@telegraphics.com.au \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@suse.de \
    --cc=jgarzik@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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

Powered by JetHome