diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/dummy_hcd.c | 76 | ||||
-rw-r--r-- | drivers/usb/gadget/lh7a40x_udc.c | 31 | ||||
-rw-r--r-- | drivers/usb/gadget/omap_udc.c | 61 | ||||
-rw-r--r-- | drivers/usb/gadget/pxa2xx_udc.c | 41 | ||||
-rw-r--r-- | drivers/usb/host/isp116x-hcd.c | 37 | ||||
-rw-r--r-- | drivers/usb/host/ohci-au1xxx.c | 31 | ||||
-rw-r--r-- | drivers/usb/host/ohci-lh7a404.c | 31 | ||||
-rw-r--r-- | drivers/usb/host/ohci-omap.c | 35 | ||||
-rw-r--r-- | drivers/usb/host/ohci-ppc-soc.c | 21 | ||||
-rw-r--r-- | drivers/usb/host/ohci-pxa27x.c | 31 | ||||
-rw-r--r-- | drivers/usb/host/ohci-s3c2410.c | 21 | ||||
-rw-r--r-- | drivers/usb/host/sl811-hcd.c | 61 |
12 files changed, 230 insertions, 247 deletions
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c index 904519085334..1e407745c115 100644 --- a/drivers/usb/gadget/dummy_hcd.c +++ b/drivers/usb/gadget/dummy_hcd.c | |||
@@ -896,7 +896,7 @@ dummy_gadget_release (struct device *dev) | |||
896 | #endif | 896 | #endif |
897 | } | 897 | } |
898 | 898 | ||
899 | static int dummy_udc_probe (struct device *dev) | 899 | static int dummy_udc_probe (struct platform_device *dev) |
900 | { | 900 | { |
901 | struct dummy *dum = the_controller; | 901 | struct dummy *dum = the_controller; |
902 | int rc; | 902 | int rc; |
@@ -909,7 +909,7 @@ static int dummy_udc_probe (struct device *dev) | |||
909 | dum->gadget.is_otg = (dummy_to_hcd(dum)->self.otg_port != 0); | 909 | dum->gadget.is_otg = (dummy_to_hcd(dum)->self.otg_port != 0); |
910 | 910 | ||
911 | strcpy (dum->gadget.dev.bus_id, "gadget"); | 911 | strcpy (dum->gadget.dev.bus_id, "gadget"); |
912 | dum->gadget.dev.parent = dev; | 912 | dum->gadget.dev.parent = &dev->dev; |
913 | dum->gadget.dev.release = dummy_gadget_release; | 913 | dum->gadget.dev.release = dummy_gadget_release; |
914 | rc = device_register (&dum->gadget.dev); | 914 | rc = device_register (&dum->gadget.dev); |
915 | if (rc < 0) | 915 | if (rc < 0) |
@@ -919,26 +919,26 @@ static int dummy_udc_probe (struct device *dev) | |||
919 | usb_bus_get (&dummy_to_hcd (dum)->self); | 919 | usb_bus_get (&dummy_to_hcd (dum)->self); |
920 | #endif | 920 | #endif |
921 | 921 | ||
922 | dev_set_drvdata (dev, dum); | 922 | platform_set_drvdata (dev, dum); |
923 | device_create_file (&dum->gadget.dev, &dev_attr_function); | 923 | device_create_file (&dum->gadget.dev, &dev_attr_function); |
924 | return rc; | 924 | return rc; |
925 | } | 925 | } |
926 | 926 | ||
927 | static int dummy_udc_remove (struct device *dev) | 927 | static int dummy_udc_remove (struct platform_device *dev) |
928 | { | 928 | { |
929 | struct dummy *dum = dev_get_drvdata (dev); | 929 | struct dummy *dum = platform_get_drvdata (dev); |
930 | 930 | ||
931 | dev_set_drvdata (dev, NULL); | 931 | platform_set_drvdata (dev, NULL); |
932 | device_remove_file (&dum->gadget.dev, &dev_attr_function); | 932 | device_remove_file (&dum->gadget.dev, &dev_attr_function); |
933 | device_unregister (&dum->gadget.dev); | 933 | device_unregister (&dum->gadget.dev); |
934 | return 0; | 934 | return 0; |
935 | } | 935 | } |
936 | 936 | ||
937 | static int dummy_udc_suspend (struct device *dev, pm_message_t state) | 937 | static int dummy_udc_suspend (struct platform_device *dev, pm_message_t state) |
938 | { | 938 | { |
939 | struct dummy *dum = dev_get_drvdata(dev); | 939 | struct dummy *dum = platform_get_drvdata(dev); |
940 | 940 | ||
941 | dev_dbg (dev, "%s\n", __FUNCTION__); | 941 | dev_dbg (&dev->dev, "%s\n", __FUNCTION__); |
942 | spin_lock_irq (&dum->lock); | 942 | spin_lock_irq (&dum->lock); |
943 | dum->udc_suspended = 1; | 943 | dum->udc_suspended = 1; |
944 | set_link_state (dum); | 944 | set_link_state (dum); |
@@ -949,29 +949,30 @@ static int dummy_udc_suspend (struct device *dev, pm_message_t state) | |||
949 | return 0; | 949 | return 0; |
950 | } | 950 | } |
951 | 951 | ||
952 | static int dummy_udc_resume (struct device *dev) | 952 | static int dummy_udc_resume (struct platform_device *dev) |
953 | { | 953 | { |
954 | struct dummy *dum = dev_get_drvdata(dev); | 954 | struct dummy *dum = platform_get_drvdata(dev); |
955 | 955 | ||
956 | dev_dbg (dev, "%s\n", __FUNCTION__); | 956 | dev_dbg (&dev->dev, "%s\n", __FUNCTION__); |
957 | spin_lock_irq (&dum->lock); | 957 | spin_lock_irq (&dum->lock); |
958 | dum->udc_suspended = 0; | 958 | dum->udc_suspended = 0; |
959 | set_link_state (dum); | 959 | set_link_state (dum); |
960 | spin_unlock_irq (&dum->lock); | 960 | spin_unlock_irq (&dum->lock); |
961 | 961 | ||
962 | dev->power.power_state = PMSG_ON; | 962 | dev->dev.power.power_state = PMSG_ON; |
963 | usb_hcd_poll_rh_status (dummy_to_hcd (dum)); | 963 | usb_hcd_poll_rh_status (dummy_to_hcd (dum)); |
964 | return 0; | 964 | return 0; |
965 | } | 965 | } |
966 | 966 | ||
967 | static struct device_driver dummy_udc_driver = { | 967 | static struct platform_driver dummy_udc_driver = { |
968 | .name = (char *) gadget_name, | ||
969 | .owner = THIS_MODULE, | ||
970 | .bus = &platform_bus_type, | ||
971 | .probe = dummy_udc_probe, | 968 | .probe = dummy_udc_probe, |
972 | .remove = dummy_udc_remove, | 969 | .remove = dummy_udc_remove, |
973 | .suspend = dummy_udc_suspend, | 970 | .suspend = dummy_udc_suspend, |
974 | .resume = dummy_udc_resume, | 971 | .resume = dummy_udc_resume, |
972 | .driver = { | ||
973 | .name = (char *) gadget_name, | ||
974 | .owner = THIS_MODULE, | ||
975 | }, | ||
975 | }; | 976 | }; |
976 | 977 | ||
977 | /*-------------------------------------------------------------------------*/ | 978 | /*-------------------------------------------------------------------------*/ |
@@ -1898,14 +1899,14 @@ static const struct hc_driver dummy_hcd = { | |||
1898 | .bus_resume = dummy_bus_resume, | 1899 | .bus_resume = dummy_bus_resume, |
1899 | }; | 1900 | }; |
1900 | 1901 | ||
1901 | static int dummy_hcd_probe (struct device *dev) | 1902 | static int dummy_hcd_probe (struct platform_device *dev) |
1902 | { | 1903 | { |
1903 | struct usb_hcd *hcd; | 1904 | struct usb_hcd *hcd; |
1904 | int retval; | 1905 | int retval; |
1905 | 1906 | ||
1906 | dev_info (dev, "%s, driver " DRIVER_VERSION "\n", driver_desc); | 1907 | dev_info (dev, "%s, driver " DRIVER_VERSION "\n", driver_desc); |
1907 | 1908 | ||
1908 | hcd = usb_create_hcd (&dummy_hcd, dev, dev->bus_id); | 1909 | hcd = usb_create_hcd (&dummy_hcd, &dev->dev, dev->dev.bus_id); |
1909 | if (!hcd) | 1910 | if (!hcd) |
1910 | return -ENOMEM; | 1911 | return -ENOMEM; |
1911 | the_controller = hcd_to_dummy (hcd); | 1912 | the_controller = hcd_to_dummy (hcd); |
@@ -1918,48 +1919,49 @@ static int dummy_hcd_probe (struct device *dev) | |||
1918 | return retval; | 1919 | return retval; |
1919 | } | 1920 | } |
1920 | 1921 | ||
1921 | static int dummy_hcd_remove (struct device *dev) | 1922 | static int dummy_hcd_remove (struct platform_device *dev) |
1922 | { | 1923 | { |
1923 | struct usb_hcd *hcd; | 1924 | struct usb_hcd *hcd; |
1924 | 1925 | ||
1925 | hcd = dev_get_drvdata (dev); | 1926 | hcd = platform_get_drvdata (dev); |
1926 | usb_remove_hcd (hcd); | 1927 | usb_remove_hcd (hcd); |
1927 | usb_put_hcd (hcd); | 1928 | usb_put_hcd (hcd); |
1928 | the_controller = NULL; | 1929 | the_controller = NULL; |
1929 | return 0; | 1930 | return 0; |
1930 | } | 1931 | } |
1931 | 1932 | ||
1932 | static int dummy_hcd_suspend (struct device *dev, pm_message_t state) | 1933 | static int dummy_hcd_suspend (struct platform_device *dev, pm_message_t state) |
1933 | { | 1934 | { |
1934 | struct usb_hcd *hcd; | 1935 | struct usb_hcd *hcd; |
1935 | 1936 | ||
1936 | dev_dbg (dev, "%s\n", __FUNCTION__); | 1937 | dev_dbg (&dev->dev, "%s\n", __FUNCTION__); |
1937 | hcd = dev_get_drvdata (dev); | 1938 | hcd = platform_get_drvdata (dev); |
1938 | 1939 | ||
1939 | hcd->state = HC_STATE_SUSPENDED; | 1940 | hcd->state = HC_STATE_SUSPENDED; |
1940 | return 0; | 1941 | return 0; |
1941 | } | 1942 | } |
1942 | 1943 | ||
1943 | static int dummy_hcd_resume (struct device *dev) | 1944 | static int dummy_hcd_resume (struct platform_device *dev) |
1944 | { | 1945 | { |
1945 | struct usb_hcd *hcd; | 1946 | struct usb_hcd *hcd; |
1946 | 1947 | ||
1947 | dev_dbg (dev, "%s\n", __FUNCTION__); | 1948 | dev_dbg (&dev->dev, "%s\n", __FUNCTION__); |
1948 | hcd = dev_get_drvdata (dev); | 1949 | hcd = platform_get_drvdata (dev); |
1949 | hcd->state = HC_STATE_RUNNING; | 1950 | hcd->state = HC_STATE_RUNNING; |
1950 | 1951 | ||
1951 | usb_hcd_poll_rh_status (hcd); | 1952 | usb_hcd_poll_rh_status (hcd); |
1952 | return 0; | 1953 | return 0; |
1953 | } | 1954 | } |
1954 | 1955 | ||
1955 | static struct device_driver dummy_hcd_driver = { | 1956 | static struct platform_driver dummy_hcd_driver = { |
1956 | .name = (char *) driver_name, | ||
1957 | .owner = THIS_MODULE, | ||
1958 | .bus = &platform_bus_type, | ||
1959 | .probe = dummy_hcd_probe, | 1957 | .probe = dummy_hcd_probe, |
1960 | .remove = dummy_hcd_remove, | 1958 | .remove = dummy_hcd_remove, |
1961 | .suspend = dummy_hcd_suspend, | 1959 | .suspend = dummy_hcd_suspend, |
1962 | .resume = dummy_hcd_resume, | 1960 | .resume = dummy_hcd_resume, |
1961 | .driver = { | ||
1962 | .name = (char *) driver_name, | ||
1963 | .owner = THIS_MODULE, | ||
1964 | }, | ||
1963 | }; | 1965 | }; |
1964 | 1966 | ||
1965 | /*-------------------------------------------------------------------------*/ | 1967 | /*-------------------------------------------------------------------------*/ |
@@ -1995,11 +1997,11 @@ static int __init init (void) | |||
1995 | if (usb_disabled ()) | 1997 | if (usb_disabled ()) |
1996 | return -ENODEV; | 1998 | return -ENODEV; |
1997 | 1999 | ||
1998 | retval = driver_register (&dummy_hcd_driver); | 2000 | retval = platform_driver_register (&dummy_hcd_driver); |
1999 | if (retval < 0) | 2001 | if (retval < 0) |
2000 | return retval; | 2002 | return retval; |
2001 | 2003 | ||
2002 | retval = driver_register (&dummy_udc_driver); | 2004 | retval = platform_driver_register (&dummy_udc_driver); |
2003 | if (retval < 0) | 2005 | if (retval < 0) |
2004 | goto err_register_udc_driver; | 2006 | goto err_register_udc_driver; |
2005 | 2007 | ||
@@ -2015,9 +2017,9 @@ static int __init init (void) | |||
2015 | err_register_udc: | 2017 | err_register_udc: |
2016 | platform_device_unregister (&the_hcd_pdev); | 2018 | platform_device_unregister (&the_hcd_pdev); |
2017 | err_register_hcd: | 2019 | err_register_hcd: |
2018 | driver_unregister (&dummy_udc_driver); | 2020 | platform_driver_unregister (&dummy_udc_driver); |
2019 | err_register_udc_driver: | 2021 | err_register_udc_driver: |
2020 | driver_unregister (&dummy_hcd_driver); | 2022 | platform_driver_unregister (&dummy_hcd_driver); |
2021 | return retval; | 2023 | return retval; |
2022 | } | 2024 | } |
2023 | module_init (init); | 2025 | module_init (init); |
@@ -2026,7 +2028,7 @@ static void __exit cleanup (void) | |||
2026 | { | 2028 | { |
2027 | platform_device_unregister (&the_udc_pdev); | 2029 | platform_device_unregister (&the_udc_pdev); |
2028 | platform_device_unregister (&the_hcd_pdev); | 2030 | platform_device_unregister (&the_hcd_pdev); |
2029 | driver_unregister (&dummy_udc_driver); | 2031 | platform_driver_unregister (&dummy_udc_driver); |
2030 | driver_unregister (&dummy_hcd_driver); | 2032 | platform_driver_unregister (&dummy_hcd_driver); |
2031 | } | 2033 | } |
2032 | module_exit (cleanup); | 2034 | module_exit (cleanup); |
diff --git a/drivers/usb/gadget/lh7a40x_udc.c b/drivers/usb/gadget/lh7a40x_udc.c index bc6269f10cbb..e02fea5a5433 100644 --- a/drivers/usb/gadget/lh7a40x_udc.c +++ b/drivers/usb/gadget/lh7a40x_udc.c | |||
@@ -2085,21 +2085,21 @@ static struct lh7a40x_udc memory = { | |||
2085 | /* | 2085 | /* |
2086 | * probe - binds to the platform device | 2086 | * probe - binds to the platform device |
2087 | */ | 2087 | */ |
2088 | static int lh7a40x_udc_probe(struct device *_dev) | 2088 | static int lh7a40x_udc_probe(struct platform_device *pdev) |
2089 | { | 2089 | { |
2090 | struct lh7a40x_udc *dev = &memory; | 2090 | struct lh7a40x_udc *dev = &memory; |
2091 | int retval; | 2091 | int retval; |
2092 | 2092 | ||
2093 | DEBUG("%s: %p\n", __FUNCTION__, _dev); | 2093 | DEBUG("%s: %p\n", __FUNCTION__, pdev); |
2094 | 2094 | ||
2095 | spin_lock_init(&dev->lock); | 2095 | spin_lock_init(&dev->lock); |
2096 | dev->dev = _dev; | 2096 | dev->dev = &pdev->dev; |
2097 | 2097 | ||
2098 | device_initialize(&dev->gadget.dev); | 2098 | device_initialize(&dev->gadget.dev); |
2099 | dev->gadget.dev.parent = _dev; | 2099 | dev->gadget.dev.parent = &pdev->dev; |
2100 | 2100 | ||
2101 | the_controller = dev; | 2101 | the_controller = dev; |
2102 | dev_set_drvdata(_dev, dev); | 2102 | platform_set_drvdata(pdev, dev); |
2103 | 2103 | ||
2104 | udc_disable(dev); | 2104 | udc_disable(dev); |
2105 | udc_reinit(dev); | 2105 | udc_reinit(dev); |
@@ -2119,11 +2119,11 @@ static int lh7a40x_udc_probe(struct device *_dev) | |||
2119 | return retval; | 2119 | return retval; |
2120 | } | 2120 | } |
2121 | 2121 | ||
2122 | static int lh7a40x_udc_remove(struct device *_dev) | 2122 | static int lh7a40x_udc_remove(struct platform_device *pdev) |
2123 | { | 2123 | { |
2124 | struct lh7a40x_udc *dev = _dev->driver_data; | 2124 | struct lh7a40x_udc *dev = platform_get_drvdata(pdev); |
2125 | 2125 | ||
2126 | DEBUG("%s: %p\n", __FUNCTION__, dev); | 2126 | DEBUG("%s: %p\n", __FUNCTION__, pdev); |
2127 | 2127 | ||
2128 | udc_disable(dev); | 2128 | udc_disable(dev); |
2129 | remove_proc_files(); | 2129 | remove_proc_files(); |
@@ -2131,7 +2131,7 @@ static int lh7a40x_udc_remove(struct device *_dev) | |||
2131 | 2131 | ||
2132 | free_irq(IRQ_USBINTR, dev); | 2132 | free_irq(IRQ_USBINTR, dev); |
2133 | 2133 | ||
2134 | dev_set_drvdata(_dev, 0); | 2134 | platform_set_drvdata(pdev, 0); |
2135 | 2135 | ||
2136 | the_controller = 0; | 2136 | the_controller = 0; |
2137 | 2137 | ||
@@ -2140,26 +2140,27 @@ static int lh7a40x_udc_remove(struct device *_dev) | |||
2140 | 2140 | ||
2141 | /*-------------------------------------------------------------------------*/ | 2141 | /*-------------------------------------------------------------------------*/ |
2142 | 2142 | ||
2143 | static struct device_driver udc_driver = { | 2143 | static struct platform_driver udc_driver = { |
2144 | .name = (char *)driver_name, | ||
2145 | .owner = THIS_MODULE, | ||
2146 | .bus = &platform_bus_type, | ||
2147 | .probe = lh7a40x_udc_probe, | 2144 | .probe = lh7a40x_udc_probe, |
2148 | .remove = lh7a40x_udc_remove | 2145 | .remove = lh7a40x_udc_remove |
2149 | /* FIXME power management support */ | 2146 | /* FIXME power management support */ |
2150 | /* .suspend = ... disable UDC */ | 2147 | /* .suspend = ... disable UDC */ |
2151 | /* .resume = ... re-enable UDC */ | 2148 | /* .resume = ... re-enable UDC */ |
2149 | .driver = { | ||
2150 | .name = (char *)driver_name, | ||
2151 | .owner = THIS_MODULE, | ||
2152 | }, | ||
2152 | }; | 2153 | }; |
2153 | 2154 | ||
2154 | static int __init udc_init(void) | 2155 | static int __init udc_init(void) |
2155 | { | 2156 | { |
2156 | DEBUG("%s: %s version %s\n", __FUNCTION__, driver_name, DRIVER_VERSION); | 2157 | DEBUG("%s: %s version %s\n", __FUNCTION__, driver_name, DRIVER_VERSION); |
2157 | return driver_register(&udc_driver); | 2158 | return platform_driver_register(&udc_driver); |
2158 | } | 2159 | } |
2159 | 2160 | ||
2160 | static void __exit udc_exit(void) | 2161 | static void __exit udc_exit(void) |
2161 | { | 2162 | { |
2162 | driver_unregister(&udc_driver); | 2163 | platform_driver_unregister(&udc_driver); |
2163 | } | 2164 | } |
2164 | 2165 | ||
2165 | module_init(udc_init); | 2166 | module_init(udc_init); |
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c index 387692a3611e..a8972d7c97be 100644 --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c | |||
@@ -2707,18 +2707,17 @@ omap_udc_setup(struct platform_device *odev, struct otg_transceiver *xceiv) | |||
2707 | return 0; | 2707 | return 0; |
2708 | } | 2708 | } |
2709 | 2709 | ||
2710 | static int __init omap_udc_probe(struct device *dev) | 2710 | static int __init omap_udc_probe(struct platform_device *pdev) |
2711 | { | 2711 | { |
2712 | struct platform_device *odev = to_platform_device(dev); | ||
2713 | int status = -ENODEV; | 2712 | int status = -ENODEV; |
2714 | int hmc; | 2713 | int hmc; |
2715 | struct otg_transceiver *xceiv = NULL; | 2714 | struct otg_transceiver *xceiv = NULL; |
2716 | const char *type = NULL; | 2715 | const char *type = NULL; |
2717 | struct omap_usb_config *config = dev->platform_data; | 2716 | struct omap_usb_config *config = pdev->dev.platform_data; |
2718 | 2717 | ||
2719 | /* NOTE: "knows" the order of the resources! */ | 2718 | /* NOTE: "knows" the order of the resources! */ |
2720 | if (!request_mem_region(odev->resource[0].start, | 2719 | if (!request_mem_region(pdev->resource[0].start, |
2721 | odev->resource[0].end - odev->resource[0].start + 1, | 2720 | pdev->resource[0].end - pdev->resource[0].start + 1, |
2722 | driver_name)) { | 2721 | driver_name)) { |
2723 | DBG("request_mem_region failed\n"); | 2722 | DBG("request_mem_region failed\n"); |
2724 | return -EBUSY; | 2723 | return -EBUSY; |
@@ -2803,7 +2802,7 @@ bad_on_1710: | |||
2803 | INFO("hmc mode %d, %s transceiver\n", hmc, type); | 2802 | INFO("hmc mode %d, %s transceiver\n", hmc, type); |
2804 | 2803 | ||
2805 | /* a "gadget" abstracts/virtualizes the controller */ | 2804 | /* a "gadget" abstracts/virtualizes the controller */ |
2806 | status = omap_udc_setup(odev, xceiv); | 2805 | status = omap_udc_setup(pdev, xceiv); |
2807 | if (status) { | 2806 | if (status) { |
2808 | goto cleanup0; | 2807 | goto cleanup0; |
2809 | } | 2808 | } |
@@ -2821,28 +2820,28 @@ bad_on_1710: | |||
2821 | udc->clr_halt = UDC_RESET_EP; | 2820 | udc->clr_halt = UDC_RESET_EP; |
2822 | 2821 | ||
2823 | /* USB general purpose IRQ: ep0, state changes, dma, etc */ | 2822 | /* USB general purpose IRQ: ep0, state changes, dma, etc */ |
2824 | status = request_irq(odev->resource[1].start, omap_udc_irq, | 2823 | status = request_irq(pdev->resource[1].start, omap_udc_irq, |
2825 | SA_SAMPLE_RANDOM, driver_name, udc); | 2824 | SA_SAMPLE_RANDOM, driver_name, udc); |
2826 | if (status != 0) { | 2825 | if (status != 0) { |
2827 | ERR( "can't get irq %ld, err %d\n", | 2826 | ERR( "can't get irq %ld, err %d\n", |
2828 | odev->resource[1].start, status); | 2827 | pdev->resource[1].start, status); |
2829 | goto cleanup1; | 2828 | goto cleanup1; |
2830 | } | 2829 | } |
2831 | 2830 | ||
2832 | /* USB "non-iso" IRQ (PIO for all but ep0) */ | 2831 | /* USB "non-iso" IRQ (PIO for all but ep0) */ |
2833 | status = request_irq(odev->resource[2].start, omap_udc_pio_irq, | 2832 | status = request_irq(pdev->resource[2].start, omap_udc_pio_irq, |
2834 | SA_SAMPLE_RANDOM, "omap_udc pio", udc); | 2833 | SA_SAMPLE_RANDOM, "omap_udc pio", udc); |
2835 | if (status != 0) { | 2834 | if (status != 0) { |
2836 | ERR( "can't get irq %ld, err %d\n", | 2835 | ERR( "can't get irq %ld, err %d\n", |
2837 | odev->resource[2].start, status); | 2836 | pdev->resource[2].start, status); |
2838 | goto cleanup2; | 2837 | goto cleanup2; |
2839 | } | 2838 | } |
2840 | #ifdef USE_ISO | 2839 | #ifdef USE_ISO |
2841 | status = request_irq(odev->resource[3].start, omap_udc_iso_irq, | 2840 | status = request_irq(pdev->resource[3].start, omap_udc_iso_irq, |
2842 | SA_INTERRUPT, "omap_udc iso", udc); | 2841 | SA_INTERRUPT, "omap_udc iso", udc); |
2843 | if (status != 0) { | 2842 | if (status != 0) { |
2844 | ERR("can't get irq %ld, err %d\n", | 2843 | ERR("can't get irq %ld, err %d\n", |
2845 | odev->resource[3].start, status); | 2844 | pdev->resource[3].start, status); |
2846 | goto cleanup3; | 2845 | goto cleanup3; |
2847 | } | 2846 | } |
2848 | #endif | 2847 | #endif |
@@ -2853,11 +2852,11 @@ bad_on_1710: | |||
2853 | 2852 | ||
2854 | #ifdef USE_ISO | 2853 | #ifdef USE_ISO |
2855 | cleanup3: | 2854 | cleanup3: |
2856 | free_irq(odev->resource[2].start, udc); | 2855 | free_irq(pdev->resource[2].start, udc); |
2857 | #endif | 2856 | #endif |
2858 | 2857 | ||
2859 | cleanup2: | 2858 | cleanup2: |
2860 | free_irq(odev->resource[1].start, udc); | 2859 | free_irq(pdev->resource[1].start, udc); |
2861 | 2860 | ||
2862 | cleanup1: | 2861 | cleanup1: |
2863 | kfree (udc); | 2862 | kfree (udc); |
@@ -2866,14 +2865,13 @@ cleanup1: | |||
2866 | cleanup0: | 2865 | cleanup0: |
2867 | if (xceiv) | 2866 | if (xceiv) |
2868 | put_device(xceiv->dev); | 2867 | put_device(xceiv->dev); |
2869 | release_mem_region(odev->resource[0].start, | 2868 | release_mem_region(pdev->resource[0].start, |
2870 | odev->resource[0].end - odev->resource[0].start + 1); | 2869 | pdev->resource[0].end - pdev->resource[0].start + 1); |
2871 | return status; | 2870 | return status; |
2872 | } | 2871 | } |
2873 | 2872 | ||
2874 | static int __exit omap_udc_remove(struct device *dev) | 2873 | static int __exit omap_udc_remove(struct platform_device *pdev) |
2875 | { | 2874 | { |
2876 | struct platform_device *odev = to_platform_device(dev); | ||
2877 | DECLARE_COMPLETION(done); | 2875 | DECLARE_COMPLETION(done); |
2878 | 2876 | ||
2879 | if (!udc) | 2877 | if (!udc) |
@@ -2891,13 +2889,13 @@ static int __exit omap_udc_remove(struct device *dev) | |||
2891 | remove_proc_file(); | 2889 | remove_proc_file(); |
2892 | 2890 | ||
2893 | #ifdef USE_ISO | 2891 | #ifdef USE_ISO |
2894 | free_irq(odev->resource[3].start, udc); | 2892 | free_irq(pdev->resource[3].start, udc); |
2895 | #endif | 2893 | #endif |
2896 | free_irq(odev->resource[2].start, udc); | 2894 | free_irq(pdev->resource[2].start, udc); |
2897 | free_irq(odev->resource[1].start, udc); | 2895 | free_irq(pdev->resource[1].start, udc); |
2898 | 2896 | ||
2899 | release_mem_region(odev->resource[0].start, | 2897 | release_mem_region(pdev->resource[0].start, |
2900 | odev->resource[0].end - odev->resource[0].start + 1); | 2898 | pdev->resource[0].end - pdev->resource[0].start + 1); |
2901 | 2899 | ||
2902 | device_unregister(&udc->gadget.dev); | 2900 | device_unregister(&udc->gadget.dev); |
2903 | wait_for_completion(&done); | 2901 | wait_for_completion(&done); |
@@ -2915,7 +2913,7 @@ static int __exit omap_udc_remove(struct device *dev) | |||
2915 | * may involve talking to an external transceiver (e.g. isp1301). | 2913 | * may involve talking to an external transceiver (e.g. isp1301). |
2916 | */ | 2914 | */ |
2917 | 2915 | ||
2918 | static int omap_udc_suspend(struct device *dev, pm_message_t message) | 2916 | static int omap_udc_suspend(struct platform_device *dev, pm_message_t message) |
2919 | { | 2917 | { |
2920 | u32 devstat; | 2918 | u32 devstat; |
2921 | 2919 | ||
@@ -2935,7 +2933,7 @@ static int omap_udc_suspend(struct device *dev, pm_message_t message) | |||
2935 | return 0; | 2933 | return 0; |
2936 | } | 2934 | } |
2937 | 2935 | ||
2938 | static int omap_udc_resume(struct device *dev) | 2936 | static int omap_udc_resume(struct platform_device *dev) |
2939 | { | 2937 | { |
2940 | DBG("resume + wakeup/SRP\n"); | 2938 | DBG("resume + wakeup/SRP\n"); |
2941 | omap_pullup(&udc->gadget, 1); | 2939 | omap_pullup(&udc->gadget, 1); |
@@ -2947,14 +2945,15 @@ static int omap_udc_resume(struct device *dev) | |||
2947 | 2945 | ||
2948 | /*-------------------------------------------------------------------------*/ | 2946 | /*-------------------------------------------------------------------------*/ |
2949 | 2947 | ||
2950 | static struct device_driver udc_driver = { | 2948 | static struct platform_driver udc_driver = { |
2951 | .name = (char *) driver_name, | ||
2952 | .owner = THIS_MODULE, | ||
2953 | .bus = &platform_bus_type, | ||
2954 | .probe = omap_udc_probe, | 2949 | .probe = omap_udc_probe, |
2955 | .remove = __exit_p(omap_udc_remove), | 2950 | .remove = __exit_p(omap_udc_remove), |
2956 | .suspend = omap_udc_suspend, | 2951 | .suspend = omap_udc_suspend, |
2957 | .resume = omap_udc_resume, | 2952 | .resume = omap_udc_resume, |
2953 | .driver = { | ||
2954 | .owner = THIS_MODULE, | ||
2955 | .name = (char *) driver_name, | ||
2956 | }, | ||
2958 | }; | 2957 | }; |
2959 | 2958 | ||
2960 | static int __init udc_init(void) | 2959 | static int __init udc_init(void) |
@@ -2965,13 +2964,13 @@ static int __init udc_init(void) | |||
2965 | #endif | 2964 | #endif |
2966 | "%s\n", driver_desc, | 2965 | "%s\n", driver_desc, |
2967 | use_dma ? " (dma)" : ""); | 2966 | use_dma ? " (dma)" : ""); |
2968 | return driver_register(&udc_driver); | 2967 | return platform_driver_register(&udc_driver); |
2969 | } | 2968 | } |
2970 | module_init(udc_init); | 2969 | module_init(udc_init); |
2971 | 2970 | ||
2972 | static void __exit udc_exit(void) | 2971 | static void __exit udc_exit(void) |
2973 | { | 2972 | { |
2974 | driver_unregister(&udc_driver); | 2973 | platform_driver_unregister(&udc_driver); |
2975 | } | 2974 | } |
2976 | module_exit(udc_exit); | 2975 | module_exit(udc_exit); |
2977 | 2976 | ||
diff --git a/drivers/usb/gadget/pxa2xx_udc.c b/drivers/usb/gadget/pxa2xx_udc.c index 510d28a924db..bb028c5b8952 100644 --- a/drivers/usb/gadget/pxa2xx_udc.c +++ b/drivers/usb/gadget/pxa2xx_udc.c | |||
@@ -2432,7 +2432,7 @@ static struct pxa2xx_udc memory = { | |||
2432 | /* | 2432 | /* |
2433 | * probe - binds to the platform device | 2433 | * probe - binds to the platform device |
2434 | */ | 2434 | */ |
2435 | static int __init pxa2xx_udc_probe(struct device *_dev) | 2435 | static int __init pxa2xx_udc_probe(struct platform_device *pdev) |
2436 | { | 2436 | { |
2437 | struct pxa2xx_udc *dev = &memory; | 2437 | struct pxa2xx_udc *dev = &memory; |
2438 | int retval, out_dma = 1; | 2438 | int retval, out_dma = 1; |
@@ -2495,19 +2495,19 @@ static int __init pxa2xx_udc_probe(struct device *_dev) | |||
2495 | #endif | 2495 | #endif |
2496 | 2496 | ||
2497 | /* other non-static parts of init */ | 2497 | /* other non-static parts of init */ |
2498 | dev->dev = _dev; | 2498 | dev->dev = &pdev->dev; |
2499 | dev->mach = _dev->platform_data; | 2499 | dev->mach = pdev->dev.platform_data; |
2500 | 2500 | ||
2501 | init_timer(&dev->timer); | 2501 | init_timer(&dev->timer); |
2502 | dev->timer.function = udc_watchdog; | 2502 | dev->timer.function = udc_watchdog; |
2503 | dev->timer.data = (unsigned long) dev; | 2503 | dev->timer.data = (unsigned long) dev; |
2504 | 2504 | ||
2505 | device_initialize(&dev->gadget.dev); | 2505 | device_initialize(&dev->gadget.dev); |
2506 | dev->gadget.dev.parent = _dev; | 2506 | dev->gadget.dev.parent = &pdev->dev; |
2507 | dev->gadget.dev.dma_mask = _dev->dma_mask; | 2507 | dev->gadget.dev.dma_mask = pdev->dev.dma_mask; |
2508 | 2508 | ||
2509 | the_controller = dev; | 2509 | the_controller = dev; |
2510 | dev_set_drvdata(_dev, dev); | 2510 | platform_set_drvdata(pdev, dev); |
2511 | 2511 | ||
2512 | udc_disable(dev); | 2512 | udc_disable(dev); |
2513 | udc_reinit(dev); | 2513 | udc_reinit(dev); |
@@ -2559,14 +2559,14 @@ lubbock_fail0: | |||
2559 | return 0; | 2559 | return 0; |
2560 | } | 2560 | } |
2561 | 2561 | ||
2562 | static void pxa2xx_udc_shutdown(struct device *_dev) | 2562 | static void pxa2xx_udc_shutdown(struct platform_device *_dev) |
2563 | { | 2563 | { |
2564 | pullup_off(); | 2564 | pullup_off(); |
2565 | } | 2565 | } |
2566 | 2566 | ||
2567 | static int __exit pxa2xx_udc_remove(struct device *_dev) | 2567 | static int __exit pxa2xx_udc_remove(struct platform_device *pdev) |
2568 | { | 2568 | { |
2569 | struct pxa2xx_udc *dev = dev_get_drvdata(_dev); | 2569 | struct pxa2xx_udc *dev = platform_get_drvdata(pdev); |
2570 | 2570 | ||
2571 | udc_disable(dev); | 2571 | udc_disable(dev); |
2572 | remove_proc_files(); | 2572 | remove_proc_files(); |
@@ -2580,7 +2580,7 @@ static int __exit pxa2xx_udc_remove(struct device *_dev) | |||
2580 | free_irq(LUBBOCK_USB_DISC_IRQ, dev); | 2580 | free_irq(LUBBOCK_USB_DISC_IRQ, dev); |
2581 | free_irq(LUBBOCK_USB_IRQ, dev); | 2581 | free_irq(LUBBOCK_USB_IRQ, dev); |
2582 | } | 2582 | } |
2583 | dev_set_drvdata(_dev, NULL); | 2583 | platform_set_drvdata(pdev, NULL); |
2584 | the_controller = NULL; | 2584 | the_controller = NULL; |
2585 | return 0; | 2585 | return 0; |
2586 | } | 2586 | } |
@@ -2601,9 +2601,9 @@ static int __exit pxa2xx_udc_remove(struct device *_dev) | |||
2601 | * VBUS IRQs should probably be ignored so that the PXA device just acts | 2601 | * VBUS IRQs should probably be ignored so that the PXA device just acts |
2602 | * "dead" to USB hosts until system resume. | 2602 | * "dead" to USB hosts until system resume. |
2603 | */ | 2603 | */ |
2604 | static int pxa2xx_udc_suspend(struct device *dev, pm_message_t state) | 2604 | static int pxa2xx_udc_suspend(struct platform_device *dev, pm_message_t state) |
2605 | { | 2605 | { |
2606 | struct pxa2xx_udc *udc = dev_get_drvdata(dev); | 2606 | struct pxa2xx_udc *udc = platform_get_drvdata(dev); |
2607 | 2607 | ||
2608 | if (!udc->mach->udc_command) | 2608 | if (!udc->mach->udc_command) |
2609 | WARN("USB host won't detect disconnect!\n"); | 2609 | WARN("USB host won't detect disconnect!\n"); |
@@ -2612,9 +2612,9 @@ static int pxa2xx_udc_suspend(struct device *dev, pm_message_t state) | |||
2612 | return 0; | 2612 | return 0; |
2613 | } | 2613 | } |
2614 | 2614 | ||
2615 | static int pxa2xx_udc_resume(struct device *dev) | 2615 | static int pxa2xx_udc_resume(struct platform_device *dev) |
2616 | { | 2616 | { |
2617 | struct pxa2xx_udc *udc = dev_get_drvdata(dev); | 2617 | struct pxa2xx_udc *udc = platform_get_drvdata(dev); |
2618 | 2618 | ||
2619 | pullup(udc, 1); | 2619 | pullup(udc, 1); |
2620 | 2620 | ||
@@ -2628,27 +2628,28 @@ static int pxa2xx_udc_resume(struct device *dev) | |||
2628 | 2628 | ||
2629 | /*-------------------------------------------------------------------------*/ | 2629 | /*-------------------------------------------------------------------------*/ |
2630 | 2630 | ||
2631 | static struct device_driver udc_driver = { | 2631 | static struct platform_driver udc_driver = { |
2632 | .name = "pxa2xx-udc", | ||
2633 | .owner = THIS_MODULE, | ||
2634 | .bus = &platform_bus_type, | ||
2635 | .probe = pxa2xx_udc_probe, | 2632 | .probe = pxa2xx_udc_probe, |
2636 | .shutdown = pxa2xx_udc_shutdown, | 2633 | .shutdown = pxa2xx_udc_shutdown, |
2637 | .remove = __exit_p(pxa2xx_udc_remove), | 2634 | .remove = __exit_p(pxa2xx_udc_remove), |
2638 | .suspend = pxa2xx_udc_suspend, | 2635 | .suspend = pxa2xx_udc_suspend, |
2639 | .resume = pxa2xx_udc_resume, | 2636 | .resume = pxa2xx_udc_resume, |
2637 | .driver = { | ||
2638 | .owner = THIS_MODULE, | ||
2639 | .name = "pxa2xx-udc", | ||
2640 | }, | ||
2640 | }; | 2641 | }; |
2641 | 2642 | ||
2642 | static int __init udc_init(void) | 2643 | static int __init udc_init(void) |
2643 | { | 2644 | { |
2644 | printk(KERN_INFO "%s: version %s\n", driver_name, DRIVER_VERSION); | 2645 | printk(KERN_INFO "%s: version %s\n", driver_name, DRIVER_VERSION); |
2645 | return driver_register(&udc_driver); | 2646 | return platform_driver_register(&udc_driver); |
2646 | } | 2647 | } |
2647 | module_init(udc_init); | 2648 | module_init(udc_init); |
2648 | 2649 | ||
2649 | static void __exit udc_exit(void) | 2650 | static void __exit udc_exit(void) |
2650 | { | 2651 | { |
2651 | driver_unregister(&udc_driver); | 2652 | platform_driver_unregister(&udc_driver); |
2652 | } | 2653 | } |
2653 | module_exit(udc_exit); | 2654 | module_exit(udc_exit); |
2654 | 2655 | ||
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index f9c3f5b8dd1c..82f64986bc22 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c | |||
@@ -1633,17 +1633,15 @@ static struct hc_driver isp116x_hc_driver = { | |||
1633 | 1633 | ||
1634 | /*----------------------------------------------------------------*/ | 1634 | /*----------------------------------------------------------------*/ |
1635 | 1635 | ||
1636 | static int __init_or_module isp116x_remove(struct device *dev) | 1636 | static int __init_or_module isp116x_remove(struct platform_device *pdev) |
1637 | { | 1637 | { |
1638 | struct usb_hcd *hcd = dev_get_drvdata(dev); | 1638 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
1639 | struct isp116x *isp116x; | 1639 | struct isp116x *isp116x; |
1640 | struct platform_device *pdev; | ||
1641 | struct resource *res; | 1640 | struct resource *res; |
1642 | 1641 | ||
1643 | if (!hcd) | 1642 | if (!hcd) |
1644 | return 0; | 1643 | return 0; |
1645 | isp116x = hcd_to_isp116x(hcd); | 1644 | isp116x = hcd_to_isp116x(hcd); |
1646 | pdev = container_of(dev, struct platform_device, dev); | ||
1647 | remove_debug_file(isp116x); | 1645 | remove_debug_file(isp116x); |
1648 | usb_remove_hcd(hcd); | 1646 | usb_remove_hcd(hcd); |
1649 | 1647 | ||
@@ -1660,18 +1658,16 @@ static int __init_or_module isp116x_remove(struct device *dev) | |||
1660 | 1658 | ||
1661 | #define resource_len(r) (((r)->end - (r)->start) + 1) | 1659 | #define resource_len(r) (((r)->end - (r)->start) + 1) |
1662 | 1660 | ||
1663 | static int __init isp116x_probe(struct device *dev) | 1661 | static int __init isp116x_probe(struct platform_device *pdev) |
1664 | { | 1662 | { |
1665 | struct usb_hcd *hcd; | 1663 | struct usb_hcd *hcd; |
1666 | struct isp116x *isp116x; | 1664 | struct isp116x *isp116x; |
1667 | struct platform_device *pdev; | ||
1668 | struct resource *addr, *data; | 1665 | struct resource *addr, *data; |
1669 | void __iomem *addr_reg; | 1666 | void __iomem *addr_reg; |
1670 | void __iomem *data_reg; | 1667 | void __iomem *data_reg; |
1671 | int irq; | 1668 | int irq; |
1672 | int ret = 0; | 1669 | int ret = 0; |
1673 | 1670 | ||
1674 | pdev = container_of(dev, struct platform_device, dev); | ||
1675 | if (pdev->num_resources < 3) { | 1671 | if (pdev->num_resources < 3) { |
1676 | ret = -ENODEV; | 1672 | ret = -ENODEV; |
1677 | goto err1; | 1673 | goto err1; |
@@ -1685,7 +1681,7 @@ static int __init isp116x_probe(struct device *dev) | |||
1685 | goto err1; | 1681 | goto err1; |
1686 | } | 1682 | } |
1687 | 1683 | ||
1688 | if (dev->dma_mask) { | 1684 | if (pdev->dev.dma_mask) { |
1689 | DBG("DMA not supported\n"); | 1685 | DBG("DMA not supported\n"); |
1690 | ret = -EINVAL; | 1686 | ret = -EINVAL; |
1691 | goto err1; | 1687 | goto err1; |
@@ -1711,7 +1707,7 @@ static int __init isp116x_probe(struct device *dev) | |||
1711 | } | 1707 | } |
1712 | 1708 | ||
1713 | /* allocate and initialize hcd */ | 1709 | /* allocate and initialize hcd */ |
1714 | hcd = usb_create_hcd(&isp116x_hc_driver, dev, dev->bus_id); | 1710 | hcd = usb_create_hcd(&isp116x_hc_driver, &pdev->dev, pdev->dev.bus_id); |
1715 | if (!hcd) { | 1711 | if (!hcd) { |
1716 | ret = -ENOMEM; | 1712 | ret = -ENOMEM; |
1717 | goto err5; | 1713 | goto err5; |
@@ -1723,7 +1719,7 @@ static int __init isp116x_probe(struct device *dev) | |||
1723 | isp116x->addr_reg = addr_reg; | 1719 | isp116x->addr_reg = addr_reg; |
1724 | spin_lock_init(&isp116x->lock); | 1720 | spin_lock_init(&isp116x->lock); |
1725 | INIT_LIST_HEAD(&isp116x->async); | 1721 | INIT_LIST_HEAD(&isp116x->async); |
1726 | isp116x->board = dev->platform_data; | 1722 | isp116x->board = pdev->dev.platform_data; |
1727 | 1723 | ||
1728 | if (!isp116x->board) { | 1724 | if (!isp116x->board) { |
1729 | ERR("Platform data structure not initialized\n"); | 1725 | ERR("Platform data structure not initialized\n"); |
@@ -1764,13 +1760,13 @@ static int __init isp116x_probe(struct device *dev) | |||
1764 | /* | 1760 | /* |
1765 | Suspend of platform device | 1761 | Suspend of platform device |
1766 | */ | 1762 | */ |
1767 | static int isp116x_suspend(struct device *dev, pm_message_t state) | 1763 | static int isp116x_suspend(struct platform_device *dev, pm_message_t state) |
1768 | { | 1764 | { |
1769 | int ret = 0; | 1765 | int ret = 0; |
1770 | 1766 | ||
1771 | VDBG("%s: state %x\n", __func__, state); | 1767 | VDBG("%s: state %x\n", __func__, state); |
1772 | 1768 | ||
1773 | dev->power.power_state = state; | 1769 | dev->dev.power.power_state = state; |
1774 | 1770 | ||
1775 | return ret; | 1771 | return ret; |
1776 | } | 1772 | } |
@@ -1778,13 +1774,13 @@ static int isp116x_suspend(struct device *dev, pm_message_t state) | |||
1778 | /* | 1774 | /* |
1779 | Resume platform device | 1775 | Resume platform device |
1780 | */ | 1776 | */ |
1781 | static int isp116x_resume(struct device *dev) | 1777 | static int isp116x_resume(struct platform_device *dev) |
1782 | { | 1778 | { |
1783 | int ret = 0; | 1779 | int ret = 0; |
1784 | 1780 | ||
1785 | VDBG("%s: state %x\n", __func__, dev->power.power_state); | 1781 | VDBG("%s: state %x\n", __func__, dev->dev.power.power_state); |
1786 | 1782 | ||
1787 | dev->power.power_state = PMSG_ON; | 1783 | dev->dev.power.power_state = PMSG_ON; |
1788 | 1784 | ||
1789 | return ret; | 1785 | return ret; |
1790 | } | 1786 | } |
@@ -1796,13 +1792,14 @@ static int isp116x_resume(struct device *dev) | |||
1796 | 1792 | ||
1797 | #endif | 1793 | #endif |
1798 | 1794 | ||
1799 | static struct device_driver isp116x_driver = { | 1795 | static struct platform_driver isp116x_driver = { |
1800 | .name = (char *)hcd_name, | ||
1801 | .bus = &platform_bus_type, | ||
1802 | .probe = isp116x_probe, | 1796 | .probe = isp116x_probe, |
1803 | .remove = isp116x_remove, | 1797 | .remove = isp116x_remove, |
1804 | .suspend = isp116x_suspend, | 1798 | .suspend = isp116x_suspend, |
1805 | .resume = isp116x_resume, | 1799 | .resume = isp116x_resume, |
1800 | .driver = { | ||
1801 | .name = (char *)hcd_name, | ||
1802 | }, | ||
1806 | }; | 1803 | }; |
1807 | 1804 | ||
1808 | /*-----------------------------------------------------------------*/ | 1805 | /*-----------------------------------------------------------------*/ |
@@ -1813,14 +1810,14 @@ static int __init isp116x_init(void) | |||
1813 | return -ENODEV; | 1810 | return -ENODEV; |
1814 | 1811 | ||
1815 | INFO("driver %s, %s\n", hcd_name, DRIVER_VERSION); | 1812 | INFO("driver %s, %s\n", hcd_name, DRIVER_VERSION); |
1816 | return driver_register(&isp116x_driver); | 1813 | return platform_driver_register(&isp116x_driver); |
1817 | } | 1814 | } |
1818 | 1815 | ||
1819 | module_init(isp116x_init); | 1816 | module_init(isp116x_init); |
1820 | 1817 | ||
1821 | static void __exit isp116x_cleanup(void) | 1818 | static void __exit isp116x_cleanup(void) |
1822 | { | 1819 | { |
1823 | driver_unregister(&isp116x_driver); | 1820 | platform_driver_unregister(&isp116x_driver); |
1824 | } | 1821 | } |
1825 | 1822 | ||
1826 | module_exit(isp116x_cleanup); | 1823 | module_exit(isp116x_cleanup); |
diff --git a/drivers/usb/host/ohci-au1xxx.c b/drivers/usb/host/ohci-au1xxx.c index f0c78cf14b6c..d9cf3b327d96 100644 --- a/drivers/usb/host/ohci-au1xxx.c +++ b/drivers/usb/host/ohci-au1xxx.c | |||
@@ -225,9 +225,8 @@ static const struct hc_driver ohci_au1xxx_hc_driver = { | |||
225 | 225 | ||
226 | /*-------------------------------------------------------------------------*/ | 226 | /*-------------------------------------------------------------------------*/ |
227 | 227 | ||
228 | static int ohci_hcd_au1xxx_drv_probe(struct device *dev) | 228 | static int ohci_hcd_au1xxx_drv_probe(struct platform_device *pdev) |
229 | { | 229 | { |
230 | struct platform_device *pdev = to_platform_device(dev); | ||
231 | int ret; | 230 | int ret; |
232 | 231 | ||
233 | pr_debug ("In ohci_hcd_au1xxx_drv_probe"); | 232 | pr_debug ("In ohci_hcd_au1xxx_drv_probe"); |
@@ -239,39 +238,37 @@ static int ohci_hcd_au1xxx_drv_probe(struct device *dev) | |||
239 | return ret; | 238 | return ret; |
240 | } | 239 | } |
241 | 240 | ||
242 | static int ohci_hcd_au1xxx_drv_remove(struct device *dev) | 241 | static int ohci_hcd_au1xxx_drv_remove(struct platform_device *pdev) |
243 | { | 242 | { |
244 | struct platform_device *pdev = to_platform_device(dev); | 243 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
245 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
246 | 244 | ||
247 | usb_hcd_au1xxx_remove(hcd, pdev); | 245 | usb_hcd_au1xxx_remove(hcd, pdev); |
248 | return 0; | 246 | return 0; |
249 | } | 247 | } |
250 | /*TBD*/ | 248 | /*TBD*/ |
251 | /*static int ohci_hcd_au1xxx_drv_suspend(struct device *dev) | 249 | /*static int ohci_hcd_au1xxx_drv_suspend(struct platform_device *dev) |
252 | { | 250 | { |
253 | struct platform_device *pdev = to_platform_device(dev); | 251 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
254 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
255 | 252 | ||
256 | return 0; | 253 | return 0; |
257 | } | 254 | } |
258 | static int ohci_hcd_au1xxx_drv_resume(struct device *dev) | 255 | static int ohci_hcd_au1xxx_drv_resume(struct platform_device *dev) |
259 | { | 256 | { |
260 | struct platform_device *pdev = to_platform_device(dev); | 257 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
261 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
262 | 258 | ||
263 | return 0; | 259 | return 0; |
264 | } | 260 | } |
265 | */ | 261 | */ |
266 | 262 | ||
267 | static struct device_driver ohci_hcd_au1xxx_driver = { | 263 | static struct platform_driver ohci_hcd_au1xxx_driver = { |
268 | .name = "au1xxx-ohci", | ||
269 | .owner = THIS_MODULE, | ||
270 | .bus = &platform_bus_type, | ||
271 | .probe = ohci_hcd_au1xxx_drv_probe, | 264 | .probe = ohci_hcd_au1xxx_drv_probe, |
272 | .remove = ohci_hcd_au1xxx_drv_remove, | 265 | .remove = ohci_hcd_au1xxx_drv_remove, |
273 | /*.suspend = ohci_hcd_au1xxx_drv_suspend, */ | 266 | /*.suspend = ohci_hcd_au1xxx_drv_suspend, */ |
274 | /*.resume = ohci_hcd_au1xxx_drv_resume, */ | 267 | /*.resume = ohci_hcd_au1xxx_drv_resume, */ |
268 | .driver = { | ||
269 | .name = "au1xxx-ohci", | ||
270 | .owner = THIS_MODULE, | ||
271 | }, | ||
275 | }; | 272 | }; |
276 | 273 | ||
277 | static int __init ohci_hcd_au1xxx_init (void) | 274 | static int __init ohci_hcd_au1xxx_init (void) |
@@ -280,12 +277,12 @@ static int __init ohci_hcd_au1xxx_init (void) | |||
280 | pr_debug ("block sizes: ed %d td %d\n", | 277 | pr_debug ("block sizes: ed %d td %d\n", |
281 | sizeof (struct ed), sizeof (struct td)); | 278 | sizeof (struct ed), sizeof (struct td)); |
282 | 279 | ||
283 | return driver_register(&ohci_hcd_au1xxx_driver); | 280 | return platform_driver_register(&ohci_hcd_au1xxx_driver); |
284 | } | 281 | } |
285 | 282 | ||
286 | static void __exit ohci_hcd_au1xxx_cleanup (void) | 283 | static void __exit ohci_hcd_au1xxx_cleanup (void) |
287 | { | 284 | { |
288 | driver_unregister(&ohci_hcd_au1xxx_driver); | 285 | platform_driver_unregister(&ohci_hcd_au1xxx_driver); |
289 | } | 286 | } |
290 | 287 | ||
291 | module_init (ohci_hcd_au1xxx_init); | 288 | module_init (ohci_hcd_au1xxx_init); |
diff --git a/drivers/usb/host/ohci-lh7a404.c b/drivers/usb/host/ohci-lh7a404.c index 336c766c6e29..081ec3f5cff4 100644 --- a/drivers/usb/host/ohci-lh7a404.c +++ b/drivers/usb/host/ohci-lh7a404.c | |||
@@ -204,9 +204,8 @@ static const struct hc_driver ohci_lh7a404_hc_driver = { | |||
204 | 204 | ||
205 | /*-------------------------------------------------------------------------*/ | 205 | /*-------------------------------------------------------------------------*/ |
206 | 206 | ||
207 | static int ohci_hcd_lh7a404_drv_probe(struct device *dev) | 207 | static int ohci_hcd_lh7a404_drv_probe(struct platform_device *pdev) |
208 | { | 208 | { |
209 | struct platform_device *pdev = to_platform_device(dev); | ||
210 | int ret; | 209 | int ret; |
211 | 210 | ||
212 | pr_debug ("In ohci_hcd_lh7a404_drv_probe"); | 211 | pr_debug ("In ohci_hcd_lh7a404_drv_probe"); |
@@ -218,40 +217,38 @@ static int ohci_hcd_lh7a404_drv_probe(struct device *dev) | |||
218 | return ret; | 217 | return ret; |
219 | } | 218 | } |
220 | 219 | ||
221 | static int ohci_hcd_lh7a404_drv_remove(struct device *dev) | 220 | static int ohci_hcd_lh7a404_drv_remove(struct platform_device *pdev) |
222 | { | 221 | { |
223 | struct platform_device *pdev = to_platform_device(dev); | 222 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
224 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
225 | 223 | ||
226 | usb_hcd_lh7a404_remove(hcd, pdev); | 224 | usb_hcd_lh7a404_remove(hcd, pdev); |
227 | return 0; | 225 | return 0; |
228 | } | 226 | } |
229 | /*TBD*/ | 227 | /*TBD*/ |
230 | /*static int ohci_hcd_lh7a404_drv_suspend(struct device *dev) | 228 | /*static int ohci_hcd_lh7a404_drv_suspend(struct platform_device *dev) |
231 | { | 229 | { |
232 | struct platform_device *pdev = to_platform_device(dev); | 230 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
233 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
234 | 231 | ||
235 | return 0; | 232 | return 0; |
236 | } | 233 | } |
237 | static int ohci_hcd_lh7a404_drv_resume(struct device *dev) | 234 | static int ohci_hcd_lh7a404_drv_resume(struct platform_device *dev) |
238 | { | 235 | { |
239 | struct platform_device *pdev = to_platform_device(dev); | 236 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
240 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
241 | 237 | ||
242 | 238 | ||
243 | return 0; | 239 | return 0; |
244 | } | 240 | } |
245 | */ | 241 | */ |
246 | 242 | ||
247 | static struct device_driver ohci_hcd_lh7a404_driver = { | 243 | static struct platform_driver ohci_hcd_lh7a404_driver = { |
248 | .name = "lh7a404-ohci", | ||
249 | .owner = THIS_MODULE, | ||
250 | .bus = &platform_bus_type, | ||
251 | .probe = ohci_hcd_lh7a404_drv_probe, | 244 | .probe = ohci_hcd_lh7a404_drv_probe, |
252 | .remove = ohci_hcd_lh7a404_drv_remove, | 245 | .remove = ohci_hcd_lh7a404_drv_remove, |
253 | /*.suspend = ohci_hcd_lh7a404_drv_suspend, */ | 246 | /*.suspend = ohci_hcd_lh7a404_drv_suspend, */ |
254 | /*.resume = ohci_hcd_lh7a404_drv_resume, */ | 247 | /*.resume = ohci_hcd_lh7a404_drv_resume, */ |
248 | .driver = { | ||
249 | .name = "lh7a404-ohci", | ||
250 | .owner = THIS_MODULE, | ||
251 | }, | ||
255 | }; | 252 | }; |
256 | 253 | ||
257 | static int __init ohci_hcd_lh7a404_init (void) | 254 | static int __init ohci_hcd_lh7a404_init (void) |
@@ -260,12 +257,12 @@ static int __init ohci_hcd_lh7a404_init (void) | |||
260 | pr_debug ("block sizes: ed %d td %d\n", | 257 | pr_debug ("block sizes: ed %d td %d\n", |
261 | sizeof (struct ed), sizeof (struct td)); | 258 | sizeof (struct ed), sizeof (struct td)); |
262 | 259 | ||
263 | return driver_register(&ohci_hcd_lh7a404_driver); | 260 | return platform_driver_register(&ohci_hcd_lh7a404_driver); |
264 | } | 261 | } |
265 | 262 | ||
266 | static void __exit ohci_hcd_lh7a404_cleanup (void) | 263 | static void __exit ohci_hcd_lh7a404_cleanup (void) |
267 | { | 264 | { |
268 | driver_unregister(&ohci_hcd_lh7a404_driver); | 265 | platform_driver_unregister(&ohci_hcd_lh7a404_driver); |
269 | } | 266 | } |
270 | 267 | ||
271 | module_init (ohci_hcd_lh7a404_init); | 268 | module_init (ohci_hcd_lh7a404_init); |
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index e46cc540cf4d..c9e29d808711 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c | |||
@@ -433,24 +433,22 @@ static const struct hc_driver ohci_omap_hc_driver = { | |||
433 | 433 | ||
434 | /*-------------------------------------------------------------------------*/ | 434 | /*-------------------------------------------------------------------------*/ |
435 | 435 | ||
436 | static int ohci_hcd_omap_drv_probe(struct device *dev) | 436 | static int ohci_hcd_omap_drv_probe(struct platform_device *dev) |
437 | { | 437 | { |
438 | return usb_hcd_omap_probe(&ohci_omap_hc_driver, | 438 | return usb_hcd_omap_probe(&ohci_omap_hc_driver, dev); |
439 | to_platform_device(dev)); | ||
440 | } | 439 | } |
441 | 440 | ||
442 | static int ohci_hcd_omap_drv_remove(struct device *dev) | 441 | static int ohci_hcd_omap_drv_remove(struct platform_device *dev) |
443 | { | 442 | { |
444 | struct platform_device *pdev = to_platform_device(dev); | 443 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
445 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
446 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); | 444 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); |
447 | 445 | ||
448 | usb_hcd_omap_remove(hcd, pdev); | 446 | usb_hcd_omap_remove(hcd, dev); |
449 | if (ohci->transceiver) { | 447 | if (ohci->transceiver) { |
450 | (void) otg_set_host(ohci->transceiver, 0); | 448 | (void) otg_set_host(ohci->transceiver, 0); |
451 | put_device(ohci->transceiver->dev); | 449 | put_device(ohci->transceiver->dev); |
452 | } | 450 | } |
453 | dev_set_drvdata(dev, NULL); | 451 | platform_set_drvdata(dev, NULL); |
454 | 452 | ||
455 | return 0; | 453 | return 0; |
456 | } | 454 | } |
@@ -459,9 +457,9 @@ static int ohci_hcd_omap_drv_remove(struct device *dev) | |||
459 | 457 | ||
460 | #ifdef CONFIG_PM | 458 | #ifdef CONFIG_PM |
461 | 459 | ||
462 | static int ohci_omap_suspend(struct device *dev, pm_message_t message) | 460 | static int ohci_omap_suspend(struct platform_device *dev, pm_message_t message) |
463 | { | 461 | { |
464 | struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev)); | 462 | struct ohci_hcd *ohci = hcd_to_ohci(platform_get_drvdata(dev)); |
465 | 463 | ||
466 | if (time_before(jiffies, ohci->next_statechange)) | 464 | if (time_before(jiffies, ohci->next_statechange)) |
467 | msleep(5); | 465 | msleep(5); |
@@ -473,9 +471,9 @@ static int ohci_omap_suspend(struct device *dev, pm_message_t message) | |||
473 | return 0; | 471 | return 0; |
474 | } | 472 | } |
475 | 473 | ||
476 | static int ohci_omap_resume(struct device *dev) | 474 | static int ohci_omap_resume(struct platform_device *dev) |
477 | { | 475 | { |
478 | struct ohci_hcd *ohci = hcd_to_ohci(dev_get_drvdata(dev)); | 476 | struct ohci_hcd *ohci = hcd_to_ohci(platform_get_drvdata(dev)); |
479 | 477 | ||
480 | if (time_before(jiffies, ohci->next_statechange)) | 478 | if (time_before(jiffies, ohci->next_statechange)) |
481 | msleep(5); | 479 | msleep(5); |
@@ -494,16 +492,17 @@ static int ohci_omap_resume(struct device *dev) | |||
494 | /* | 492 | /* |
495 | * Driver definition to register with the OMAP bus | 493 | * Driver definition to register with the OMAP bus |
496 | */ | 494 | */ |
497 | static struct device_driver ohci_hcd_omap_driver = { | 495 | static struct platform_driver ohci_hcd_omap_driver = { |
498 | .name = "ohci", | ||
499 | .owner = THIS_MODULE, | ||
500 | .bus = &platform_bus_type, | ||
501 | .probe = ohci_hcd_omap_drv_probe, | 496 | .probe = ohci_hcd_omap_drv_probe, |
502 | .remove = ohci_hcd_omap_drv_remove, | 497 | .remove = ohci_hcd_omap_drv_remove, |
503 | #ifdef CONFIG_PM | 498 | #ifdef CONFIG_PM |
504 | .suspend = ohci_omap_suspend, | 499 | .suspend = ohci_omap_suspend, |
505 | .resume = ohci_omap_resume, | 500 | .resume = ohci_omap_resume, |
506 | #endif | 501 | #endif |
502 | .driver = { | ||
503 | .owner = THIS_MODULE, | ||
504 | .name = "ohci", | ||
505 | }, | ||
507 | }; | 506 | }; |
508 | 507 | ||
509 | static int __init ohci_hcd_omap_init (void) | 508 | static int __init ohci_hcd_omap_init (void) |
@@ -515,12 +514,12 @@ static int __init ohci_hcd_omap_init (void) | |||
515 | pr_debug("%s: block sizes: ed %Zd td %Zd\n", hcd_name, | 514 | pr_debug("%s: block sizes: ed %Zd td %Zd\n", hcd_name, |
516 | sizeof (struct ed), sizeof (struct td)); | 515 | sizeof (struct ed), sizeof (struct td)); |
517 | 516 | ||
518 | return driver_register(&ohci_hcd_omap_driver); | 517 | return platform_driver_register(&ohci_hcd_omap_driver); |
519 | } | 518 | } |
520 | 519 | ||
521 | static void __exit ohci_hcd_omap_cleanup (void) | 520 | static void __exit ohci_hcd_omap_cleanup (void) |
522 | { | 521 | { |
523 | driver_unregister(&ohci_hcd_omap_driver); | 522 | platform_driver_unregister(&ohci_hcd_omap_driver); |
524 | } | 523 | } |
525 | 524 | ||
526 | module_init (ohci_hcd_omap_init); | 525 | module_init (ohci_hcd_omap_init); |
diff --git a/drivers/usb/host/ohci-ppc-soc.c b/drivers/usb/host/ohci-ppc-soc.c index 92cf6f4a1374..18755766e406 100644 --- a/drivers/usb/host/ohci-ppc-soc.c +++ b/drivers/usb/host/ohci-ppc-soc.c | |||
@@ -172,9 +172,8 @@ static const struct hc_driver ohci_ppc_soc_hc_driver = { | |||
172 | .start_port_reset = ohci_start_port_reset, | 172 | .start_port_reset = ohci_start_port_reset, |
173 | }; | 173 | }; |
174 | 174 | ||
175 | static int ohci_hcd_ppc_soc_drv_probe(struct device *dev) | 175 | static int ohci_hcd_ppc_soc_drv_probe(struct platform_device *pdev) |
176 | { | 176 | { |
177 | struct platform_device *pdev = to_platform_device(dev); | ||
178 | int ret; | 177 | int ret; |
179 | 178 | ||
180 | if (usb_disabled()) | 179 | if (usb_disabled()) |
@@ -184,25 +183,25 @@ static int ohci_hcd_ppc_soc_drv_probe(struct device *dev) | |||
184 | return ret; | 183 | return ret; |
185 | } | 184 | } |
186 | 185 | ||
187 | static int ohci_hcd_ppc_soc_drv_remove(struct device *dev) | 186 | static int ohci_hcd_ppc_soc_drv_remove(struct platform_device *pdev) |
188 | { | 187 | { |
189 | struct platform_device *pdev = to_platform_device(dev); | 188 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
190 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
191 | 189 | ||
192 | usb_hcd_ppc_soc_remove(hcd, pdev); | 190 | usb_hcd_ppc_soc_remove(hcd, pdev); |
193 | return 0; | 191 | return 0; |
194 | } | 192 | } |
195 | 193 | ||
196 | static struct device_driver ohci_hcd_ppc_soc_driver = { | 194 | static struct platform_driver ohci_hcd_ppc_soc_driver = { |
197 | .name = "ppc-soc-ohci", | ||
198 | .owner = THIS_MODULE, | ||
199 | .bus = &platform_bus_type, | ||
200 | .probe = ohci_hcd_ppc_soc_drv_probe, | 195 | .probe = ohci_hcd_ppc_soc_drv_probe, |
201 | .remove = ohci_hcd_ppc_soc_drv_remove, | 196 | .remove = ohci_hcd_ppc_soc_drv_remove, |
202 | #ifdef CONFIG_PM | 197 | #ifdef CONFIG_PM |
203 | /*.suspend = ohci_hcd_ppc_soc_drv_suspend,*/ | 198 | /*.suspend = ohci_hcd_ppc_soc_drv_suspend,*/ |
204 | /*.resume = ohci_hcd_ppc_soc_drv_resume,*/ | 199 | /*.resume = ohci_hcd_ppc_soc_drv_resume,*/ |
205 | #endif | 200 | #endif |
201 | .driver = { | ||
202 | .name = "ppc-soc-ohci", | ||
203 | .owner = THIS_MODULE, | ||
204 | }, | ||
206 | }; | 205 | }; |
207 | 206 | ||
208 | static int __init ohci_hcd_ppc_soc_init(void) | 207 | static int __init ohci_hcd_ppc_soc_init(void) |
@@ -211,12 +210,12 @@ static int __init ohci_hcd_ppc_soc_init(void) | |||
211 | pr_debug("block sizes: ed %d td %d\n", sizeof(struct ed), | 210 | pr_debug("block sizes: ed %d td %d\n", sizeof(struct ed), |
212 | sizeof(struct td)); | 211 | sizeof(struct td)); |
213 | 212 | ||
214 | return driver_register(&ohci_hcd_ppc_soc_driver); | 213 | return platform_driver_register(&ohci_hcd_ppc_soc_driver); |
215 | } | 214 | } |
216 | 215 | ||
217 | static void __exit ohci_hcd_ppc_soc_cleanup(void) | 216 | static void __exit ohci_hcd_ppc_soc_cleanup(void) |
218 | { | 217 | { |
219 | driver_unregister(&ohci_hcd_ppc_soc_driver); | 218 | platform_driver_unregister(&ohci_hcd_ppc_soc_driver); |
220 | } | 219 | } |
221 | 220 | ||
222 | module_init(ohci_hcd_ppc_soc_init); | 221 | module_init(ohci_hcd_ppc_soc_init); |
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index 59e20568e8f9..9d65ec307990 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c | |||
@@ -290,9 +290,8 @@ static const struct hc_driver ohci_pxa27x_hc_driver = { | |||
290 | 290 | ||
291 | /*-------------------------------------------------------------------------*/ | 291 | /*-------------------------------------------------------------------------*/ |
292 | 292 | ||
293 | static int ohci_hcd_pxa27x_drv_probe(struct device *dev) | 293 | static int ohci_hcd_pxa27x_drv_probe(struct platform_device *pdev) |
294 | { | 294 | { |
295 | struct platform_device *pdev = to_platform_device(dev); | ||
296 | int ret; | 295 | int ret; |
297 | 296 | ||
298 | pr_debug ("In ohci_hcd_pxa27x_drv_probe"); | 297 | pr_debug ("In ohci_hcd_pxa27x_drv_probe"); |
@@ -304,41 +303,39 @@ static int ohci_hcd_pxa27x_drv_probe(struct device *dev) | |||
304 | return ret; | 303 | return ret; |
305 | } | 304 | } |
306 | 305 | ||
307 | static int ohci_hcd_pxa27x_drv_remove(struct device *dev) | 306 | static int ohci_hcd_pxa27x_drv_remove(struct platform_device *pdev) |
308 | { | 307 | { |
309 | struct platform_device *pdev = to_platform_device(dev); | 308 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
310 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
311 | 309 | ||
312 | usb_hcd_pxa27x_remove(hcd, pdev); | 310 | usb_hcd_pxa27x_remove(hcd, pdev); |
313 | return 0; | 311 | return 0; |
314 | } | 312 | } |
315 | 313 | ||
316 | static int ohci_hcd_pxa27x_drv_suspend(struct device *dev, pm_message_t state) | 314 | static int ohci_hcd_pxa27x_drv_suspend(struct platform_device *dev, pm_message_t state) |
317 | { | 315 | { |
318 | // struct platform_device *pdev = to_platform_device(dev); | 316 | // struct usb_hcd *hcd = platform_get_drvdata(dev); |
319 | // struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
320 | printk("%s: not implemented yet\n", __FUNCTION__); | 317 | printk("%s: not implemented yet\n", __FUNCTION__); |
321 | 318 | ||
322 | return 0; | 319 | return 0; |
323 | } | 320 | } |
324 | 321 | ||
325 | static int ohci_hcd_pxa27x_drv_resume(struct device *dev) | 322 | static int ohci_hcd_pxa27x_drv_resume(struct platform_device *dev) |
326 | { | 323 | { |
327 | // struct platform_device *pdev = to_platform_device(dev); | 324 | // struct usb_hcd *hcd = platform_get_drvdata(dev); |
328 | // struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
329 | printk("%s: not implemented yet\n", __FUNCTION__); | 325 | printk("%s: not implemented yet\n", __FUNCTION__); |
330 | 326 | ||
331 | return 0; | 327 | return 0; |
332 | } | 328 | } |
333 | 329 | ||
334 | 330 | ||
335 | static struct device_driver ohci_hcd_pxa27x_driver = { | 331 | static struct platform_driver ohci_hcd_pxa27x_driver = { |
336 | .name = "pxa27x-ohci", | ||
337 | .bus = &platform_bus_type, | ||
338 | .probe = ohci_hcd_pxa27x_drv_probe, | 332 | .probe = ohci_hcd_pxa27x_drv_probe, |
339 | .remove = ohci_hcd_pxa27x_drv_remove, | 333 | .remove = ohci_hcd_pxa27x_drv_remove, |
340 | .suspend = ohci_hcd_pxa27x_drv_suspend, | 334 | .suspend = ohci_hcd_pxa27x_drv_suspend, |
341 | .resume = ohci_hcd_pxa27x_drv_resume, | 335 | .resume = ohci_hcd_pxa27x_drv_resume, |
336 | .driver = { | ||
337 | .name = "pxa27x-ohci", | ||
338 | }, | ||
342 | }; | 339 | }; |
343 | 340 | ||
344 | static int __init ohci_hcd_pxa27x_init (void) | 341 | static int __init ohci_hcd_pxa27x_init (void) |
@@ -347,12 +344,12 @@ static int __init ohci_hcd_pxa27x_init (void) | |||
347 | pr_debug ("block sizes: ed %d td %d\n", | 344 | pr_debug ("block sizes: ed %d td %d\n", |
348 | sizeof (struct ed), sizeof (struct td)); | 345 | sizeof (struct ed), sizeof (struct td)); |
349 | 346 | ||
350 | return driver_register(&ohci_hcd_pxa27x_driver); | 347 | return platform_driver_register(&ohci_hcd_pxa27x_driver); |
351 | } | 348 | } |
352 | 349 | ||
353 | static void __exit ohci_hcd_pxa27x_cleanup (void) | 350 | static void __exit ohci_hcd_pxa27x_cleanup (void) |
354 | { | 351 | { |
355 | driver_unregister(&ohci_hcd_pxa27x_driver); | 352 | platform_driver_unregister(&ohci_hcd_pxa27x_driver); |
356 | } | 353 | } |
357 | 354 | ||
358 | module_init (ohci_hcd_pxa27x_init); | 355 | module_init (ohci_hcd_pxa27x_init); |
diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c index ee1fc605b402..35cc9402adc0 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c | |||
@@ -459,39 +459,38 @@ static const struct hc_driver ohci_s3c2410_hc_driver = { | |||
459 | 459 | ||
460 | /* device driver */ | 460 | /* device driver */ |
461 | 461 | ||
462 | static int ohci_hcd_s3c2410_drv_probe(struct device *dev) | 462 | static int ohci_hcd_s3c2410_drv_probe(struct platform_device *pdev) |
463 | { | 463 | { |
464 | struct platform_device *pdev = to_platform_device(dev); | ||
465 | return usb_hcd_s3c2410_probe(&ohci_s3c2410_hc_driver, pdev); | 464 | return usb_hcd_s3c2410_probe(&ohci_s3c2410_hc_driver, pdev); |
466 | } | 465 | } |
467 | 466 | ||
468 | static int ohci_hcd_s3c2410_drv_remove(struct device *dev) | 467 | static int ohci_hcd_s3c2410_drv_remove(struct platform_device *pdev) |
469 | { | 468 | { |
470 | struct platform_device *pdev = to_platform_device(dev); | 469 | struct usb_hcd *hcd = platform_get_drvdata(pdev); |
471 | struct usb_hcd *hcd = dev_get_drvdata(dev); | ||
472 | 470 | ||
473 | usb_hcd_s3c2410_remove(hcd, pdev); | 471 | usb_hcd_s3c2410_remove(hcd, pdev); |
474 | return 0; | 472 | return 0; |
475 | } | 473 | } |
476 | 474 | ||
477 | static struct device_driver ohci_hcd_s3c2410_driver = { | 475 | static struct platform_driver ohci_hcd_s3c2410_driver = { |
478 | .name = "s3c2410-ohci", | ||
479 | .owner = THIS_MODULE, | ||
480 | .bus = &platform_bus_type, | ||
481 | .probe = ohci_hcd_s3c2410_drv_probe, | 476 | .probe = ohci_hcd_s3c2410_drv_probe, |
482 | .remove = ohci_hcd_s3c2410_drv_remove, | 477 | .remove = ohci_hcd_s3c2410_drv_remove, |
483 | /*.suspend = ohci_hcd_s3c2410_drv_suspend, */ | 478 | /*.suspend = ohci_hcd_s3c2410_drv_suspend, */ |
484 | /*.resume = ohci_hcd_s3c2410_drv_resume, */ | 479 | /*.resume = ohci_hcd_s3c2410_drv_resume, */ |
480 | .driver = { | ||
481 | .owner = THIS_MODULE, | ||
482 | .name = "s3c2410-ohci", | ||
483 | }, | ||
485 | }; | 484 | }; |
486 | 485 | ||
487 | static int __init ohci_hcd_s3c2410_init (void) | 486 | static int __init ohci_hcd_s3c2410_init (void) |
488 | { | 487 | { |
489 | return driver_register(&ohci_hcd_s3c2410_driver); | 488 | return platform_driver_register(&ohci_hcd_s3c2410_driver); |
490 | } | 489 | } |
491 | 490 | ||
492 | static void __exit ohci_hcd_s3c2410_cleanup (void) | 491 | static void __exit ohci_hcd_s3c2410_cleanup (void) |
493 | { | 492 | { |
494 | driver_unregister(&ohci_hcd_s3c2410_driver); | 493 | platform_driver_unregister(&ohci_hcd_s3c2410_driver); |
495 | } | 494 | } |
496 | 495 | ||
497 | module_init (ohci_hcd_s3c2410_init); | 496 | module_init (ohci_hcd_s3c2410_init); |
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c index 5607c0ae6835..a7722a6a5a5b 100644 --- a/drivers/usb/host/sl811-hcd.c +++ b/drivers/usb/host/sl811-hcd.c | |||
@@ -1631,24 +1631,21 @@ static struct hc_driver sl811h_hc_driver = { | |||
1631 | /*-------------------------------------------------------------------------*/ | 1631 | /*-------------------------------------------------------------------------*/ |
1632 | 1632 | ||
1633 | static int __devexit | 1633 | static int __devexit |
1634 | sl811h_remove(struct device *dev) | 1634 | sl811h_remove(struct platform_device *dev) |
1635 | { | 1635 | { |
1636 | struct usb_hcd *hcd = dev_get_drvdata(dev); | 1636 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
1637 | struct sl811 *sl811 = hcd_to_sl811(hcd); | 1637 | struct sl811 *sl811 = hcd_to_sl811(hcd); |
1638 | struct platform_device *pdev; | ||
1639 | struct resource *res; | 1638 | struct resource *res; |
1640 | 1639 | ||
1641 | pdev = container_of(dev, struct platform_device, dev); | ||
1642 | |||
1643 | remove_debug_file(sl811); | 1640 | remove_debug_file(sl811); |
1644 | usb_remove_hcd(hcd); | 1641 | usb_remove_hcd(hcd); |
1645 | 1642 | ||
1646 | /* some platforms may use IORESOURCE_IO */ | 1643 | /* some platforms may use IORESOURCE_IO */ |
1647 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 1644 | res = platform_get_resource(dev, IORESOURCE_MEM, 1); |
1648 | if (res) | 1645 | if (res) |
1649 | iounmap(sl811->data_reg); | 1646 | iounmap(sl811->data_reg); |
1650 | 1647 | ||
1651 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1648 | res = platform_get_resource(dev, IORESOURCE_MEM, 0); |
1652 | if (res) | 1649 | if (res) |
1653 | iounmap(sl811->addr_reg); | 1650 | iounmap(sl811->addr_reg); |
1654 | 1651 | ||
@@ -1657,11 +1654,10 @@ sl811h_remove(struct device *dev) | |||
1657 | } | 1654 | } |
1658 | 1655 | ||
1659 | static int __devinit | 1656 | static int __devinit |
1660 | sl811h_probe(struct device *dev) | 1657 | sl811h_probe(struct platform_device *dev) |
1661 | { | 1658 | { |
1662 | struct usb_hcd *hcd; | 1659 | struct usb_hcd *hcd; |
1663 | struct sl811 *sl811; | 1660 | struct sl811 *sl811; |
1664 | struct platform_device *pdev; | ||
1665 | struct resource *addr, *data; | 1661 | struct resource *addr, *data; |
1666 | int irq; | 1662 | int irq; |
1667 | void __iomem *addr_reg; | 1663 | void __iomem *addr_reg; |
@@ -1674,24 +1670,23 @@ sl811h_probe(struct device *dev) | |||
1674 | * specific platform_data. we don't probe for IRQs, and do only | 1670 | * specific platform_data. we don't probe for IRQs, and do only |
1675 | * minimal sanity checking. | 1671 | * minimal sanity checking. |
1676 | */ | 1672 | */ |
1677 | pdev = container_of(dev, struct platform_device, dev); | 1673 | irq = platform_get_irq(dev, 0); |
1678 | irq = platform_get_irq(pdev, 0); | 1674 | if (dev->num_resources < 3 || irq < 0) |
1679 | if (pdev->num_resources < 3 || irq < 0) | ||
1680 | return -ENODEV; | 1675 | return -ENODEV; |
1681 | 1676 | ||
1682 | /* refuse to confuse usbcore */ | 1677 | /* refuse to confuse usbcore */ |
1683 | if (dev->dma_mask) { | 1678 | if (dev->dev.dma_mask) { |
1684 | DBG("no we won't dma\n"); | 1679 | DBG("no we won't dma\n"); |
1685 | return -EINVAL; | 1680 | return -EINVAL; |
1686 | } | 1681 | } |
1687 | 1682 | ||
1688 | /* the chip may be wired for either kind of addressing */ | 1683 | /* the chip may be wired for either kind of addressing */ |
1689 | addr = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1684 | addr = platform_get_resource(dev, IORESOURCE_MEM, 0); |
1690 | data = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 1685 | data = platform_get_resource(dev, IORESOURCE_MEM, 1); |
1691 | retval = -EBUSY; | 1686 | retval = -EBUSY; |
1692 | if (!addr || !data) { | 1687 | if (!addr || !data) { |
1693 | addr = platform_get_resource(pdev, IORESOURCE_IO, 0); | 1688 | addr = platform_get_resource(dev, IORESOURCE_IO, 0); |
1694 | data = platform_get_resource(pdev, IORESOURCE_IO, 1); | 1689 | data = platform_get_resource(dev, IORESOURCE_IO, 1); |
1695 | if (!addr || !data) | 1690 | if (!addr || !data) |
1696 | return -ENODEV; | 1691 | return -ENODEV; |
1697 | ioaddr = 1; | 1692 | ioaddr = 1; |
@@ -1713,7 +1708,7 @@ sl811h_probe(struct device *dev) | |||
1713 | } | 1708 | } |
1714 | 1709 | ||
1715 | /* allocate and initialize hcd */ | 1710 | /* allocate and initialize hcd */ |
1716 | hcd = usb_create_hcd(&sl811h_hc_driver, dev, dev->bus_id); | 1711 | hcd = usb_create_hcd(&sl811h_hc_driver, &dev->dev, dev->dev.bus_id); |
1717 | if (!hcd) { | 1712 | if (!hcd) { |
1718 | retval = -ENOMEM; | 1713 | retval = -ENOMEM; |
1719 | goto err5; | 1714 | goto err5; |
@@ -1723,7 +1718,7 @@ sl811h_probe(struct device *dev) | |||
1723 | 1718 | ||
1724 | spin_lock_init(&sl811->lock); | 1719 | spin_lock_init(&sl811->lock); |
1725 | INIT_LIST_HEAD(&sl811->async); | 1720 | INIT_LIST_HEAD(&sl811->async); |
1726 | sl811->board = dev->platform_data; | 1721 | sl811->board = dev->dev.platform_data; |
1727 | init_timer(&sl811->timer); | 1722 | init_timer(&sl811->timer); |
1728 | sl811->timer.function = sl811h_timer; | 1723 | sl811->timer.function = sl811h_timer; |
1729 | sl811->timer.data = (unsigned long) sl811; | 1724 | sl811->timer.data = (unsigned long) sl811; |
@@ -1785,9 +1780,9 @@ sl811h_probe(struct device *dev) | |||
1785 | */ | 1780 | */ |
1786 | 1781 | ||
1787 | static int | 1782 | static int |
1788 | sl811h_suspend(struct device *dev, pm_message_t state) | 1783 | sl811h_suspend(struct platform_device *dev, pm_message_t state) |
1789 | { | 1784 | { |
1790 | struct usb_hcd *hcd = dev_get_drvdata(dev); | 1785 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
1791 | struct sl811 *sl811 = hcd_to_sl811(hcd); | 1786 | struct sl811 *sl811 = hcd_to_sl811(hcd); |
1792 | int retval = 0; | 1787 | int retval = 0; |
1793 | 1788 | ||
@@ -1796,27 +1791,27 @@ sl811h_suspend(struct device *dev, pm_message_t state) | |||
1796 | else if (state.event == PM_EVENT_SUSPEND) | 1791 | else if (state.event == PM_EVENT_SUSPEND) |
1797 | port_power(sl811, 0); | 1792 | port_power(sl811, 0); |
1798 | if (retval == 0) | 1793 | if (retval == 0) |
1799 | dev->power.power_state = state; | 1794 | dev->dev.power.power_state = state; |
1800 | return retval; | 1795 | return retval; |
1801 | } | 1796 | } |
1802 | 1797 | ||
1803 | static int | 1798 | static int |
1804 | sl811h_resume(struct device *dev) | 1799 | sl811h_resume(struct platform_device *dev) |
1805 | { | 1800 | { |
1806 | struct usb_hcd *hcd = dev_get_drvdata(dev); | 1801 | struct usb_hcd *hcd = platform_get_drvdata(dev); |
1807 | struct sl811 *sl811 = hcd_to_sl811(hcd); | 1802 | struct sl811 *sl811 = hcd_to_sl811(hcd); |
1808 | 1803 | ||
1809 | /* with no "check to see if VBUS is still powered" board hook, | 1804 | /* with no "check to see if VBUS is still powered" board hook, |
1810 | * let's assume it'd only be powered to enable remote wakeup. | 1805 | * let's assume it'd only be powered to enable remote wakeup. |
1811 | */ | 1806 | */ |
1812 | if (dev->power.power_state.event == PM_EVENT_SUSPEND | 1807 | if (dev->dev.power.power_state.event == PM_EVENT_SUSPEND |
1813 | || !hcd->can_wakeup) { | 1808 | || !hcd->can_wakeup) { |
1814 | sl811->port1 = 0; | 1809 | sl811->port1 = 0; |
1815 | port_power(sl811, 1); | 1810 | port_power(sl811, 1); |
1816 | return 0; | 1811 | return 0; |
1817 | } | 1812 | } |
1818 | 1813 | ||
1819 | dev->power.power_state = PMSG_ON; | 1814 | dev->dev.power.power_state = PMSG_ON; |
1820 | return sl811h_bus_resume(hcd); | 1815 | return sl811h_bus_resume(hcd); |
1821 | } | 1816 | } |
1822 | 1817 | ||
@@ -1829,16 +1824,16 @@ sl811h_resume(struct device *dev) | |||
1829 | 1824 | ||
1830 | 1825 | ||
1831 | /* this driver is exported so sl811_cs can depend on it */ | 1826 | /* this driver is exported so sl811_cs can depend on it */ |
1832 | struct device_driver sl811h_driver = { | 1827 | struct platform_driver sl811h_driver = { |
1833 | .name = (char *) hcd_name, | ||
1834 | .bus = &platform_bus_type, | ||
1835 | .owner = THIS_MODULE, | ||
1836 | |||
1837 | .probe = sl811h_probe, | 1828 | .probe = sl811h_probe, |
1838 | .remove = __devexit_p(sl811h_remove), | 1829 | .remove = __devexit_p(sl811h_remove), |
1839 | 1830 | ||
1840 | .suspend = sl811h_suspend, | 1831 | .suspend = sl811h_suspend, |
1841 | .resume = sl811h_resume, | 1832 | .resume = sl811h_resume, |
1833 | .driver = { | ||
1834 | .name = (char *) hcd_name, | ||
1835 | .owner = THIS_MODULE, | ||
1836 | }, | ||
1842 | }; | 1837 | }; |
1843 | EXPORT_SYMBOL(sl811h_driver); | 1838 | EXPORT_SYMBOL(sl811h_driver); |
1844 | 1839 | ||
@@ -1850,12 +1845,12 @@ static int __init sl811h_init(void) | |||
1850 | return -ENODEV; | 1845 | return -ENODEV; |
1851 | 1846 | ||
1852 | INFO("driver %s, %s\n", hcd_name, DRIVER_VERSION); | 1847 | INFO("driver %s, %s\n", hcd_name, DRIVER_VERSION); |
1853 | return driver_register(&sl811h_driver); | 1848 | return platform_driver_register(&sl811h_driver); |
1854 | } | 1849 | } |
1855 | module_init(sl811h_init); | 1850 | module_init(sl811h_init); |
1856 | 1851 | ||
1857 | static void __exit sl811h_cleanup(void) | 1852 | static void __exit sl811h_cleanup(void) |
1858 | { | 1853 | { |
1859 | driver_unregister(&sl811h_driver); | 1854 | platform_driver_unregister(&sl811h_driver); |
1860 | } | 1855 | } |
1861 | module_exit(sl811h_cleanup); | 1856 | module_exit(sl811h_cleanup); |