File tree Expand file tree Collapse file tree 1 file changed +5
-15
lines changed Expand file tree Collapse file tree 1 file changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -348,37 +348,28 @@ static int __init at91wdt_probe(struct platform_device *pdev)
348
348
if (IS_ERR (wdt -> base ))
349
349
return PTR_ERR (wdt -> base );
350
350
351
- wdt -> sclk = devm_clk_get (& pdev -> dev , NULL );
352
- if (IS_ERR (wdt -> sclk ))
353
- return PTR_ERR (wdt -> sclk );
354
-
355
- err = clk_prepare_enable (wdt -> sclk );
356
- if (err ) {
351
+ wdt -> sclk = devm_clk_get_enabled (& pdev -> dev , NULL );
352
+ if (IS_ERR (wdt -> sclk )) {
357
353
dev_err (& pdev -> dev , "Could not enable slow clock\n" );
358
- return err ;
354
+ return PTR_ERR ( wdt -> sclk ) ;
359
355
}
360
356
361
357
if (pdev -> dev .of_node ) {
362
358
err = of_at91wdt_init (pdev -> dev .of_node , wdt );
363
359
if (err )
364
- goto err_clk ;
360
+ return err ;
365
361
}
366
362
367
363
err = at91_wdt_init (pdev , wdt );
368
364
if (err )
369
- goto err_clk ;
365
+ return err ;
370
366
371
367
platform_set_drvdata (pdev , wdt );
372
368
373
369
pr_info ("enabled (heartbeat=%d sec, nowayout=%d)\n" ,
374
370
wdt -> wdd .timeout , wdt -> nowayout );
375
371
376
372
return 0 ;
377
-
378
- err_clk :
379
- clk_disable_unprepare (wdt -> sclk );
380
-
381
- return err ;
382
373
}
383
374
384
375
static int __exit at91wdt_remove (struct platform_device * pdev )
@@ -388,7 +379,6 @@ static int __exit at91wdt_remove(struct platform_device *pdev)
388
379
389
380
pr_warn ("I quit now, hardware will probably reboot!\n" );
390
381
del_timer (& wdt -> timer );
391
- clk_disable_unprepare (wdt -> sclk );
392
382
393
383
return 0 ;
394
384
}
You can’t perform that action at this time.
0 commit comments