aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/chipidea/ci_hdrc_imx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/chipidea/ci_hdrc_imx.c')
-rw-r--r--drivers/usb/chipidea/ci_hdrc_imx.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index 65444b02bd68..a7ab0f15926e 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -54,6 +54,7 @@ struct ci_hdrc_imx_data {
54 54
55static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev) 55static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev)
56{ 56{
57 struct platform_device *misc_pdev;
57 struct device_node *np = dev->of_node; 58 struct device_node *np = dev->of_node;
58 struct of_phandle_args args; 59 struct of_phandle_args args;
59 struct imx_usbmisc_data *data; 60 struct imx_usbmisc_data *data;
@@ -79,8 +80,15 @@ static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev)
79 } 80 }
80 81
81 data->index = args.args[0]; 82 data->index = args.args[0];
83
84 misc_pdev = of_find_device_by_node(args.np);
82 of_node_put(args.np); 85 of_node_put(args.np);
83 86
87 if (!misc_pdev)
88 return ERR_PTR(-EPROBE_DEFER);
89
90 data->dev = &misc_pdev->dev;
91
84 if (of_find_property(np, "disable-over-current", NULL)) 92 if (of_find_property(np, "disable-over-current", NULL))
85 data->disable_oc = 1; 93 data->disable_oc = 1;
86 94