mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
* [PATCH 0/2] thermal: amlogic: Two cleanups
@ 2023-11-16 11:26 Uwe Kleine-König
  2023-11-16 11:26 ` [PATCH 1/2] thermal: amlogic: Make amlogic_thermal_disable() return void Uwe Kleine-König
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2023-11-16 11:26 UTC (permalink / raw)
  To: Guillaume La Roque, Rafael J. Wysocki, Daniel Lezcano
  Cc: Zhang Rui, Lukasz Luba, linux-pm, linux-amlogic, kernel

Hello,

while rebasing my patch stack to v6.7-rc1 I spotted these two patch
opportunities for the amlogic thermal driver.

Best regards
Uwe

Uwe Kleine-König (2):
  thermal: amlogic: Make amlogic_thermal_disable() return void
  thermal: amlogic: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions

 drivers/thermal/amlogic_thermal.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

base-commit: f31817cbcf48d191faee7cebfb59197d2048cd64
-- 
2.42.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] thermal: amlogic: Make amlogic_thermal_disable() return void
  2023-11-16 11:26 [PATCH 0/2] thermal: amlogic: Two cleanups Uwe Kleine-König
@ 2023-11-16 11:26 ` Uwe Kleine-König
  2023-11-16 11:26 ` [PATCH 2/2] thermal: amlogic: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Uwe Kleine-König
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2023-11-16 11:26 UTC (permalink / raw)
  To: Guillaume La Roque, Rafael J. Wysocki, Daniel Lezcano
  Cc: Zhang Rui, Lukasz Luba, linux-pm, linux-amlogic, kernel

amlogic_thermal_disable() returned zero unconditionally and
amlogic_thermal_remove() already ignores the return value.

Make it return no value and modify amlogic_thermal_suspend to not check
the value.

This patch introduces no semantic changes, but makes it more obvious for
a human reader that amlogic_thermal_suspend() cannot fail.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/thermal/amlogic_thermal.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c
index 5877cde25b79..562f63b7bf27 100644
--- a/drivers/thermal/amlogic_thermal.c
+++ b/drivers/thermal/amlogic_thermal.c
@@ -167,13 +167,11 @@ static int amlogic_thermal_enable(struct amlogic_thermal *data)
 	return 0;
 }
 
-static int amlogic_thermal_disable(struct amlogic_thermal *data)
+static void amlogic_thermal_disable(struct amlogic_thermal *data)
 {
 	regmap_update_bits(data->regmap, TSENSOR_CFG_REG1,
 			   TSENSOR_CFG_REG1_ENABLE, 0);
 	clk_disable_unprepare(data->clk);
-
-	return 0;
 }
 
 static int amlogic_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
@@ -302,7 +300,9 @@ static int __maybe_unused amlogic_thermal_suspend(struct device *dev)
 {
 	struct amlogic_thermal *data = dev_get_drvdata(dev);
 
-	return amlogic_thermal_disable(data);
+	amlogic_thermal_disable(data);
+
+	return 0;
 }
 
 static int __maybe_unused amlogic_thermal_resume(struct device *dev)
-- 
2.42.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/2] thermal: amlogic: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions
  2023-11-16 11:26 [PATCH 0/2] thermal: amlogic: Two cleanups Uwe Kleine-König
  2023-11-16 11:26 ` [PATCH 1/2] thermal: amlogic: Make amlogic_thermal_disable() return void Uwe Kleine-König
@ 2023-11-16 11:26 ` Uwe Kleine-König
  2023-12-18 20:48 ` [PATCH 0/2] thermal: amlogic: Two cleanups Uwe Kleine-König
  2023-12-19 17:59 ` Daniel Lezcano
  3 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2023-11-16 11:26 UTC (permalink / raw)
  To: Guillaume La Roque, Rafael J. Wysocki, Daniel Lezcano
  Cc: Zhang Rui, Lukasz Luba, linux-pm, linux-amlogic, kernel

This macro has the advantage over SIMPLE_DEV_PM_OPS that we don't have to
care about when the functions are actually used, so the corresponding
__maybe_unused can be dropped.

Also make use of pm_ptr() to discard all PM related stuff if CONFIG_PM
isn't enabled.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/thermal/amlogic_thermal.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c
index 562f63b7bf27..df7a5ed55385 100644
--- a/drivers/thermal/amlogic_thermal.c
+++ b/drivers/thermal/amlogic_thermal.c
@@ -296,7 +296,7 @@ static void amlogic_thermal_remove(struct platform_device *pdev)
 	amlogic_thermal_disable(data);
 }
 
-static int __maybe_unused amlogic_thermal_suspend(struct device *dev)
+static int amlogic_thermal_suspend(struct device *dev)
 {
 	struct amlogic_thermal *data = dev_get_drvdata(dev);
 
@@ -305,20 +305,21 @@ static int __maybe_unused amlogic_thermal_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused amlogic_thermal_resume(struct device *dev)
+static int amlogic_thermal_resume(struct device *dev)
 {
 	struct amlogic_thermal *data = dev_get_drvdata(dev);
 
 	return amlogic_thermal_enable(data);
 }
 
-static SIMPLE_DEV_PM_OPS(amlogic_thermal_pm_ops,
-			 amlogic_thermal_suspend, amlogic_thermal_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(amlogic_thermal_pm_ops,
+				amlogic_thermal_suspend,
+				amlogic_thermal_resume);
 
 static struct platform_driver amlogic_thermal_driver = {
 	.driver = {
 		.name		= "amlogic_thermal",
-		.pm		= &amlogic_thermal_pm_ops,
+		.pm		= pm_ptr(&amlogic_thermal_pm_ops),
 		.of_match_table = of_amlogic_thermal_match,
 	},
 	.probe = amlogic_thermal_probe,
-- 
2.42.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] thermal: amlogic: Two cleanups
  2023-11-16 11:26 [PATCH 0/2] thermal: amlogic: Two cleanups Uwe Kleine-König
  2023-11-16 11:26 ` [PATCH 1/2] thermal: amlogic: Make amlogic_thermal_disable() return void Uwe Kleine-König
  2023-11-16 11:26 ` [PATCH 2/2] thermal: amlogic: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Uwe Kleine-König
@ 2023-12-18 20:48 ` Uwe Kleine-König
  2023-12-18 21:15   ` Daniel Lezcano
  2023-12-19 17:59 ` Daniel Lezcano
  3 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2023-12-18 20:48 UTC (permalink / raw)
  To: Guillaume La Roque, Rafael J. Wysocki, Daniel Lezcano
  Cc: linux-amlogic, Zhang Rui, kernel, Lukasz Luba, linux-pm


