mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: daniel.lezcano@linaro.org, rui.zhang@intel.com
Cc: amit.kucheria@verdurent.com, linux-kernel@vger.kernel.org,
	Kamil Debski <kamil@wypas.org>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>,
	linux-hwmon@vger.kernel.org (open list:PWM FAN DRIVER)
Subject: [PATCH 1/6] thermal: hwmon: Replace the call the thermal_cdev_update()
Date: Sat, 11 Apr 2020 00:12:30 +0200	[thread overview]
Message-ID: <20200410221236.6484-2-daniel.lezcano@linaro.org> (raw)
In-Reply-To: <20200410221236.6484-1-daniel.lezcano@linaro.org>

The function thermal_cdev_upadte is called from the throttling
functions in the governors not from the cooling device itself.

The cooling device is set to its maximum state and then updated. Even
if I don't get the purpose of probing the pwm-fan to its maximum
cooling state, we can replace the thermal_cdev_update() call to the
internal set_cur_state() function directly.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/hwmon/pwm-fan.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c
index 30b7b3ea8836..a654ecdf21ab 100644
--- a/drivers/hwmon/pwm-fan.c
+++ b/drivers/hwmon/pwm-fan.c
@@ -372,7 +372,6 @@ static int pwm_fan_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	ctx->pwm_fan_state = ctx->pwm_fan_max_state;
 	if (IS_ENABLED(CONFIG_THERMAL)) {
 		cdev = devm_thermal_of_cooling_device_register(dev,
 			dev->of_node, "pwm-fan", ctx, &pwm_fan_cooling_ops);
@@ -384,7 +383,7 @@ static int pwm_fan_probe(struct platform_device *pdev)
 			return ret;
 		}
 		ctx->cdev = cdev;
-		thermal_cdev_update(cdev);
+		pwm_fan_set_cur_state(cdev, ctx->pwm_fan_max_state);
 	}
 
 	return 0;
-- 
2.17.1


  reply	other threads:[~2020-04-10 22:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-10 22:12 [PATCH 0/6] Consolidate the thermal_cdev_update() function Daniel Lezcano
2020-04-10 22:12 ` Daniel Lezcano [this message]
2020-04-11  1:32   ` [PATCH 1/6] thermal: hwmon: Replace the call the thermal_cdev_update() Guenter Roeck
2020-04-11 16:45     ` Daniel Lezcano
2020-04-11 17:26       ` Guenter Roeck
2020-04-11 21:07         ` Daniel Lezcano
2020-04-10 22:12 ` [PATCH 2/6] thermal: core: Move thermal_cdev_update next to updated=false Daniel Lezcano
2020-04-10 22:12 ` [PATCH 3/6] thermal: core: Remove pointless 'updated' boolean Daniel Lezcano
2020-04-10 22:12 ` [PATCH 4/6] thermal: power_allocator: Remove useless test Daniel Lezcano
2020-04-10 22:12 ` [PATCH 5/6] thermal: core: Move the call to thermal_cdev_udpate() to the power allocator Daniel Lezcano
2020-04-10 22:12 ` [PATCH 6/6] thermal: core: Make thermal_cdev_update private Daniel Lezcano

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=20200410221236.6484-2-daniel.lezcano@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=amit.kucheria@verdurent.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=jdelvare@suse.com \
    --cc=kamil@wypas.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=rui.zhang@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome