All of lore.kernel.org
 help / color / mirror / Atom feed
From: Claudiu Beznea <claudiu.beznea@microchip.com>
To: <nicolas.ferre@microchip.com>, <alexandre.belloni@bootlin.com>,
	<linux@armlinux.org.uk>, <sre@kernel.org>
Cc: <linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <linux-pm@vger.kernel.org>,
	Claudiu Beznea <claudiu.beznea@microchip.com>
Subject: [PATCH 4/6] power: reset: at91-poweroff: make sclk part of struct shdwc
Date: Thu, 30 Aug 2018 14:50:09 +0300	[thread overview]
Message-ID: <1535629811-13403-5-git-send-email-claudiu.beznea@microchip.com> (raw)
In-Reply-To: <1535629811-13403-1-git-send-email-claudiu.beznea@microchip.com>

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>
---
 drivers/power/reset/at91-sama5d2_shdwc.c | 14 +++++++-------
 1 file 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 {
 
 struct shdwc {
 	const struct shdwc_config *cfg;
+	struct clk *sclk;
 	void __iomem *at91_shdwc_base;
 	void __iomem *mpddrc_base;
 	void __iomem *pmc_base;
@@ -80,7 +81,6 @@ struct shdwc {
  * since pm_power_off itself is global.
  */
 static struct shdwc *at91_shdwc;
-static struct clk *sclk;
 
 static const unsigned long long sdwc_dbc_period[] = {
 	0, 3, 32, 512, 4096, 32768,
@@ -271,11 +271,11 @@ static int __init at91_shdwc_probe(struct platform_device *pdev)
 	match = of_match_node(at91_shdwc_of_match, pdev->dev.of_node);
 	at91_shdwc->cfg = match->data;
 
-	sclk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(sclk))
-		return PTR_ERR(sclk);
+	at91_shdwc->sclk = devm_clk_get(&pdev->dev, NULL);
+	if (IS_ERR(at91_shdwc->sclk))
+		return PTR_ERR(at91_shdwc->sclk);
 
-	ret = clk_prepare_enable(sclk);
+	ret = clk_prepare_enable(at91_shdwc->sclk);
 	if (ret) {
 		dev_err(&pdev->dev, "Could not enable slow clock\n");
 		return ret;
@@ -328,7 +328,7 @@ static int __init at91_shdwc_probe(struct platform_device *pdev)
 unmap:
 	iounmap(at91_shdwc->pmc_base);
 clk_disable:
-	clk_disable_unprepare(sclk);
+	clk_disable_unprepare(at91_shdwc->sclk);
 
 	return ret;
 }
@@ -348,7 +348,7 @@ static int __exit at91_shdwc_remove(struct platform_device *pdev)
 		iounmap(shdw->mpddrc_base);
 	iounmap(shdw->pmc_base);
 
-	clk_disable_unprepare(sclk);
+	clk_disable_unprepare(shdw->sclk);
 
 	return 0;
 }
-- 
2.7.4


WARNING: multiple messages have this Message-ID (diff)
From: Claudiu Beznea <claudiu.beznea@microchip.com>
To: nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com,
	linux@armlinux.org.uk, sre@kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	Claudiu Beznea <claudiu.beznea@microchip.com>
Subject: [PATCH 4/6] power: reset: at91-poweroff: make sclk part of struct shdwc
Date: Thu, 30 Aug 2018 14:50:09 +0300	[thread overview]
Message-ID: <1535629811-13403-5-git-send-email-claudiu.beznea@microchip.com> (raw)
In-Reply-To: <1535629811-13403-1-git-send-email-claudiu.beznea@microchip.com>

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>
---
 drivers/power/reset/at91-sama5d2_shdwc.c | 14 +++++++-------
 1 file 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 {
 
 struct shdwc {
 	const struct shdwc_config *cfg;
+	struct clk *sclk;
 	void __iomem *at91_shdwc_base;
 	void __iomem *mpddrc_base;
 	void __iomem *pmc_base;
@@ -80,7 +81,6 @@ struct shdwc {
  * since pm_power_off itself is global.
  */
 static struct shdwc *at91_shdwc;
-static struct clk *sclk;
 
 static const unsigned long long sdwc_dbc_period[] = {
 	0, 3, 32, 512, 4096, 32768,
@@ -271,11 +271,11 @@ static int __init at91_shdwc_probe(struct platform_device *pdev)
 	match = of_match_node(at91_shdwc_of_match, pdev->dev.of_node);
 	at91_shdwc->cfg = match->data;
 
-	sclk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(sclk))
-		return PTR_ERR(sclk);
+	at91_shdwc->sclk = devm_clk_get(&pdev->dev, NULL);
+	if (IS_ERR(at91_shdwc->sclk))
+		return PTR_ERR(at91_shdwc->sclk);
 
-	ret = clk_prepare_enable(sclk);
+	ret = clk_prepare_enable(at91_shdwc->sclk);
 	if (ret) {
 		dev_err(&pdev->dev, "Could not enable slow clock\n");
 		return ret;
@@ -328,7 +328,7 @@ static int __init at91_shdwc_probe(struct platform_device *pdev)
 unmap:
 	iounmap(at91_shdwc->pmc_base);
 clk_disable:
-	clk_disable_unprepare(sclk);
+	clk_disable_unprepare(at91_shdwc->sclk);
 
 	return ret;
 }
@@ -348,7 +348,7 @@ static int __exit at91_shdwc_remove(struct platform_device *pdev)
 		iounmap(shdw->mpddrc_base);
 	iounmap(shdw->pmc_base);
 
-	clk_disable_unprepare(sclk);
+	clk_disable_unprepare(shdw->sclk);
 
 	return 0;
 }
-- 
2.7.4

WARNING: multiple messages have this Message-ID (diff)
From: claudiu.beznea@microchip.com (Claudiu Beznea)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/6] power: reset: at91-poweroff: make sclk part of struct shdwc
Date: Thu, 30 Aug 2018 14:50:09 +0300	[thread overview]
Message-ID: <1535629811-13403-5-git-send-email-claudiu.beznea@microchip.com> (raw)
In-Reply-To: <1535629811-13403-1-git-send-email-claudiu.beznea@microchip.com>

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>
---
 drivers/power/reset/at91-sama5d2_shdwc.c | 14 +++++++-------
 1 file 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 {
 
 struct shdwc {
 	const struct shdwc_config *cfg;
+	struct clk *sclk;
 	void __iomem *at91_shdwc_base;
 	void __iomem *mpddrc_base;
 	void __iomem *pmc_base;
@@ -80,7 +81,6 @@ struct shdwc {
  * since pm_power_off itself is global.
  */
 static struct shdwc *at91_shdwc;
-static struct clk *sclk;
 
 static const unsigned long long sdwc_dbc_period[] = {
 	0, 3, 32, 512, 4096, 32768,
@@ -271,11 +271,11 @@ static int __init at91_shdwc_probe(struct platform_device *pdev)
 	match = of_match_node(at91_shdwc_of_match, pdev->dev.of_node);
 	at91_shdwc->cfg = match->data;
 
-	sclk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(sclk))
-		return PTR_ERR(sclk);
+	at91_shdwc->sclk = devm_clk_get(&pdev->dev, NULL);
+	if (IS_ERR(at91_shdwc->sclk))
+		return PTR_ERR(at91_shdwc->sclk);
 
-	ret = clk_prepare_enable(sclk);
+	ret = clk_prepare_enable(at91_shdwc->sclk);
 	if (ret) {
 		dev_err(&pdev->dev, "Could not enable slow clock\n");
 		return ret;
@@ -328,7 +328,7 @@ static int __init at91_shdwc_probe(struct platform_device *pdev)
 unmap:
 	iounmap(at91_shdwc->pmc_base);
 clk_disable:
-	clk_disable_unprepare(sclk);
+	clk_disable_unprepare(at91_shdwc->sclk);
 
 	return ret;
 }
@@ -348,7 +348,7 @@ static int __exit at91_shdwc_remove(struct platform_device *pdev)
 		iounmap(shdw->mpddrc_base);
 	iounmap(shdw->pmc_base);
 
-	clk_disable_unprepare(sclk);
+	clk_disable_unprepare(shdw->sclk);
 
 	return 0;
 }
-- 
2.7.4

  parent reply	other threads:[~2018-08-30 11:50 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-30 11:50 [PATCH 0/6] shutdown procedure verification for SAMA5D2 Claudiu Beznea
2018-08-30 11:50 ` Claudiu Beznea
2018-08-30 11:50 ` Claudiu Beznea
2018-08-30 11:50 ` [PATCH 1/6] power: reset: at91-poweroff: switch to slow clock before shutdown Claudiu Beznea
2018-08-30 11:50   ` Claudiu Beznea
2018-08-30 11:50   ` Claudiu Beznea
2018-08-30 11:50 ` [PATCH 2/6] power: reset: at91-poweroff: use only one poweroff function Claudiu Beznea
2018-08-30 11:50   ` Claudiu Beznea
2018-08-30 11:50   ` Claudiu Beznea
2018-08-30 11:50 ` [PATCH 3/6] power: reset: at91-poweroff: make mpddrc_base part of struct shdwc Claudiu Beznea
2018-08-30 11:50   ` Claudiu Beznea
2018-08-30 11:50   ` Claudiu Beznea
2018-08-30 11:50 ` Claudiu Beznea [this message]
2018-08-30 11:50   ` [PATCH 4/6] power: reset: at91-poweroff: make sclk " Claudiu Beznea
2018-08-30 11:50   ` Claudiu Beznea
2018-08-30 11:50 ` [PATCH 5/6] power: reset: at91-poweroff: rename at91_shdwc_base member " Claudiu Beznea
2018-08-30 11:50   ` Claudiu Beznea
2018-08-30 11:50   ` Claudiu Beznea
2018-08-30 11:50 ` [PATCH 6/6] power: reset: at91-poweroff: do not procede if at91_shdwc is allocated Claudiu Beznea
2018-08-30 11:50   ` Claudiu Beznea
2018-08-30 11:50   ` Claudiu Beznea
2018-09-06  9:54 ` [PATCH 0/6] shutdown procedure verification for SAMA5D2 Nicolas Ferre
2018-09-06  9:54   ` Nicolas Ferre
2018-09-06  9:54   ` Nicolas Ferre
2018-09-16 10:43 ` Sebastian Reichel
2018-09-16 10:43   ` Sebastian Reichel
2018-09-16 20:43   ` Sebastian Reichel
2018-09-16 20:43     ` Sebastian Reichel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1535629811-13403-5-git-send-email-claudiu.beznea@microchip.com \
    --to=claudiu.beznea@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=nicolas.ferre@microchip.com \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.