Commit 59b7c6a8 authored by Fabio Estevam's avatar Fabio Estevam Committed by Peter Chen

usb: chipidea: ci_hdrc_imx: Use of_device_get_match_data()

The retrieval of driver data via of_device_get_match_data() can make
the code simpler.

Use of_device_get_match_data() to simplify the code.
Signed-off-by: default avatarFabio Estevam <festevam@gmail.com>
Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
parent 58bcafec
...@@ -319,16 +319,11 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) ...@@ -319,16 +319,11 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
.notify_event = ci_hdrc_imx_notify_event, .notify_event = ci_hdrc_imx_notify_event,
}; };
int ret; int ret;
const struct of_device_id *of_id;
const struct ci_hdrc_imx_platform_flag *imx_platform_flag; const struct ci_hdrc_imx_platform_flag *imx_platform_flag;
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
of_id = of_match_device(ci_hdrc_imx_dt_ids, dev); imx_platform_flag = of_device_get_match_data(&pdev->dev);
if (!of_id)
return -ENODEV;
imx_platform_flag = of_id->data;
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
if (!data) if (!data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment