Skip to content

Commit c82aebb

Browse files
committed
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>
1 parent 70eddf4 commit c82aebb

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

drivers/power/reset/at91-sama5d2_shdwc.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ struct shdwc_config {
7070

7171
struct shdwc {
7272
const struct shdwc_config *cfg;
73+
struct clk *sclk;
7374
void __iomem *at91_shdwc_base;
7475
void __iomem *mpddrc_base;
7576
void __iomem *pmc_base;
@@ -80,7 +81,6 @@ struct shdwc {
8081
* since pm_power_off itself is global.
8182
*/
8283
static struct shdwc *at91_shdwc;
83-
static struct clk *sclk;
8484

8585
static const unsigned long long sdwc_dbc_period[] = {
8686
0, 3, 32, 512, 4096, 32768,
@@ -271,11 +271,11 @@ static int __init at91_shdwc_probe(struct platform_device *pdev)
271271
match = of_match_node(at91_shdwc_of_match, pdev->dev.of_node);
272272
at91_shdwc->cfg = match->data;
273273

274-
sclk = devm_clk_get(&pdev->dev, NULL);
275-
if (IS_ERR(sclk))
276-
return PTR_ERR(sclk);
274+
at91_shdwc->sclk = devm_clk_get(&pdev->dev, NULL);
275+
if (IS_ERR(at91_shdwc->sclk))
276+
return PTR_ERR(at91_shdwc->sclk);
277277

278-
ret = clk_prepare_enable(sclk);
278+
ret = clk_prepare_enable(at91_shdwc->sclk);
279279
if (ret) {
280280
dev_err(&pdev->dev, "Could not enable slow clock\n");
281281
return ret;
@@ -328,7 +328,7 @@ static int __init at91_shdwc_probe(struct platform_device *pdev)
328328
unmap:
329329
iounmap(at91_shdwc->pmc_base);
330330
clk_disable:
331-
clk_disable_unprepare(sclk);
331+
clk_disable_unprepare(at91_shdwc->sclk);
332332

333333
return ret;
334334
}
@@ -348,7 +348,7 @@ static int __exit at91_shdwc_remove(struct platform_device *pdev)
348348
iounmap(shdw->mpddrc_base);
349349
iounmap(shdw->pmc_base);
350350

351-
clk_disable_unprepare(sclk);
351+
clk_disable_unprepare(shdw->sclk);
352352

353353
return 0;
354354
}

0 commit comments

Comments
 (0)