提交 73720775 编写于 作者: S Stefan Agner 提交者: Linus Walleij

pinctrl: imx7d: simplify imx7d_pinctrl_probe

Using of_device_get_match_data in imx7d_pinctrl_probe simplifies
the function. Also get rid of the void pointer cast since
imx_pinctrl_probe now accepts const struct imx_pinctrl_soc_info.

Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: NStefan Agner <stefan@agner.ch>
Acked-by: NDong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 f5843492
...@@ -378,16 +378,12 @@ static const struct of_device_id imx7d_pinctrl_of_match[] = { ...@@ -378,16 +378,12 @@ static const struct of_device_id imx7d_pinctrl_of_match[] = {
static int imx7d_pinctrl_probe(struct platform_device *pdev) static int imx7d_pinctrl_probe(struct platform_device *pdev)
{ {
const struct of_device_id *match; const struct imx_pinctrl_soc_info *pinctrl_info;
struct imx_pinctrl_soc_info *pinctrl_info;
match = of_match_device(imx7d_pinctrl_of_match, &pdev->dev); pinctrl_info = of_device_get_match_data(&pdev->dev);
if (!pinctrl_info)
if (!match)
return -ENODEV; return -ENODEV;
pinctrl_info = (struct imx_pinctrl_soc_info *) match->data;
return imx_pinctrl_probe(pdev, pinctrl_info); return imx_pinctrl_probe(pdev, pinctrl_info);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册