summaryrefslogtreecommitdiffstats
path: root/drivers/usb/imx/chipidea-imx.c
diff options
context:
space:
mode:
authorSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>2013-06-14 15:36:38 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2013-06-20 21:20:54 +0200
commit511ba46157d88ebb291233d1c4394568884327ae (patch)
tree6a08d0d2f11684a5387718b74aef4c7f1b5003ef /drivers/usb/imx/chipidea-imx.c
parent083995f8157b132646f79f0177063a33357f262c (diff)
downloadbarebox-511ba46157d88ebb291233d1c4394568884327ae.tar.gz
barebox-511ba46157d88ebb291233d1c4394568884327ae.tar.xz
OF: base: import parse phandle functions from Linux OF API
This imports of_parse_phandle_with_args and of_count_phandle_with_args from Linux OF API. The slightly different of_parse_phandles_with_args is removed and all users are converted to reflect the API change. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Diffstat (limited to 'drivers/usb/imx/chipidea-imx.c')
-rw-r--r--drivers/usb/imx/chipidea-imx.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c
index c552b4e324..20066499bf 100644
--- a/drivers/usb/imx/chipidea-imx.c
+++ b/drivers/usb/imx/chipidea-imx.c
@@ -62,16 +62,15 @@ static int imx_chipidea_port_post_init(void *drvdata)
static int imx_chipidea_probe_dt(struct imx_chipidea *ci)
{
- const void *out_args;
- struct device_node *usbmisc_np;
+ struct of_phandle_args out_args;
enum usb_dr_mode mode;
enum usb_phy_interface phymode;
- of_parse_phandles_with_args(ci->dev->device_node, "fsl,usbmisc",
- "#index-cells", 0, &usbmisc_np, &out_args);
-
- ci->portno = be32_to_cpup(out_args);
+ if (of_parse_phandle_with_args(ci->dev->device_node, "fsl,usbmisc",
+ "#index-cells", 0, &out_args))
+ return -ENODEV;
+ ci->portno = out_args.args[0];
ci->flags = MXC_EHCI_MODE_UTMI_8BIT;
mode = of_usb_get_dr_mode(ci->dev->device_node, NULL);