Skip to content

Commit 1e3c4af

Browse files
claudiubezneasre
authored andcommitted
power: reset: at91-reset: add notifier block to struct at91_reset
Add struct notifier_block to struct at91_reset. Signed-off-by: Claudiu Beznea <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent f9e6ce7 commit 1e3c4af

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/power/reset/at91-reset.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ struct at91_reset {
5353
void __iomem *rstc_base;
5454
void __iomem *ramc_base[2];
5555
struct clk *sclk;
56+
struct notifier_block nb;
5657
};
5758

5859
static struct at91_reset reset;
@@ -205,10 +206,6 @@ static const struct of_device_id at91_reset_of_match[] = {
205206
};
206207
MODULE_DEVICE_TABLE(of, at91_reset_of_match);
207208

208-
static struct notifier_block at91_restart_nb = {
209-
.priority = 192,
210-
};
211-
212209
static int __init at91_reset_probe(struct platform_device *pdev)
213210
{
214211
const struct of_device_id *match;
@@ -235,7 +232,8 @@ static int __init at91_reset_probe(struct platform_device *pdev)
235232
}
236233

237234
match = of_match_node(at91_reset_of_match, pdev->dev.of_node);
238-
at91_restart_nb.notifier_call = match->data;
235+
reset.nb.notifier_call = match->data;
236+
reset.nb.priority = 192;
239237

240238
reset.sclk = devm_clk_get(&pdev->dev, NULL);
241239
if (IS_ERR(reset.sclk))
@@ -247,7 +245,7 @@ static int __init at91_reset_probe(struct platform_device *pdev)
247245
return ret;
248246
}
249247

250-
ret = register_restart_handler(&at91_restart_nb);
248+
ret = register_restart_handler(&reset.nb);
251249
if (ret) {
252250
clk_disable_unprepare(reset.sclk);
253251
return ret;
@@ -260,7 +258,7 @@ static int __init at91_reset_probe(struct platform_device *pdev)
260258

261259
static int __exit at91_reset_remove(struct platform_device *pdev)
262260
{
263-
unregister_restart_handler(&at91_restart_nb);
261+
unregister_restart_handler(&reset.nb);
264262
clk_disable_unprepare(reset.sclk);
265263

266264
return 0;

0 commit comments

Comments
 (0)