Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Alan Stern and committed by
Greg Kroah-Hartman
8364d6b0 a4f81a61

+25 -25
+25 -25
drivers/usb/gadget/dummy_hcd.c
··· 896 896 #endif 897 897 } 898 898 899 - static int dummy_udc_probe (struct platform_device *dev) 899 + static int dummy_udc_probe (struct platform_device *pdev) 900 900 { 901 901 struct dummy *dum = the_controller; 902 902 int rc; ··· 909 909 dum->gadget.is_otg = (dummy_to_hcd(dum)->self.otg_port != 0); 910 910 911 911 strcpy (dum->gadget.dev.bus_id, "gadget"); 912 - dum->gadget.dev.parent = &dev->dev; 912 + dum->gadget.dev.parent = &pdev->dev; 913 913 dum->gadget.dev.release = dummy_gadget_release; 914 914 rc = device_register (&dum->gadget.dev); 915 915 if (rc < 0) ··· 919 919 usb_bus_get (&dummy_to_hcd (dum)->self); 920 920 #endif 921 921 922 - platform_set_drvdata (dev, dum); 922 + platform_set_drvdata (pdev, dum); 923 923 device_create_file (&dum->gadget.dev, &dev_attr_function); 924 924 return rc; 925 925 } 926 926 927 - static int dummy_udc_remove (struct platform_device *dev) 927 + static 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 932 device_remove_file (&dum->gadget.dev, &dev_attr_function); 933 933 device_unregister (&dum->gadget.dev); 934 934 return 0; 935 935 } 936 936 937 - static int dummy_udc_suspend (struct platform_device *dev, pm_message_t state) 937 + static 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 942 spin_lock_irq (&dum->lock); 943 943 dum->udc_suspended = 1; 944 944 set_link_state (dum); 945 945 spin_unlock_irq (&dum->lock); 946 946 947 - dev->dev.power.power_state = state; 947 + pdev->dev.power.power_state = state; 948 948 usb_hcd_poll_rh_status (dummy_to_hcd (dum)); 949 949 return 0; 950 950 } 951 951 952 - static int dummy_udc_resume (struct platform_device *dev) 952 + static 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 957 spin_lock_irq (&dum->lock); 958 958 dum->udc_suspended = 0; 959 959 set_link_state (dum); 960 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 963 usb_hcd_poll_rh_status (dummy_to_hcd (dum)); 964 964 return 0; 965 965 } ··· 1899 1899 .bus_resume = dummy_bus_resume, 1900 1900 }; 1901 1901 1902 - static int dummy_hcd_probe (struct platform_device *dev) 1902 + static int dummy_hcd_probe(struct platform_device *pdev) 1903 1903 { 1904 1904 struct usb_hcd *hcd; 1905 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 1910 if (!hcd) 1911 1911 return -ENOMEM; 1912 1912 the_controller = hcd_to_dummy (hcd); ··· 1919 1919 return retval; 1920 1920 } 1921 1921 1922 - static int dummy_hcd_remove (struct platform_device *dev) 1922 + static int dummy_hcd_remove (struct platform_device *pdev) 1923 1923 { 1924 1924 struct usb_hcd *hcd; 1925 1925 1926 - hcd = platform_get_drvdata (dev); 1926 + hcd = platform_get_drvdata (pdev); 1927 1927 usb_remove_hcd (hcd); 1928 1928 usb_put_hcd (hcd); 1929 1929 the_controller = NULL; 1930 1930 return 0; 1931 1931 } 1932 1932 1933 - static int dummy_hcd_suspend (struct platform_device *dev, pm_message_t state) 1933 + static int dummy_hcd_suspend (struct platform_device *pdev, pm_message_t state) 1934 1934 { 1935 1935 struct usb_hcd *hcd; 1936 1936 1937 - dev_dbg (&dev->dev, "%s\n", __FUNCTION__); 1938 - hcd = platform_get_drvdata (dev); 1937 + dev_dbg (&pdev->dev, "%s\n", __FUNCTION__); 1938 + hcd = platform_get_drvdata (pdev); 1939 1939 1940 1940 hcd->state = HC_STATE_SUSPENDED; 1941 1941 return 0; 1942 1942 } 1943 1943 1944 - static int dummy_hcd_resume (struct platform_device *dev) 1944 + static int dummy_hcd_resume (struct platform_device *pdev) 1945 1945 { 1946 1946 struct usb_hcd *hcd; 1947 1947 1948 - dev_dbg (&dev->dev, "%s\n", __FUNCTION__); 1949 - hcd = platform_get_drvdata (dev); 1948 + dev_dbg (&pdev->dev, "%s\n", __FUNCTION__); 1949 + hcd = platform_get_drvdata (pdev); 1950 1950 hcd->state = HC_STATE_RUNNING; 1951 1951 1952 1952 usb_hcd_poll_rh_status (hcd);