From: David Fries Date: Mon, 22 Sep 2008 21:10:20 +0000 (-0700) Subject: ne.c: fix rmmod, platform driver improvements X-Git-Tag: v2.6.28-rc1~717^2~184 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbb80230bf1c1dcc81339e991b172006243333e9;p=pandora-kernel.git 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 Cc: Atsushi Nemoto Cc: Paul Gortmaker Cc: Alan Cox Cc: Jeff Garzik Signed-off-by: Andrew Morton Signed-off-by: Jeff Garzik --- Reading git-diff-tree failed