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

usb: gadget: gr_udc: improve platform_device variable name

Rename struct platform_device pointers from ofdev to pdev for clarity,
while at that, also use platform_set/get_drvdata() helpers.

Suggested-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>

authored by

Andreas Larsson and committed by
Felipe Balbi
22876266 dca769bd

+9 -9
+9 -9
drivers/usb/gadget/gr_udc.c
··· 2065 2065 return 0; 2066 2066 } 2067 2067 2068 - static int gr_remove(struct platform_device *ofdev) 2068 + static int gr_remove(struct platform_device *pdev) 2069 2069 { 2070 - struct gr_udc *dev = dev_get_drvdata(&ofdev->dev); 2070 + struct gr_udc *dev = platform_get_drvdata(pdev); 2071 2071 2072 2072 if (dev->added) 2073 2073 usb_del_gadget_udc(&dev->gadget); /* Shuts everything down */ ··· 2077 2077 gr_dfs_delete(dev); 2078 2078 if (dev->desc_pool) 2079 2079 dma_pool_destroy(dev->desc_pool); 2080 - dev_set_drvdata(&ofdev->dev, NULL); 2080 + platform_set_drvdata(pdev, NULL); 2081 2081 2082 2082 gr_free_request(&dev->epi[0].ep, &dev->ep0reqi->req); 2083 2083 gr_free_request(&dev->epo[0].ep, &dev->ep0reqo->req); ··· 2090 2090 IRQF_SHARED, driver_name, dev); 2091 2091 } 2092 2092 2093 - static int gr_probe(struct platform_device *ofdev) 2093 + static int gr_probe(struct platform_device *pdev) 2094 2094 { 2095 2095 struct gr_udc *dev; 2096 2096 struct resource *res; ··· 2098 2098 int retval; 2099 2099 u32 status; 2100 2100 2101 - dev = devm_kzalloc(&ofdev->dev, sizeof(*dev), GFP_KERNEL); 2101 + dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); 2102 2102 if (!dev) 2103 2103 return -ENOMEM; 2104 - dev->dev = &ofdev->dev; 2104 + dev->dev = &pdev->dev; 2105 2105 2106 - res = platform_get_resource(ofdev, IORESOURCE_MEM, 0); 2106 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2107 2107 regs = devm_ioremap_resource(dev->dev, res); 2108 2108 if (IS_ERR(regs)) 2109 2109 return PTR_ERR(regs); ··· 2132 2132 spin_lock_init(&dev->lock); 2133 2133 dev->regs = regs; 2134 2134 2135 - dev_set_drvdata(&ofdev->dev, dev); 2135 + platform_set_drvdata(pdev, dev); 2136 2136 2137 2137 /* Determine number of endpoints and data interface mode */ 2138 2138 status = gr_read32(&dev->regs->status); ··· 2204 2204 spin_unlock(&dev->lock); 2205 2205 2206 2206 if (retval) 2207 - gr_remove(ofdev); 2207 + gr_remove(pdev); 2208 2208 2209 2209 return retval; 2210 2210 }