Commit 398acce7 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

USB: at91_udc, shrink runtime footprint

This is a runtime codespace shrink:  in most cases, platform devices should
put probe() should in the init section, and remove() in the exit section.
And I have no idea why the module init/exit routines were mismarked.
It also moves one function table into read-only data.
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 691895c6
...@@ -784,7 +784,7 @@ static int at91_ep_set_halt(struct usb_ep *_ep, int value) ...@@ -784,7 +784,7 @@ static int at91_ep_set_halt(struct usb_ep *_ep, int value)
return status; return status;
} }
static struct usb_ep_ops at91_ep_ops = { static const struct usb_ep_ops at91_ep_ops = {
.enable = at91_ep_enable, .enable = at91_ep_enable,
.disable = at91_ep_disable, .disable = at91_ep_disable,
.alloc_request = at91_ep_alloc_request, .alloc_request = at91_ep_alloc_request,
...@@ -1651,7 +1651,7 @@ static void at91udc_shutdown(struct platform_device *dev) ...@@ -1651,7 +1651,7 @@ static void at91udc_shutdown(struct platform_device *dev)
pullup(platform_get_drvdata(dev), 0); pullup(platform_get_drvdata(dev), 0);
} }
static int __devinit at91udc_probe(struct platform_device *pdev) static int __init at91udc_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct at91_udc *udc; struct at91_udc *udc;
...@@ -1762,7 +1762,7 @@ static int __devinit at91udc_probe(struct platform_device *pdev) ...@@ -1762,7 +1762,7 @@ static int __devinit at91udc_probe(struct platform_device *pdev)
return retval; return retval;
} }
static int __devexit at91udc_remove(struct platform_device *pdev) static int __exit at91udc_remove(struct platform_device *pdev)
{ {
struct at91_udc *udc = platform_get_drvdata(pdev); struct at91_udc *udc = platform_get_drvdata(pdev);
struct resource *res; struct resource *res;
...@@ -1836,8 +1836,7 @@ static int at91udc_resume(struct platform_device *pdev) ...@@ -1836,8 +1836,7 @@ static int at91udc_resume(struct platform_device *pdev)
#endif #endif
static struct platform_driver at91_udc = { static struct platform_driver at91_udc = {
.probe = at91udc_probe, .remove = __exit_p(at91udc_remove),
.remove = __devexit_p(at91udc_remove),
.shutdown = at91udc_shutdown, .shutdown = at91udc_shutdown,
.suspend = at91udc_suspend, .suspend = at91udc_suspend,
.resume = at91udc_resume, .resume = at91udc_resume,
...@@ -1847,13 +1846,13 @@ static struct platform_driver at91_udc = { ...@@ -1847,13 +1846,13 @@ static struct platform_driver at91_udc = {
}, },
}; };
static int __devinit udc_init_module(void) static int __init udc_init_module(void)
{ {
return platform_driver_register(&at91_udc); return platform_driver_probe(&at91_udc, at91udc_probe);
} }
module_init(udc_init_module); module_init(udc_init_module);
static void __devexit udc_exit_module(void) static void __exit udc_exit_module(void)
{ {
platform_driver_unregister(&at91_udc); platform_driver_unregister(&at91_udc);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment