aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-02-15 21:47:17 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2007-02-16 18:32:23 -0500
commit398acce7af5eaead2093cf2fc0381e511f5f3edf (patch)
tree9a9e6e9569c3fcca036ed8d7a2b555eeb3ced97d /drivers/usb/gadget
parent691895c661b0419e7cd65429e5077264a2ca01a3 (diff)
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: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/at91_udc.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 36b36e0175fc..82369c4729b5 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -784,7 +784,7 @@ static int at91_ep_set_halt(struct usb_ep *_ep, int value)
784 return status; 784 return status;
785} 785}
786 786
787static struct usb_ep_ops at91_ep_ops = { 787static const struct usb_ep_ops at91_ep_ops = {
788 .enable = at91_ep_enable, 788 .enable = at91_ep_enable,
789 .disable = at91_ep_disable, 789 .disable = at91_ep_disable,
790 .alloc_request = at91_ep_alloc_request, 790 .alloc_request = at91_ep_alloc_request,
@@ -1651,7 +1651,7 @@ static void at91udc_shutdown(struct platform_device *dev)
1651 pullup(platform_get_drvdata(dev), 0); 1651 pullup(platform_get_drvdata(dev), 0);
1652} 1652}
1653 1653
1654static int __devinit at91udc_probe(struct platform_device *pdev) 1654static int __init at91udc_probe(struct platform_device *pdev)
1655{ 1655{
1656 struct device *dev = &pdev->dev; 1656 struct device *dev = &pdev->dev;
1657 struct at91_udc *udc; 1657 struct at91_udc *udc;
@@ -1762,7 +1762,7 @@ fail0:
1762 return retval; 1762 return retval;
1763} 1763}
1764 1764
1765static int __devexit at91udc_remove(struct platform_device *pdev) 1765static int __exit at91udc_remove(struct platform_device *pdev)
1766{ 1766{
1767 struct at91_udc *udc = platform_get_drvdata(pdev); 1767 struct at91_udc *udc = platform_get_drvdata(pdev);
1768 struct resource *res; 1768 struct resource *res;
@@ -1836,8 +1836,7 @@ static int at91udc_resume(struct platform_device *pdev)
1836#endif 1836#endif
1837 1837
1838static struct platform_driver at91_udc = { 1838static struct platform_driver at91_udc = {
1839 .probe = at91udc_probe, 1839 .remove = __exit_p(at91udc_remove),
1840 .remove = __devexit_p(at91udc_remove),
1841 .shutdown = at91udc_shutdown, 1840 .shutdown = at91udc_shutdown,
1842 .suspend = at91udc_suspend, 1841 .suspend = at91udc_suspend,
1843 .resume = at91udc_resume, 1842 .resume = at91udc_resume,
@@ -1847,13 +1846,13 @@ static struct platform_driver at91_udc = {
1847 }, 1846 },
1848}; 1847};
1849 1848
1850static int __devinit udc_init_module(void) 1849static int __init udc_init_module(void)
1851{ 1850{
1852 return platform_driver_register(&at91_udc); 1851 return platform_driver_probe(&at91_udc, at91udc_probe);
1853} 1852}
1854module_init(udc_init_module); 1853module_init(udc_init_module);
1855 1854
1856static void __devexit udc_exit_module(void) 1855static void __exit udc_exit_module(void)
1857{ 1856{
1858 platform_driver_unregister(&at91_udc); 1857 platform_driver_unregister(&at91_udc);
1859} 1858}