diff options
Diffstat (limited to 'arch/arm/plat-omap/dmtimer.c')
-rw-r--r-- | arch/arm/plat-omap/dmtimer.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c index a0daa2fb5de6..e6dbc8dbe6a6 100644 --- a/arch/arm/plat-omap/dmtimer.c +++ b/arch/arm/plat-omap/dmtimer.c | |||
@@ -140,8 +140,7 @@ static int omap_dm_timer_prepare(struct omap_dm_timer *timer) | |||
140 | */ | 140 | */ |
141 | if (!(timer->capability & OMAP_TIMER_NEEDS_RESET)) { | 141 | if (!(timer->capability & OMAP_TIMER_NEEDS_RESET)) { |
142 | timer->fclk = clk_get(&timer->pdev->dev, "fck"); | 142 | timer->fclk = clk_get(&timer->pdev->dev, "fck"); |
143 | if (WARN_ON_ONCE(IS_ERR_OR_NULL(timer->fclk))) { | 143 | if (WARN_ON_ONCE(IS_ERR(timer->fclk))) { |
144 | timer->fclk = NULL; | ||
145 | dev_err(&timer->pdev->dev, ": No fclk handle.\n"); | 144 | dev_err(&timer->pdev->dev, ": No fclk handle.\n"); |
146 | return -EINVAL; | 145 | return -EINVAL; |
147 | } | 146 | } |
@@ -373,7 +372,7 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_modify_idlect_mask); | |||
373 | 372 | ||
374 | struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer) | 373 | struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer) |
375 | { | 374 | { |
376 | if (timer) | 375 | if (timer && !IS_ERR(timer->fclk)) |
377 | return timer->fclk; | 376 | return timer->fclk; |
378 | return NULL; | 377 | return NULL; |
379 | } | 378 | } |
@@ -482,7 +481,7 @@ int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) | |||
482 | if (pdata && pdata->set_timer_src) | 481 | if (pdata && pdata->set_timer_src) |
483 | return pdata->set_timer_src(timer->pdev, source); | 482 | return pdata->set_timer_src(timer->pdev, source); |
484 | 483 | ||
485 | if (!timer->fclk) | 484 | if (IS_ERR(timer->fclk)) |
486 | return -EINVAL; | 485 | return -EINVAL; |
487 | 486 | ||
488 | switch (source) { | 487 | switch (source) { |
@@ -500,13 +499,13 @@ int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) | |||
500 | } | 499 | } |
501 | 500 | ||
502 | parent = clk_get(&timer->pdev->dev, parent_name); | 501 | parent = clk_get(&timer->pdev->dev, parent_name); |
503 | if (IS_ERR_OR_NULL(parent)) { | 502 | if (IS_ERR(parent)) { |
504 | pr_err("%s: %s not found\n", __func__, parent_name); | 503 | pr_err("%s: %s not found\n", __func__, parent_name); |
505 | return -EINVAL; | 504 | return -EINVAL; |
506 | } | 505 | } |
507 | 506 | ||
508 | ret = clk_set_parent(timer->fclk, parent); | 507 | ret = clk_set_parent(timer->fclk, parent); |
509 | if (IS_ERR_VALUE(ret)) | 508 | if (ret < 0) |
510 | pr_err("%s: failed to set %s as parent\n", __func__, | 509 | pr_err("%s: failed to set %s as parent\n", __func__, |
511 | parent_name); | 510 | parent_name); |
512 | 511 | ||
@@ -808,6 +807,7 @@ static int omap_dm_timer_probe(struct platform_device *pdev) | |||
808 | return -ENOMEM; | 807 | return -ENOMEM; |
809 | } | 808 | } |
810 | 809 | ||
810 | timer->fclk = ERR_PTR(-ENODEV); | ||
811 | timer->io_base = devm_ioremap_resource(dev, mem); | 811 | timer->io_base = devm_ioremap_resource(dev, mem); |
812 | if (IS_ERR(timer->io_base)) | 812 | if (IS_ERR(timer->io_base)) |
813 | return PTR_ERR(timer->io_base); | 813 | return PTR_ERR(timer->io_base); |