Commit 15518726 authored by Tang Bin's avatar Tang Bin Committed by Greg Kroah-Hartman

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: default avatarZhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: default avatarTang Bin <tangbin@cmss.chinamobile.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20200508144024.7836-1-tangbin@cmss.chinamobile.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 296a193b
...@@ -36,12 +36,12 @@ static const struct ehci_driver_overrides ehci_mxc_overrides __initconst = { ...@@ -36,12 +36,12 @@ static const struct ehci_driver_overrides ehci_mxc_overrides __initconst = {
static int ehci_mxc_drv_probe(struct platform_device *pdev) static int ehci_mxc_drv_probe(struct platform_device *pdev)
{ {
struct mxc_usbh_platform_data *pdata = dev_get_platdata(&pdev->dev); struct device *dev = &pdev->dev;
struct mxc_usbh_platform_data *pdata = dev_get_platdata(dev);
struct usb_hcd *hcd; struct usb_hcd *hcd;
struct resource *res; struct resource *res;
int irq, ret; int irq, ret;
struct ehci_mxc_priv *priv; struct ehci_mxc_priv *priv;
struct device *dev = &pdev->dev;
struct ehci_hcd *ehci; struct ehci_hcd *ehci;
if (!pdata) { if (!pdata) {
...@@ -56,7 +56,7 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) ...@@ -56,7 +56,7 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
hcd->regs = devm_ioremap_resource(&pdev->dev, res); hcd->regs = devm_ioremap_resource(dev, res);
if (IS_ERR(hcd->regs)) { if (IS_ERR(hcd->regs)) {
ret = PTR_ERR(hcd->regs); ret = PTR_ERR(hcd->regs);
goto err_alloc; goto err_alloc;
...@@ -69,14 +69,14 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) ...@@ -69,14 +69,14 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
priv = (struct ehci_mxc_priv *) ehci->priv; priv = (struct ehci_mxc_priv *) ehci->priv;
/* enable clocks */ /* enable clocks */
priv->usbclk = devm_clk_get(&pdev->dev, "ipg"); priv->usbclk = devm_clk_get(dev, "ipg");
if (IS_ERR(priv->usbclk)) { if (IS_ERR(priv->usbclk)) {
ret = PTR_ERR(priv->usbclk); ret = PTR_ERR(priv->usbclk);
goto err_alloc; goto err_alloc;
} }
clk_prepare_enable(priv->usbclk); clk_prepare_enable(priv->usbclk);
priv->ahbclk = devm_clk_get(&pdev->dev, "ahb"); priv->ahbclk = devm_clk_get(dev, "ahb");
if (IS_ERR(priv->ahbclk)) { if (IS_ERR(priv->ahbclk)) {
ret = PTR_ERR(priv->ahbclk); ret = PTR_ERR(priv->ahbclk);
goto err_clk_ahb; goto err_clk_ahb;
...@@ -84,13 +84,12 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) ...@@ -84,13 +84,12 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
clk_prepare_enable(priv->ahbclk); clk_prepare_enable(priv->ahbclk);
/* "dr" device has its own clock on i.MX51 */ /* "dr" device has its own clock on i.MX51 */
priv->phyclk = devm_clk_get(&pdev->dev, "phy"); priv->phyclk = devm_clk_get(dev, "phy");
if (IS_ERR(priv->phyclk)) if (IS_ERR(priv->phyclk))
priv->phyclk = NULL; priv->phyclk = NULL;
if (priv->phyclk) if (priv->phyclk)
clk_prepare_enable(priv->phyclk); clk_prepare_enable(priv->phyclk);
/* call platform specific init function */ /* call platform specific init function */
if (pdata->init) { if (pdata->init) {
ret = pdata->init(pdev); ret = pdata->init(pdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment