@@ -52,12 +52,11 @@ enum reset_type {
52
52
struct at91_reset {
53
53
void __iomem * rstc_base ;
54
54
void __iomem * ramc_base [2 ];
55
+ struct clk * sclk ;
55
56
};
56
57
57
58
static struct at91_reset reset ;
58
59
59
- static struct clk * sclk ;
60
-
61
60
/*
62
61
* unless the SDRAM is cleanly shutdown before we hit the
63
62
* reset register it can be left driving the data bus and
@@ -238,19 +237,19 @@ static int __init at91_reset_probe(struct platform_device *pdev)
238
237
match = of_match_node (at91_reset_of_match , pdev -> dev .of_node );
239
238
at91_restart_nb .notifier_call = match -> data ;
240
239
241
- sclk = devm_clk_get (& pdev -> dev , NULL );
242
- if (IS_ERR (sclk ))
243
- return PTR_ERR (sclk );
240
+ reset . sclk = devm_clk_get (& pdev -> dev , NULL );
241
+ if (IS_ERR (reset . sclk ))
242
+ return PTR_ERR (reset . sclk );
244
243
245
- ret = clk_prepare_enable (sclk );
244
+ ret = clk_prepare_enable (reset . sclk );
246
245
if (ret ) {
247
246
dev_err (& pdev -> dev , "Could not enable slow clock\n" );
248
247
return ret ;
249
248
}
250
249
251
250
ret = register_restart_handler (& at91_restart_nb );
252
251
if (ret ) {
253
- clk_disable_unprepare (sclk );
252
+ clk_disable_unprepare (reset . sclk );
254
253
return ret ;
255
254
}
256
255
@@ -262,7 +261,7 @@ static int __init at91_reset_probe(struct platform_device *pdev)
262
261
static int __exit at91_reset_remove (struct platform_device * pdev )
263
262
{
264
263
unregister_restart_handler (& at91_restart_nb );
265
- clk_disable_unprepare (sclk );
264
+ clk_disable_unprepare (reset . sclk );
266
265
267
266
return 0 ;
268
267
}
0 commit comments