linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hwmon: rpi: Fix initial notify
@ 2018-11-11 12:01 Stefan Wahren
  2018-11-11 16:34 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Wahren @ 2018-11-11 12:01 UTC (permalink / raw)
  To: Eric Anholt, Florian Fainelli, Jean Delvare, Guenter Roeck,
	Greg Kroah-Hartman
  Cc: linux-rpi-kernel, linux-hwmon, linux-kernel, Stefan Wahren

In case an under-voltage happens before probing the driver wont
write the critical warning into the kernel log. So don't init
of last_throttled during probe and fix this issue.

Fixes: 74d1e007915f ("hwmon: Add support for RPi voltage sensor")
Reported-by: "Noralf Trønnes" <noralf@tronnes.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 drivers/hwmon/raspberrypi-hwmon.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/hwmon/raspberrypi-hwmon.c b/drivers/hwmon/raspberrypi-hwmon.c
index be5ba46..0d04572 100644
--- a/drivers/hwmon/raspberrypi-hwmon.c
+++ b/drivers/hwmon/raspberrypi-hwmon.c
@@ -115,7 +115,6 @@ static int rpi_hwmon_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct rpi_hwmon_data *data;
-	int ret;
 
 	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
 	if (!data)
@@ -124,11 +123,6 @@ static int rpi_hwmon_probe(struct platform_device *pdev)
 	/* Parent driver assure that firmware is correct */
 	data->fw = dev_get_drvdata(dev->parent);
 
-	/* Init throttled */
-	ret = rpi_firmware_property(data->fw, RPI_FIRMWARE_GET_THROTTLED,
-				    &data->last_throttled,
-				    sizeof(data->last_throttled));
-
 	data->hwmon_dev = devm_hwmon_device_register_with_info(dev, "rpi_volt",
 							       data,
 							       &rpi_chip_info,
-- 
2.7.4

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

* Re: [PATCH] hwmon: rpi: Fix initial notify
  2018-11-11 12:01 [PATCH] hwmon: rpi: Fix initial notify Stefan Wahren
@ 2018-11-11 16:34 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2018-11-11 16:34 UTC (permalink / raw)
  To: Stefan Wahren
  Cc: Eric Anholt, Florian Fainelli, Jean Delvare, Greg Kroah-Hartman,
	linux-rpi-kernel, linux-hwmon, linux-kernel

On Sun, Nov 11, 2018 at 01:01:11PM +0100, Stefan Wahren wrote:
> In case an under-voltage happens before probing the driver wont
> write the critical warning into the kernel log. So don't init
> of last_throttled during probe and fix this issue.
> 
> Fixes: 74d1e007915f ("hwmon: Add support for RPi voltage sensor")
> Reported-by: "Noralf Trønnes" <noralf@tronnes.org>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/raspberrypi-hwmon.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/hwmon/raspberrypi-hwmon.c b/drivers/hwmon/raspberrypi-hwmon.c
> index be5ba46..0d04572 100644
> --- a/drivers/hwmon/raspberrypi-hwmon.c
> +++ b/drivers/hwmon/raspberrypi-hwmon.c
> @@ -115,7 +115,6 @@ static int rpi_hwmon_probe(struct platform_device *pdev)
>  {
>  	struct device *dev = &pdev->dev;
>  	struct rpi_hwmon_data *data;
> -	int ret;
>  
>  	data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
>  	if (!data)
> @@ -124,11 +123,6 @@ static int rpi_hwmon_probe(struct platform_device *pdev)
>  	/* Parent driver assure that firmware is correct */
>  	data->fw = dev_get_drvdata(dev->parent);
>  
> -	/* Init throttled */
> -	ret = rpi_firmware_property(data->fw, RPI_FIRMWARE_GET_THROTTLED,
> -				    &data->last_throttled,
> -				    sizeof(data->last_throttled));
> -
>  	data->hwmon_dev = devm_hwmon_device_register_with_info(dev, "rpi_volt",
>  							       data,
>  							       &rpi_chip_info,
> -- 
> 2.7.4
> 

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

end of thread, other threads:[~2018-11-12  2:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-11 12:01 [PATCH] hwmon: rpi: Fix initial notify Stefan Wahren
2018-11-11 16:34 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).