diff options
| author | Stefan Wahren <stefan.wahren@i2se.com> | 2018-11-11 07:01:11 -0500 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2018-11-13 12:33:32 -0500 |
| commit | 35fdc3902179366489a12cae4cb3ccc3b95f0afe (patch) | |
| tree | 01a6b28f8fcbdb3ff696c3174b15ce37e01793c3 | |
| parent | 70df9ebbd82c794ddfbb49d45b337f18d5588dc2 (diff) | |
hwmon: (raspberrypi) Fix initial notify
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>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
| -rw-r--r-- | drivers/hwmon/raspberrypi-hwmon.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/hwmon/raspberrypi-hwmon.c b/drivers/hwmon/raspberrypi-hwmon.c index be5ba4690895..0d0457245e7d 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) | |||
| 115 | { | 115 | { |
| 116 | struct device *dev = &pdev->dev; | 116 | struct device *dev = &pdev->dev; |
| 117 | struct rpi_hwmon_data *data; | 117 | struct rpi_hwmon_data *data; |
| 118 | int ret; | ||
| 119 | 118 | ||
| 120 | data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); | 119 | data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); |
| 121 | if (!data) | 120 | if (!data) |
| @@ -124,11 +123,6 @@ static int rpi_hwmon_probe(struct platform_device *pdev) | |||
| 124 | /* Parent driver assure that firmware is correct */ | 123 | /* Parent driver assure that firmware is correct */ |
| 125 | data->fw = dev_get_drvdata(dev->parent); | 124 | data->fw = dev_get_drvdata(dev->parent); |
| 126 | 125 | ||
| 127 | /* Init throttled */ | ||
| 128 | ret = rpi_firmware_property(data->fw, RPI_FIRMWARE_GET_THROTTLED, | ||
| 129 | &data->last_throttled, | ||
| 130 | sizeof(data->last_throttled)); | ||
| 131 | |||
| 132 | data->hwmon_dev = devm_hwmon_device_register_with_info(dev, "rpi_volt", | 126 | data->hwmon_dev = devm_hwmon_device_register_with_info(dev, "rpi_volt", |
| 133 | data, | 127 | data, |
| 134 | &rpi_chip_info, | 128 | &rpi_chip_info, |
