diff mbox series

[2/2] platform/x86: huawei-wmi: No need to check for battery name

Message ID 20191018224221.15495-2-ayman.bagabas@gmail.com (mailing list archive)
State Changes Requested, archived
Headers show
Series [1/2] platform/x86: huawei-wmi: Stricter battery thresholds set | expand

Commit Message

Ayman Bagabas Oct. 18, 2019, 10:42 p.m. UTC
No need to check for battery name, we already check if the WMI function is
available in huawei_wmi_battery_setup.
---
 drivers/platform/x86/huawei-wmi.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Ayman Bagabas Oct. 20, 2019, 12:33 a.m. UTC | #1
On Fri, 2019-10-18 at 18:42 -0400, Ayman Bagabas wrote:
> No need to check for battery name, we already check if the WMI
> function is
> available in huawei_wmi_battery_setup.

Signed-off-by: Ayman Bagabas <ayman.bagabas@gmail.com>

Thank you,
Ayman
> ---
>  drivers/platform/x86/huawei-wmi.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/platform/x86/huawei-wmi.c
> b/drivers/platform/x86/huawei-wmi.c
> index 26041d44286a..7373a65a61d3 100644
> --- a/drivers/platform/x86/huawei-wmi.c
> +++ b/drivers/platform/x86/huawei-wmi.c
> @@ -471,10 +471,6 @@ static
> DEVICE_ATTR_RW(charge_control_thresholds);
>  
>  static int huawei_wmi_battery_add(struct power_supply *battery)
>  {
> -	/* Huawei laptops come with one battery only */
> -	if (strcmp(battery->desc->name, "BAT") != 1)
> -		return -ENODEV;
> -
>  	device_create_file(&battery->dev,
> &dev_attr_charge_control_start_threshold);
>  	device_create_file(&battery->dev,
> &dev_attr_charge_control_end_threshold);
>
diff mbox series

Patch

diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c
index 26041d44286a..7373a65a61d3 100644
--- a/drivers/platform/x86/huawei-wmi.c
+++ b/drivers/platform/x86/huawei-wmi.c
@@ -471,10 +471,6 @@  static DEVICE_ATTR_RW(charge_control_thresholds);
 
 static int huawei_wmi_battery_add(struct power_supply *battery)
 {
-	/* Huawei laptops come with one battery only */
-	if (strcmp(battery->desc->name, "BAT") != 1)
-		return -ENODEV;
-
 	device_create_file(&battery->dev, &dev_attr_charge_control_start_threshold);
 	device_create_file(&battery->dev, &dev_attr_charge_control_end_threshold);