]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
ne.c: fix rmmod, platform driver improvements
authorDavid Fries <david@fries.net>
Mon, 22 Sep 2008 21:10:20 +0000 (14:10 -0700)
committerJeff Garzik <jgarzik@redhat.com>
Thu, 25 Sep 2008 00:49:00 +0000 (20:49 -0400)
commitfbb80230bf1c1dcc81339e991b172006243333e9
treebc6b4e414dd07c97da41b13039417fd2753bda67
parentbaac03d9bb7b8aa3c33a2dbf5f459ea6ce8abaf4
ne.c: fix rmmod, platform driver improvements

Removing the module would cause a kernel oops as platform_driver_probe
failed to detect a device and unregistered the platform driver on module
init, and cleanup_module would unregister the already unregistered driver.
The suspend and resume functions weren't being called.

platform_driver support was added earlier, but without any
platform_device_register* calls I don't think it was being used.  Now all
devices are registered using platform_device_register_simple and pointers
are kept to unregister the ones that the probe failed for or unregister
all devices on module shutdown.  init_module no longer calls ne_init to
reduce confusion (and multiple unregister paths that caused the rmmod
oops).  With the devices now registered they are added to the platform
driver and get suspend and resume events.

netif_device_detach(dev) was added before unregister_netdev(dev) when
removing the region as occationally I would see a race condition where the
device was still being used in unregister_netdev.

Signed-off-by: David Fries <david@fries.net>
Cc: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Paul Gortmaker <p_gortmaker@yahoo.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/net/ne.c