diff options
Diffstat (limited to 'drivers/spi/spi-jcore.c')
-rw-r--r-- | drivers/spi/spi-jcore.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/spi/spi-jcore.c b/drivers/spi/spi-jcore.c index dafed6280df3..702fe573a47b 100644 --- a/drivers/spi/spi-jcore.c +++ b/drivers/spi/spi-jcore.c @@ -184,10 +184,11 @@ static int jcore_spi_probe(struct platform_device *pdev) */ clock_freq = 50000000; clk = devm_clk_get(&pdev->dev, "ref_clk"); - if (!IS_ERR_OR_NULL(clk)) { - if (clk_enable(clk) == 0) + if (!IS_ERR(clk)) { + if (clk_prepare_enable(clk) == 0) { clock_freq = clk_get_rate(clk); - else + clk_disable_unprepare(clk); + } else dev_warn(&pdev->dev, "could not enable ref_clk\n"); } hw->clock_freq = clock_freq; @@ -198,10 +199,8 @@ static int jcore_spi_probe(struct platform_device *pdev) /* Register our spi controller */ err = devm_spi_register_master(&pdev->dev, master); - if (err) { - clk_disable(clk); + if (err) goto exit; - } return 0; |