diff options
author | Claudiu Beznea <claudiu.beznea@microchip.com> | 2018-08-30 07:50:09 -0400 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2018-09-16 06:32:09 -0400 |
commit | 6764aca14fc85c5ae2bb0a63bece445a05dd4fff (patch) | |
tree | 6f759193e37caea34fc870168b4d323c2ecbcbea | |
parent | 9be74f0d39c1c923185e184f3263ba29439ebad6 (diff) |
power: reset: at91-poweroff: make sclk part of struct shdwc
Make sclk part of struct shdwc to have all the data specific to SHDWC
grouped together in one structure.
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-rw-r--r-- | drivers/power/reset/at91-sama5d2_shdwc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/power/reset/at91-sama5d2_shdwc.c b/drivers/power/reset/at91-sama5d2_shdwc.c index c9994103248e..945b41b4086a 100644 --- a/drivers/power/reset/at91-sama5d2_shdwc.c +++ b/drivers/power/reset/at91-sama5d2_shdwc.c | |||
@@ -70,6 +70,7 @@ struct shdwc_config { | |||
70 | 70 | ||
71 | struct shdwc { | 71 | struct shdwc { |
72 | const struct shdwc_config *cfg; | 72 | const struct shdwc_config *cfg; |
73 | struct clk *sclk; | ||
73 | void __iomem *at91_shdwc_base; | 74 | void __iomem *at91_shdwc_base; |
74 | void __iomem *mpddrc_base; | 75 | void __iomem *mpddrc_base; |
75 | void __iomem *pmc_base; | 76 | void __iomem *pmc_base; |
@@ -80,7 +81,6 @@ struct shdwc { | |||
80 | * since pm_power_off itself is global. | 81 | * since pm_power_off itself is global. |
81 | */ | 82 | */ |
82 | static struct shdwc *at91_shdwc; | 83 | static struct shdwc *at91_shdwc; |
83 | static struct clk *sclk; | ||
84 | 84 | ||
85 | static const unsigned long long sdwc_dbc_period[] = { | 85 | static const unsigned long long sdwc_dbc_period[] = { |
86 | 0, 3, 32, 512, 4096, 32768, | 86 | 0, 3, 32, 512, 4096, 32768, |
@@ -271,11 +271,11 @@ static int __init at91_shdwc_probe(struct platform_device *pdev) | |||
271 | match = of_match_node(at91_shdwc_of_match, pdev->dev.of_node); | 271 | match = of_match_node(at91_shdwc_of_match, pdev->dev.of_node); |
272 | at91_shdwc->cfg = match->data; | 272 | at91_shdwc->cfg = match->data; |
273 | 273 | ||
274 | sclk = devm_clk_get(&pdev->dev, NULL); | 274 | at91_shdwc->sclk = devm_clk_get(&pdev->dev, NULL); |
275 | if (IS_ERR(sclk)) | 275 | if (IS_ERR(at91_shdwc->sclk)) |
276 | return PTR_ERR(sclk); | 276 | return PTR_ERR(at91_shdwc->sclk); |
277 | 277 | ||
278 | ret = clk_prepare_enable(sclk); | 278 | ret = clk_prepare_enable(at91_shdwc->sclk); |
279 | if (ret) { | 279 | if (ret) { |
280 | dev_err(&pdev->dev, "Could not enable slow clock\n"); | 280 | dev_err(&pdev->dev, "Could not enable slow clock\n"); |
281 | return ret; | 281 | return ret; |
@@ -328,7 +328,7 @@ static int __init at91_shdwc_probe(struct platform_device *pdev) | |||
328 | unmap: | 328 | unmap: |
329 | iounmap(at91_shdwc->pmc_base); | 329 | iounmap(at91_shdwc->pmc_base); |
330 | clk_disable: | 330 | clk_disable: |
331 | clk_disable_unprepare(sclk); | 331 | clk_disable_unprepare(at91_shdwc->sclk); |
332 | 332 | ||
333 | return ret; | 333 | return ret; |
334 | } | 334 | } |
@@ -348,7 +348,7 @@ static int __exit at91_shdwc_remove(struct platform_device *pdev) | |||
348 | iounmap(shdw->mpddrc_base); | 348 | iounmap(shdw->mpddrc_base); |
349 | iounmap(shdw->pmc_base); | 349 | iounmap(shdw->pmc_base); |
350 | 350 | ||
351 | clk_disable_unprepare(sclk); | 351 | clk_disable_unprepare(shdw->sclk); |
352 | 352 | ||
353 | return 0; | 353 | return 0; |
354 | } | 354 | } |