提交 21b90b3b 编写于 作者: A Anson Huang 提交者: Xie XiuQi

gpio: mxc: add check to return defer probe if clock tree NOT ready

commit a329bbe707cee2cf8c660890ef2ad0d00ec7e8a3 upstream.

On i.MX8MQ platform, clock driver uses platform driver
model and it is probed after GPIO driver, so when GPIO
driver fails to get clock, it should check the error type
to decide whether to return defer probe or just ignore
the clock operation.

Fixes: 2808801a ("gpio: mxc: add clock operation")
Signed-off-by: NAnson Huang <Anson.Huang@nxp.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 1b5da5a6
...@@ -438,8 +438,11 @@ static int mxc_gpio_probe(struct platform_device *pdev) ...@@ -438,8 +438,11 @@ static int mxc_gpio_probe(struct platform_device *pdev)
/* the controller clock is optional */ /* the controller clock is optional */
port->clk = devm_clk_get(&pdev->dev, NULL); port->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(port->clk)) if (IS_ERR(port->clk)) {
if (PTR_ERR(port->clk) == -EPROBE_DEFER)
return -EPROBE_DEFER;
port->clk = NULL; port->clk = NULL;
}
err = clk_prepare_enable(port->clk); err = clk_prepare_enable(port->clk);
if (err) { if (err) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册