diff options
author | Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> | 2019-06-25 01:38:51 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-06-25 22:33:08 -0400 |
commit | 31e795c61d60f7044e5e39eb94f4c5cfcb94108f (patch) | |
tree | 0d569ce78bff14a36424503229d022788ee0d1c7 | |
parent | a4027b409fa98dc47418dacd3dcb5c99c5a76e4d (diff) |
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>
-rw-r--r-- | drivers/usb/renesas_usbhs/common.c | 14 | ||||
-rw-r--r-- | drivers/usb/renesas_usbhs/fifo.c | 3 |
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) | |||
297 | return 0; | 297 | return 0; |
298 | 298 | ||
299 | /* The first clock should exist */ | 299 | /* The first clock should exist */ |
300 | priv->clks[0] = of_clk_get(dev->of_node, 0); | 300 | priv->clks[0] = of_clk_get(dev_of_node(dev), 0); |
301 | if (IS_ERR(priv->clks[0])) | 301 | if (IS_ERR(priv->clks[0])) |
302 | return PTR_ERR(priv->clks[0]); | 302 | return PTR_ERR(priv->clks[0]); |
303 | 303 | ||
@@ -305,7 +305,7 @@ static int usbhsc_clk_get(struct device *dev, struct usbhs_priv *priv) | |||
305 | * To backward compatibility with old DT, this driver checks the return | 305 | * To backward compatibility with old DT, this driver checks the return |
306 | * value if it's -ENOENT or not. | 306 | * value if it's -ENOENT or not. |
307 | */ | 307 | */ |
308 | priv->clks[1] = of_clk_get(dev->of_node, 1); | 308 | priv->clks[1] = of_clk_get(dev_of_node(dev), 1); |
309 | if (PTR_ERR(priv->clks[1]) == -ENOENT) | 309 | if (PTR_ERR(priv->clks[1]) == -ENOENT) |
310 | priv->clks[1] = NULL; | 310 | priv->clks[1] = NULL; |
311 | else if (IS_ERR(priv->clks[1])) | 311 | else if (IS_ERR(priv->clks[1])) |
@@ -648,10 +648,10 @@ static struct renesas_usbhs_platform_info *usbhs_parse_dt(struct device *dev) | |||
648 | *dparam = data->param; | 648 | *dparam = data->param; |
649 | info->platform_callback = *data->platform_callback; | 649 | info->platform_callback = *data->platform_callback; |
650 | 650 | ||
651 | if (!of_property_read_u32(dev->of_node, "renesas,buswait", &tmp)) | 651 | if (!of_property_read_u32(dev_of_node(dev), "renesas,buswait", &tmp)) |
652 | dparam->buswait_bwait = tmp; | 652 | dparam->buswait_bwait = tmp; |
653 | gpio = of_get_named_gpio_flags(dev->of_node, "renesas,enable-gpio", 0, | 653 | gpio = of_get_named_gpio_flags(dev_of_node(dev), "renesas,enable-gpio", |
654 | NULL); | 654 | 0, NULL); |
655 | if (gpio > 0) | 655 | if (gpio > 0) |
656 | dparam->enable_gpio = gpio; | 656 | dparam->enable_gpio = gpio; |
657 | 657 | ||
@@ -666,7 +666,7 @@ static int usbhs_probe(struct platform_device *pdev) | |||
666 | int ret; | 666 | int ret; |
667 | 667 | ||
668 | /* check device node */ | 668 | /* check device node */ |
669 | if (pdev->dev.of_node) | 669 | if (dev_of_node(&pdev->dev)) |
670 | info = pdev->dev.platform_data = usbhs_parse_dt(&pdev->dev); | 670 | info = pdev->dev.platform_data = usbhs_parse_dt(&pdev->dev); |
671 | 671 | ||
672 | /* check platform information */ | 672 | /* check platform information */ |
@@ -692,7 +692,7 @@ static int usbhs_probe(struct platform_device *pdev) | |||
692 | if (IS_ERR(priv->base)) | 692 | if (IS_ERR(priv->base)) |
693 | return PTR_ERR(priv->base); | 693 | return PTR_ERR(priv->base); |
694 | 694 | ||
695 | if (of_property_read_bool(pdev->dev.of_node, "extcon")) { | 695 | if (of_property_read_bool(dev_of_node(&pdev->dev), "extcon")) { |
696 | priv->edev = extcon_get_edev_by_phandle(&pdev->dev, 0); | 696 | priv->edev = extcon_get_edev_by_phandle(&pdev->dev, 0); |
697 | if (IS_ERR(priv->edev)) | 697 | if (IS_ERR(priv->edev)) |
698 | return PTR_ERR(priv->edev); | 698 | 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 @@ | |||
3 | * Renesas USB driver | 3 | * Renesas USB driver |
4 | * | 4 | * |
5 | * Copyright (C) 2011 Renesas Solutions Corp. | 5 | * Copyright (C) 2011 Renesas Solutions Corp. |
6 | * Copyright (C) 2019 Renesas Electronics Corporation | ||
6 | * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 7 | * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> |
7 | */ | 8 | */ |
8 | #include <linux/delay.h> | 9 | #include <linux/delay.h> |
@@ -1277,7 +1278,7 @@ static void usbhsf_dma_init(struct usbhs_priv *priv, struct usbhs_fifo *fifo, | |||
1277 | { | 1278 | { |
1278 | struct device *dev = usbhs_priv_to_dev(priv); | 1279 | struct device *dev = usbhs_priv_to_dev(priv); |
1279 | 1280 | ||
1280 | if (dev->of_node) | 1281 | if (dev_of_node(dev)) |
1281 | usbhsf_dma_init_dt(dev, fifo, channel); | 1282 | usbhsf_dma_init_dt(dev, fifo, channel); |
1282 | else | 1283 | else |
1283 | usbhsf_dma_init_pdev(fifo); | 1284 | usbhsf_dma_init_pdev(fifo); |