| From 0619363d176d80ae9655a48ac605354787b15c5a Mon Sep 17 00:00:00 2001 |
| From: Geert Uytterhoeven <geert+renesas@glider.be> |
| Date: Thu, 5 Oct 2017 11:21:49 +0300 |
| Subject: [PATCH 0255/1795] usb: host: xhci-plat: Use |
| of_device_get_match_data() helper |
| |
| Use the of_device_get_match_data() helper instead of open coding. |
| |
| Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> |
| Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| (cherry picked from commit 2847d242a1e48ca734cee742efa0f70abf545d1e) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> |
| --- |
| drivers/usb/host/xhci-plat.c | 8 ++++---- |
| 1 file changed, 4 insertions(+), 4 deletions(-) |
| |
| diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c |
| index 5340e4ad8d13..c79d8914f67a 100644 |
| --- a/drivers/usb/host/xhci-plat.c |
| +++ b/drivers/usb/host/xhci-plat.c |
| @@ -17,6 +17,7 @@ |
| #include <linux/module.h> |
| #include <linux/pci.h> |
| #include <linux/of.h> |
| +#include <linux/of_device.h> |
| #include <linux/platform_device.h> |
| #include <linux/usb/phy.h> |
| #include <linux/slab.h> |
| @@ -153,7 +154,7 @@ MODULE_DEVICE_TABLE(of, usb_xhci_of_match); |
| |
| static int xhci_plat_probe(struct platform_device *pdev) |
| { |
| - const struct of_device_id *match; |
| + const struct xhci_plat_priv *priv_match; |
| const struct hc_driver *driver; |
| struct device *sysdev; |
| struct xhci_hcd *xhci; |
| @@ -243,9 +244,8 @@ static int xhci_plat_probe(struct platform_device *pdev) |
| } |
| |
| xhci = hcd_to_xhci(hcd); |
| - match = of_match_node(usb_xhci_of_match, pdev->dev.of_node); |
| - if (match) { |
| - const struct xhci_plat_priv *priv_match = match->data; |
| + priv_match = of_device_get_match_data(&pdev->dev); |
| + if (priv_match) { |
| struct xhci_plat_priv *priv = hcd_to_xhci_priv(hcd); |
| |
| /* Just copy data for now */ |
| -- |
| 2.19.0 |
| |