aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2005-11-14 12:16:30 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-04 16:48:31 -0500
commit8364d6b0be2dbbf162c6aea79615b5025a0d67c2 (patch)
treef7511fe4a6b7ee39d4e8126712a7112dd1e2659a /drivers/usb
parenta4f81a61ebba5953cba1e76f66423a7eca4a5ee4 (diff)
[PATCH] USB: dummy_hcd: rename variables
The recent platform_device update has reintroduced into dummy_hcd.c the dreaded dev->dev syndrome. This harkens back to when an earlier version of that driver included the unforgettable line: dev->dev.dev.driver_data = dev; This patch (as602) renames the platform_device variables to "pdev", in the hope of reducing confusion. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/dummy_hcd.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index c655d46c8aed..4932b07b316d 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
899static int dummy_udc_probe (struct platform_device *dev) 899static int dummy_udc_probe (struct platform_device *pdev)
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 platform_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->dev; 912 dum->gadget.dev.parent = &pdev->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,47 +919,47 @@ static int dummy_udc_probe (struct platform_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 platform_set_drvdata (dev, dum); 922 platform_set_drvdata (pdev, 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
927static int dummy_udc_remove (struct platform_device *dev) 927static int dummy_udc_remove (struct platform_device *pdev)
928{ 928{
929 struct dummy *dum = platform_get_drvdata (dev); 929 struct dummy *dum = platform_get_drvdata (pdev);
930 930
931 platform_set_drvdata (dev, NULL); 931 platform_set_drvdata (pdev, 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
937static int dummy_udc_suspend (struct platform_device *dev, pm_message_t state) 937static int dummy_udc_suspend (struct platform_device *pdev, pm_message_t state)
938{ 938{
939 struct dummy *dum = platform_get_drvdata(dev); 939 struct dummy *dum = platform_get_drvdata(pdev);
940 940
941 dev_dbg (&dev->dev, "%s\n", __FUNCTION__); 941 dev_dbg (&pdev->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);
945 spin_unlock_irq (&dum->lock); 945 spin_unlock_irq (&dum->lock);
946 946
947 dev->dev.power.power_state = state; 947 pdev->dev.power.power_state = state;
948 usb_hcd_poll_rh_status (dummy_to_hcd (dum)); 948 usb_hcd_poll_rh_status (dummy_to_hcd (dum));
949 return 0; 949 return 0;
950} 950}
951 951
952static int dummy_udc_resume (struct platform_device *dev) 952static int dummy_udc_resume (struct platform_device *pdev)
953{ 953{
954 struct dummy *dum = platform_get_drvdata(dev); 954 struct dummy *dum = platform_get_drvdata(pdev);
955 955
956 dev_dbg (&dev->dev, "%s\n", __FUNCTION__); 956 dev_dbg (&pdev->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->dev.power.power_state = PMSG_ON; 962 pdev->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}
@@ -1899,14 +1899,14 @@ static const struct hc_driver dummy_hcd = {
1899 .bus_resume = dummy_bus_resume, 1899 .bus_resume = dummy_bus_resume,
1900}; 1900};
1901 1901
1902static int dummy_hcd_probe (struct platform_device *dev) 1902static int dummy_hcd_probe(struct platform_device *pdev)
1903{ 1903{
1904 struct usb_hcd *hcd; 1904 struct usb_hcd *hcd;
1905 int retval; 1905 int retval;
1906 1906
1907 dev_info(&dev->dev, "%s, driver " DRIVER_VERSION "\n", driver_desc); 1907 dev_info(&pdev->dev, "%s, driver " DRIVER_VERSION "\n", driver_desc);
1908 1908
1909 hcd = usb_create_hcd (&dummy_hcd, &dev->dev, dev->dev.bus_id); 1909 hcd = usb_create_hcd(&dummy_hcd, &pdev->dev, pdev->dev.bus_id);
1910 if (!hcd) 1910 if (!hcd)
1911 return -ENOMEM; 1911 return -ENOMEM;
1912 the_controller = hcd_to_dummy (hcd); 1912 the_controller = hcd_to_dummy (hcd);
@@ -1919,34 +1919,34 @@ static int dummy_hcd_probe (struct platform_device *dev)
1919 return retval; 1919 return retval;
1920} 1920}
1921 1921
1922static int dummy_hcd_remove (struct platform_device *dev) 1922static int dummy_hcd_remove (struct platform_device *pdev)
1923{ 1923{
1924 struct usb_hcd *hcd; 1924 struct usb_hcd *hcd;
1925 1925
1926 hcd = platform_get_drvdata (dev); 1926 hcd = platform_get_drvdata (pdev);
1927 usb_remove_hcd (hcd); 1927 usb_remove_hcd (hcd);
1928 usb_put_hcd (hcd); 1928 usb_put_hcd (hcd);
1929 the_controller = NULL; 1929 the_controller = NULL;
1930 return 0; 1930 return 0;
1931} 1931}
1932 1932
1933static int dummy_hcd_suspend (struct platform_device *dev, pm_message_t state) 1933static int dummy_hcd_suspend (struct platform_device *pdev, pm_message_t state)
1934{ 1934{
1935 struct usb_hcd *hcd; 1935 struct usb_hcd *hcd;
1936 1936
1937 dev_dbg (&dev->dev, "%s\n", __FUNCTION__); 1937 dev_dbg (&pdev->dev, "%s\n", __FUNCTION__);
1938 hcd = platform_get_drvdata (dev); 1938 hcd = platform_get_drvdata (pdev);
1939 1939
1940 hcd->state = HC_STATE_SUSPENDED; 1940 hcd->state = HC_STATE_SUSPENDED;
1941 return 0; 1941 return 0;
1942} 1942}
1943 1943
1944static int dummy_hcd_resume (struct platform_device *dev) 1944static int dummy_hcd_resume (struct platform_device *pdev)
1945{ 1945{
1946 struct usb_hcd *hcd; 1946 struct usb_hcd *hcd;
1947 1947
1948 dev_dbg (&dev->dev, "%s\n", __FUNCTION__); 1948 dev_dbg (&pdev->dev, "%s\n", __FUNCTION__);
1949 hcd = platform_get_drvdata (dev); 1949 hcd = platform_get_drvdata (pdev);
1950 hcd->state = HC_STATE_RUNNING; 1950 hcd->state = HC_STATE_RUNNING;
1951 1951
1952 usb_hcd_poll_rh_status (hcd); 1952 usb_hcd_poll_rh_status (hcd);