summaryrefslogtreecommitdiffstats
path: root/drivers/usb/renesas_usbhs
diff options
context:
space:
mode:
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>2019-06-25 07:38:51 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-26 04:33:08 +0200
commit31e795c61d60f7044e5e39eb94f4c5cfcb94108f (patch)
tree0d569ce78bff14a36424503229d022788ee0d1c7 /drivers/usb/renesas_usbhs
parentusb: renesas_usbhs: Remove type member from renesas_usbhs_driver_param (diff)
downloadlinux-31e795c61d60f7044e5e39eb94f4c5cfcb94108f.tar.xz
linux-31e795c61d60f7044e5e39eb94f4c5cfcb94108f.zip
usb: renesas_usbhs: Use dev_of_node macro instead of open coded
This patch uses the dev_of_node macro instead of open coded to be better. Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/renesas_usbhs')
-rw-r--r--drivers/usb/renesas_usbhs/common.c14
-rw-r--r--drivers/usb/renesas_usbhs/fifo.c3
2 files changed, 9 insertions, 8 deletions
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index 18727561fa65..35b06e7d4eb4 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -297,7 +297,7 @@ static int usbhsc_clk_get(struct device *dev, struct usbhs_priv *priv)
return 0;
/* The first clock should exist */
- priv->clks[0] = of_clk_get(dev->of_node, 0);
+ priv->clks[0] = of_clk_get(dev_of_node(dev), 0);
if (IS_ERR(priv->clks[0]))
return PTR_ERR(priv->clks[0]);
@@ -305,7 +305,7 @@ static int usbhsc_clk_get(struct device *dev, struct usbhs_priv *priv)
* To backward compatibility with old DT, this driver checks the return
* value if it's -ENOENT or not.
*/
- priv->clks[1] = of_clk_get(dev->of_node, 1);
+ priv->clks[1] = of_clk_get(dev_of_node(dev), 1);
if (PTR_ERR(priv->clks[1]) == -ENOENT)
priv->clks[1] = NULL;
else if (IS_ERR(priv->clks[1]))
@@ -648,10 +648,10 @@ static struct renesas_usbhs_platform_info *usbhs_parse_dt(struct device *dev)
*dparam = data->param;
info->platform_callback = *data->platform_callback;
- if (!of_property_read_u32(dev->of_node, "renesas,buswait", &tmp))
+ if (!of_property_read_u32(dev_of_node(dev), "renesas,buswait", &tmp))
dparam->buswait_bwait = tmp;
- gpio = of_get_named_gpio_flags(dev->of_node, "renesas,enable-gpio", 0,
- NULL);
+ gpio = of_get_named_gpio_flags(dev_of_node(dev), "renesas,enable-gpio",
+ 0, NULL);
if (gpio > 0)
dparam->enable_gpio = gpio;
@@ -666,7 +666,7 @@ static int usbhs_probe(struct platform_device *pdev)
int ret;
/* check device node */
- if (pdev->dev.of_node)
+ if (dev_of_node(&pdev->dev))
info = pdev->dev.platform_data = usbhs_parse_dt(&pdev->dev);
/* check platform information */
@@ -692,7 +692,7 @@ static int usbhs_probe(struct platform_device *pdev)
if (IS_ERR(priv->base))
return PTR_ERR(priv->base);
- if (of_property_read_bool(pdev->dev.of_node, "extcon")) {
+ if (of_property_read_bool(dev_of_node(&pdev->dev), "extcon")) {
priv->edev = extcon_get_edev_by_phandle(&pdev->dev, 0);
if (IS_ERR(priv->edev))
return PTR_ERR(priv->edev);
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index e84d2ac2a30a..a345b2ef976e 100644
--- a/drivers/usb/renesas_usbhs/fifo.c
+++ b/drivers/usb/renesas_usbhs/fifo.c
@@ -3,6 +3,7 @@
* Renesas USB driver
*
* Copyright (C) 2011 Renesas Solutions Corp.
+ * Copyright (C) 2019 Renesas Electronics Corporation
* Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
*/
#include <linux/delay.h>
@@ -1277,7 +1278,7 @@ static void usbhsf_dma_init(struct usbhs_priv *priv, struct usbhs_fifo *fifo,
{
struct device *dev = usbhs_priv_to_dev(priv);
- if (dev->of_node)
+ if (dev_of_node(dev))
usbhsf_dma_init_dt(dev, fifo, channel);
else
usbhsf_dma_init_pdev(fifo);