lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 11 Apr 2022 17:08:58 +0200 (CEST)
From:   Jiri Kosina <jikos@...nel.org>
To:     Bastien Nocera <hadess@...ess.net>
cc:     linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
        Benjamin Tissoires <benjamin.tissoires@...hat.com>,
        Ping Cheng <ping.cheng@...om.com>,
        Jason Gerecke <jason.gerecke@...om.com>
Subject: Re: [PATCH] HID: wacom: Correct power_supply type

On Thu, 7 Apr 2022, Bastien Nocera wrote:

> POWER_SUPPLY_TYPE_USB seems to only ever be used by USB ports that are
> used to charge the machine itself (so a "system" scope), like the
> single USB port on a phone, rather than devices.
> 
> The wacom_sys driver is the only driver that sets its device battery as
> being a USB type, which doesn't seem correct based on its usage, so
> switch it to be a battery type like all the other USB-connected devices.
> 
> Signed-off-by: Bastien Nocera <hadess@...ess.net>
> ---
>  drivers/hid/wacom_sys.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
> index 066c567dbaa2..620fe74f5676 100644
> --- a/drivers/hid/wacom_sys.c
> +++ b/drivers/hid/wacom_sys.c
> @@ -1777,7 +1777,7 @@ static int __wacom_initialize_battery(struct wacom *wacom,
>  	bat_desc->get_property = wacom_battery_get_property;
>  	sprintf(battery->bat_name, "wacom_battery_%ld", n);
>  	bat_desc->name = battery->bat_name;
> -	bat_desc->type = POWER_SUPPLY_TYPE_USB;
> +	bat_desc->type = POWER_SUPPLY_TYPE_BATTERY;
>  	bat_desc->use_for_apm = 0;
>  
>  	ps_bat = devm_power_supply_register(dev, bat_desc, &psy_cfg);

Thanks Bastien, makes sense. CCing Jason and Ping (the Wacom driver 
maintainers) to get their Ack.

-- 
Jiri Kosina
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