Skip to content

Commit 1551872

Browse files
Tang Bingregkh
authored andcommitted
USB: host: ehci-mxc: Use the defined variable to simplify code
Use the defined variable "dev" to make the code cleaner. And delete an extra blank line. Signed-off-by: Zhang Shengju <[email protected]> Signed-off-by: Tang Bin <[email protected]> Acked-by: Alan Stern <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 296a193 commit 1551872

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/usb/host/ehci-mxc.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ static const struct ehci_driver_overrides ehci_mxc_overrides __initconst = {
3636

3737
static int ehci_mxc_drv_probe(struct platform_device *pdev)
3838
{
39-
struct mxc_usbh_platform_data *pdata = dev_get_platdata(&pdev->dev);
39+
struct device *dev = &pdev->dev;
40+
struct mxc_usbh_platform_data *pdata = dev_get_platdata(dev);
4041
struct usb_hcd *hcd;
4142
struct resource *res;
4243
int irq, ret;
4344
struct ehci_mxc_priv *priv;
44-
struct device *dev = &pdev->dev;
4545
struct ehci_hcd *ehci;
4646

4747
if (!pdata) {
@@ -56,7 +56,7 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
5656
return -ENOMEM;
5757

5858
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
59-
hcd->regs = devm_ioremap_resource(&pdev->dev, res);
59+
hcd->regs = devm_ioremap_resource(dev, res);
6060
if (IS_ERR(hcd->regs)) {
6161
ret = PTR_ERR(hcd->regs);
6262
goto err_alloc;
@@ -69,28 +69,27 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
6969
priv = (struct ehci_mxc_priv *) ehci->priv;
7070

7171
/* enable clocks */
72-
priv->usbclk = devm_clk_get(&pdev->dev, "ipg");
72+
priv->usbclk = devm_clk_get(dev, "ipg");
7373
if (IS_ERR(priv->usbclk)) {
7474
ret = PTR_ERR(priv->usbclk);
7575
goto err_alloc;
7676
}
7777
clk_prepare_enable(priv->usbclk);
7878

79-
priv->ahbclk = devm_clk_get(&pdev->dev, "ahb");
79+
priv->ahbclk = devm_clk_get(dev, "ahb");
8080
if (IS_ERR(priv->ahbclk)) {
8181
ret = PTR_ERR(priv->ahbclk);
8282
goto err_clk_ahb;
8383
}
8484
clk_prepare_enable(priv->ahbclk);
8585

8686
/* "dr" device has its own clock on i.MX51 */
87-
priv->phyclk = devm_clk_get(&pdev->dev, "phy");
87+
priv->phyclk = devm_clk_get(dev, "phy");
8888
if (IS_ERR(priv->phyclk))
8989
priv->phyclk = NULL;
9090
if (priv->phyclk)
9191
clk_prepare_enable(priv->phyclk);
9292

93-
9493
/* call platform specific init function */
9594
if (pdata->init) {
9695
ret = pdata->init(pdev);

0 commit comments

Comments
 (0)