mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 00:10:09 +00:00
power: reset: at91-reset: add sclk to struct at91_reset
Add sclk to struct at91_reset. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
parent
4d9ce0f56a
commit
f9e6ce74cb
1 changed files with 7 additions and 8 deletions
|
@ -52,12 +52,11 @@ enum reset_type {
|
||||||
struct at91_reset {
|
struct at91_reset {
|
||||||
void __iomem *rstc_base;
|
void __iomem *rstc_base;
|
||||||
void __iomem *ramc_base[2];
|
void __iomem *ramc_base[2];
|
||||||
|
struct clk *sclk;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct at91_reset reset;
|
static struct at91_reset reset;
|
||||||
|
|
||||||
static struct clk *sclk;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* unless the SDRAM is cleanly shutdown before we hit the
|
* unless the SDRAM is cleanly shutdown before we hit the
|
||||||
* reset register it can be left driving the data bus and
|
* reset register it can be left driving the data bus and
|
||||||
|
@ -238,11 +237,11 @@ static int __init at91_reset_probe(struct platform_device *pdev)
|
||||||
match = of_match_node(at91_reset_of_match, pdev->dev.of_node);
|
match = of_match_node(at91_reset_of_match, pdev->dev.of_node);
|
||||||
at91_restart_nb.notifier_call = match->data;
|
at91_restart_nb.notifier_call = match->data;
|
||||||
|
|
||||||
sclk = devm_clk_get(&pdev->dev, NULL);
|
reset.sclk = devm_clk_get(&pdev->dev, NULL);
|
||||||
if (IS_ERR(sclk))
|
if (IS_ERR(reset.sclk))
|
||||||
return PTR_ERR(sclk);
|
return PTR_ERR(reset.sclk);
|
||||||
|
|
||||||
ret = clk_prepare_enable(sclk);
|
ret = clk_prepare_enable(reset.sclk);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(&pdev->dev, "Could not enable slow clock\n");
|
dev_err(&pdev->dev, "Could not enable slow clock\n");
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -250,7 +249,7 @@ static int __init at91_reset_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
ret = register_restart_handler(&at91_restart_nb);
|
ret = register_restart_handler(&at91_restart_nb);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
clk_disable_unprepare(sclk);
|
clk_disable_unprepare(reset.sclk);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,7 +261,7 @@ static int __init at91_reset_probe(struct platform_device *pdev)
|
||||||
static int __exit at91_reset_remove(struct platform_device *pdev)
|
static int __exit at91_reset_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
unregister_restart_handler(&at91_restart_nb);
|
unregister_restart_handler(&at91_restart_nb);
|
||||||
clk_disable_unprepare(sclk);
|
clk_disable_unprepare(reset.sclk);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue