History log of /linux-master/drivers/hwmon/sparx5-temp.c
Revision Date Author Comments
# dc881144 06-Apr-2023 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

hwmon: sparx5-temp: constify pointers to hwmon_channel_info

Statically allocated array of pointed to hwmon_channel_info can be made
const for safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 907f2e4f 23-Aug-2022 Christophe JAILLET <christophe.jaillet@wanadoo.fr>

hwmon: (sparx5) Use devm_clk_get_enabled() helper

The devm_clk_get_enabled() helper:
- calls devm_clk_get()
- calls clk_prepare_enable() and registers what is needed in order to
call clk_disable_unprepare() when needed, as a managed resource.

This simplifies the code, the error handling paths and avoid the need of
a dedicated function used with devm_add_action_or_reset().

Based on my test with allyesconfig, this reduces the .o size from:
text data bss dec hex filename
2419 1472 0 3891 f33 drivers/hwmon/sparx5-temp.o
down to:
2155 1472 0 3627 e2b drivers/hwmon/sparx5-temp.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/cfe4c965074b5ecbe03830b05e038b4594c7b970.1661336689.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# fcb575bf 03-Sep-2020 Lars Povlsen <lars.povlsen@microchip.com>

hwmon: (sparx5) Fix initial reading of temperature

If the temperature is read before the internal calibration is
completed, the driver returns -EIO. Instead it should return -EAGAIN
to encourage repeating the operation.

Note (groeck): Returning -EAGAIN to userspace may result in hard loops;
some userspace code interprets -EAGAIN as request to retry immediately.
I would prefer -ENODATA, but it turns out that the thermal subsystem only
handles -EAGAIN silently, so we'll have to stick with that.

Signed-off-by: Lars Povlsen <lars.povlsen@microchip.com>
Link: https://lore.kernel.org/r/20200903134704.8949-1-lars.povlsen@microchip.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# 2fdf8f7f 21-Jul-2020 Wei Yongjun <weiyongjun1@huawei.com>

hwmon: (sparx5) Make symbol 's5_temp_match' static

The sparse tool complains as follows:

drivers/hwmon/sparx5-temp.c:150:27: warning:
symbol 's5_temp_match' was not declared. Should it be static?

This variable is not used outside of sparx5-temp.c, this commit
marks it static.

Fixes: c2cb4b5777e1 ("hwmon: sparx5: Add Sparx5 SoC temperature driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20200721134919.34033-1-weiyongjun1@huawei.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>


# e4922176 18-Jun-2020 Lars Povlsen <lars.povlsen@microchip.com>

hwmon: sparx5: Add Sparx5 SoC temperature driver

This patch adds a temperature sensor driver to the Sparx5 SoC.

Signed-off-by: Lars Povlsen <lars.povlsen@microchip.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20200618135951.25441-4-lars.povlsen@microchip.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>