gpio: mxc: Use devm_clk_get_optional instead of devm_clk_get
i.MX SoC's GPIO clock is optional, so it is better to use devm_clk_get_optional instead of devm_clk_get. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
This commit is contained in:
committed by
Bartosz Golaszewski
parent
61059b7048
commit
7beb620f80
@@ -435,12 +435,9 @@ static int mxc_gpio_probe(struct platform_device *pdev)
|
|||||||
return port->irq;
|
return port->irq;
|
||||||
|
|
||||||
/* the controller clock is optional */
|
/* the controller clock is optional */
|
||||||
port->clk = devm_clk_get(&pdev->dev, NULL);
|
port->clk = devm_clk_get_optional(&pdev->dev, NULL);
|
||||||
if (IS_ERR(port->clk)) {
|
if (IS_ERR(port->clk))
|
||||||
if (PTR_ERR(port->clk) == -EPROBE_DEFER)
|
return PTR_ERR(port->clk);
|
||||||
return -EPROBE_DEFER;
|
|
||||||
port->clk = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = clk_prepare_enable(port->clk);
|
err = clk_prepare_enable(port->clk);
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user