diff options
author | Anson Huang <Anson.Huang@nxp.com> | 2019-08-01 16:44:39 +0800 |
---|---|---|
committer | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2019-08-02 09:06:13 +0200 |
commit | 7beb620f805dcb6757b5e7870bebd75e3e9b37e0 (patch) | |
tree | 93cf8c3ec69378dcbed308704f63f5c21a0e3eeb /drivers/gpio | |
parent | 61059b7048ee1d635673f3014ea9f7e3e4b1532f (diff) | |
download | linux-7beb620f805dcb6757b5e7870bebd75e3e9b37e0.tar.gz linux-7beb620f805dcb6757b5e7870bebd75e3e9b37e0.tar.bz2 linux-7beb620f805dcb6757b5e7870bebd75e3e9b37e0.zip |
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>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-mxc.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c index b2813580c582..7907a8755866 100644 --- a/drivers/gpio/gpio-mxc.c +++ b/drivers/gpio/gpio-mxc.c @@ -435,12 +435,9 @@ static int mxc_gpio_probe(struct platform_device *pdev) return port->irq; /* the controller clock is optional */ - port->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(port->clk)) { - if (PTR_ERR(port->clk) == -EPROBE_DEFER) - return -EPROBE_DEFER; - port->clk = NULL; - } + port->clk = devm_clk_get_optional(&pdev->dev, NULL); + if (IS_ERR(port->clk)) + return PTR_ERR(port->clk); err = clk_prepare_enable(port->clk); if (err) { |