* [PATCH 1/2] platform/x86: dell-ddv: Improve error handling
@ 2023-07-07 1:03 Armin Wolf
2023-07-07 1:03 ` [PATCH 2/2] platform/x86: dell-ddv: Fix mangled list in documentation Armin Wolf
2023-07-11 10:07 ` [PATCH 1/2] platform/x86: dell-ddv: Improve error handling Hans de Goede
0 siblings, 2 replies; 3+ messages in thread
From: Armin Wolf @ 2023-07-07 1:03 UTC (permalink / raw)
To: hdegoede, markgross
Cc: jdelvare, linux, platform-driver-x86, linux-hwmon, linux-kernel
If for some reason a external function returns -ENODEV,
no error message is being displayed because the driver
assumes that -ENODEV can only be returned internally if
no sensors, etc where found.
Fix this by explicitly returning 0 in such a case since
missing hardware is no error. Also remove the now obsolete
check for -ENODEV.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
drivers/platform/x86/dell/dell-wmi-ddv.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/platform/x86/dell/dell-wmi-ddv.c b/drivers/platform/x86/dell/dell-wmi-ddv.c
index 2750dee99c3e..db1e9240dd02 100644
--- a/drivers/platform/x86/dell/dell-wmi-ddv.c
+++ b/drivers/platform/x86/dell/dell-wmi-ddv.c
@@ -616,7 +616,8 @@ static int dell_wmi_ddv_hwmon_add(struct dell_wmi_ddv_data *data)
}
if (index < 2) {
- ret = -ENODEV;
+ /* Finding no available sensors is not an error */
+ ret = 0;
goto err_release;
}
@@ -841,13 +842,13 @@ static int dell_wmi_ddv_probe(struct wmi_device *wdev, const void *context)
if (IS_REACHABLE(CONFIG_ACPI_BATTERY)) {
ret = dell_wmi_ddv_battery_add(data);
- if (ret < 0 && ret != -ENODEV)
+ if (ret < 0)
dev_warn(&wdev->dev, "Unable to register ACPI battery hook: %d\n", ret);
}
if (IS_REACHABLE(CONFIG_HWMON)) {
ret = dell_wmi_ddv_hwmon_add(data);
- if (ret < 0 && ret != -ENODEV)
+ if (ret < 0)
dev_warn(&wdev->dev, "Unable to register hwmon interface: %d\n", ret);
}
--
2.30.2
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH 2/2] platform/x86: dell-ddv: Fix mangled list in documentation
2023-07-07 1:03 [PATCH 1/2] platform/x86: dell-ddv: Improve error handling Armin Wolf
@ 2023-07-07 1:03 ` Armin Wolf
2023-07-11 10:07 ` [PATCH 1/2] platform/x86: dell-ddv: Improve error handling Hans de Goede
1 sibling, 0 replies; 3+ messages in thread
From: Armin Wolf @ 2023-07-07 1:03 UTC (permalink / raw)
To: hdegoede, markgross
Cc: jdelvare, linux, platform-driver-x86, linux-hwmon, linux-kernel
Add missing empty line necessary for sphinx to recognize
the list. Also reword the first entry a little bit.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
Documentation/wmi/devices/dell-wmi-ddv.rst | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Documentation/wmi/devices/dell-wmi-ddv.rst b/Documentation/wmi/devices/dell-wmi-ddv.rst
index d8aa64e9c827..bf963d91dd55 100644
--- a/Documentation/wmi/devices/dell-wmi-ddv.rst
+++ b/Documentation/wmi/devices/dell-wmi-ddv.rst
@@ -187,7 +187,8 @@ WMI method BatteryeRawAnalytics()
Returns a buffer usually containg 12 blocks of analytics data.
Those blocks contain:
-- block number starting with 0 (u8)
+
+- a block number starting with 0 (u8)
- 31 bytes of unknown data
.. note::
--
2.30.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] platform/x86: dell-ddv: Improve error handling
2023-07-07 1:03 [PATCH 1/2] platform/x86: dell-ddv: Improve error handling Armin Wolf
2023-07-07 1:03 ` [PATCH 2/2] platform/x86: dell-ddv: Fix mangled list in documentation Armin Wolf
@ 2023-07-11 10:07 ` Hans de Goede
1 sibling, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2023-07-11 10:07 UTC (permalink / raw)
To: Armin Wolf, markgross
Cc: jdelvare, linux, platform-driver-x86, linux-hwmon, linux-kernel
Hi,
On 7/7/23 03:03, Armin Wolf wrote:
> If for some reason a external function returns -ENODEV,
> no error message is being displayed because the driver
> assumes that -ENODEV can only be returned internally if
> no sensors, etc where found.
> Fix this by explicitly returning 0 in such a case since
> missing hardware is no error. Also remove the now obsolete
> check for -ENODEV.
>
> Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Thank you for your series, I've applied this series to my fixes
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=fixes
I will include this series in my next fixes pull-req to Linus
for the current kernel development cycle.
Regards,
Hans
> ---
> drivers/platform/x86/dell/dell-wmi-ddv.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/platform/x86/dell/dell-wmi-ddv.c b/drivers/platform/x86/dell/dell-wmi-ddv.c
> index 2750dee99c3e..db1e9240dd02 100644
> --- a/drivers/platform/x86/dell/dell-wmi-ddv.c
> +++ b/drivers/platform/x86/dell/dell-wmi-ddv.c
> @@ -616,7 +616,8 @@ static int dell_wmi_ddv_hwmon_add(struct dell_wmi_ddv_data *data)
> }
>
> if (index < 2) {
> - ret = -ENODEV;
> + /* Finding no available sensors is not an error */
> + ret = 0;
>
> goto err_release;
> }
> @@ -841,13 +842,13 @@ static int dell_wmi_ddv_probe(struct wmi_device *wdev, const void *context)
>
> if (IS_REACHABLE(CONFIG_ACPI_BATTERY)) {
> ret = dell_wmi_ddv_battery_add(data);
> - if (ret < 0 && ret != -ENODEV)
> + if (ret < 0)
> dev_warn(&wdev->dev, "Unable to register ACPI battery hook: %d\n", ret);
> }
>
> if (IS_REACHABLE(CONFIG_HWMON)) {
> ret = dell_wmi_ddv_hwmon_add(data);
> - if (ret < 0 && ret != -ENODEV)
> + if (ret < 0)
> dev_warn(&wdev->dev, "Unable to register hwmon interface: %d\n", ret);
> }
>
> --
> 2.30.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-07-11 10:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-07 1:03 [PATCH 1/2] platform/x86: dell-ddv: Improve error handling Armin Wolf
2023-07-07 1:03 ` [PATCH 2/2] platform/x86: dell-ddv: Fix mangled list in documentation Armin Wolf
2023-07-11 10:07 ` [PATCH 1/2] platform/x86: dell-ddv: Improve error handling Hans de Goede
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®