[-- Attachment #1.1: Type: text/plain, Size: 639 bytes --]

Hello,

On Thu, Nov 16, 2023 at 12:26:34PM +0100, Uwe Kleine-König wrote:
> while rebasing my patch stack to v6.7-rc1 I spotted these two patch
> opportunities for the amlogic thermal driver.
> 
> Best regards
> Uwe
> 
> Uwe Kleine-König (2):
>   thermal: amlogic: Make amlogic_thermal_disable() return void
>   thermal: amlogic: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions

gentle ping! Is there a chance these patches make it into v6.8-rc1?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] thermal: amlogic: Two cleanups
  2023-12-18 20:48 ` [PATCH 0/2] thermal: amlogic: Two cleanups Uwe Kleine-König
@ 2023-12-18 21:15   ` Daniel Lezcano
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Lezcano @ 2023-12-18 21:15 UTC (permalink / raw)
  To: Uwe Kleine-König, Guillaume La Roque, Rafael J. Wysocki
  Cc: linux-amlogic, Zhang Rui, kernel, Lukasz Luba, linux-pm

On 18/12/2023 21:48, Uwe Kleine-König wrote:
> Hello,
> 
> On Thu, Nov 16, 2023 at 12:26:34PM +0100, Uwe Kleine-König wrote:
>> while rebasing my patch stack to v6.7-rc1 I spotted these two patch
>> opportunities for the amlogic thermal driver.
>>
>> Best regards
>> Uwe
>>
>> Uwe Kleine-König (2):
>>    thermal: amlogic: Make amlogic_thermal_disable() return void
>>    thermal: amlogic: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions
> 
> gentle ping! Is there a chance these patches make it into v6.8-rc1?

Yes ;)

-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/2] thermal: amlogic: Two cleanups
  2023-11-16 11:26 [PATCH 0/2] thermal: amlogic: Two cleanups Uwe Kleine-König
                   ` (2 preceding siblings ...)
  2023-12-18 20:48 ` [PATCH 0/2] thermal: amlogic: Two cleanups Uwe Kleine-König
@ 2023-12-19 17:59 ` Daniel Lezcano
  3 siblings, 0 replies; 6+ messages in thread
From: Daniel Lezcano @ 2023-12-19 17:59 UTC (permalink / raw)
  To: Uwe Kleine-König, Guillaume La Roque, Rafael J. Wysocki
  Cc: Zhang Rui, Lukasz Luba, linux-pm, linux-amlogic, kernel

On 16/11/2023 12:26, Uwe Kleine-König wrote:
> Hello,
> 
> while rebasing my patch stack to v6.7-rc1 I spotted these two patch
> opportunities for the amlogic thermal driver.
> 
> Best regards
> Uwe
> 
> Uwe Kleine-König (2):
>    thermal: amlogic: Make amlogic_thermal_disable() return void
>    thermal: amlogic: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions
> 
>   drivers/thermal/amlogic_thermal.c | 19 ++++++++++---------
>   1 file changed, 10 insertions(+), 9 deletions(-)
> 
> base-commit: f31817cbcf48d191faee7cebfb59197d2048cd64

Applied, thanks

-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-12-19 18:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-16 11:26 [PATCH 0/2] thermal: amlogic: Two cleanups Uwe Kleine-König
2023-11-16 11:26 ` [PATCH 1/2] thermal: amlogic: Make amlogic_thermal_disable() return void Uwe Kleine-König
2023-11-16 11:26 ` [PATCH 2/2] thermal: amlogic: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Uwe Kleine-König
2023-12-18 20:48 ` [PATCH 0/2] thermal: amlogic: Two cleanups Uwe Kleine-König
2023-12-18 21:15   ` Daniel Lezcano
2023-12-19 17:59 ` Daniel Lezcano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®