Re: [PATCH v2 4/4] power: supply: test-power: implement charge_behaviour property

From: Sebastian Reichel
Date: Tue Mar 05 2024 - 19:39:49 EST


Hi,

On Sun, Mar 03, 2024 at 04:31:16PM +0100, Thomas Weißschuh wrote:
> To validate the special formatting of the "charge_behaviour" sysfs
> property add it to the example driver.
>
> Signed-off-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
> ---

Thanks for your patch.

> drivers/power/supply/test_power.c | 31 +++++++++++++++++++++++++++++++
> 1 file changed, 31 insertions(+)
>

[...]

> +static int test_power_set_battery_property(struct power_supply *psy,
> + enum power_supply_property psp,
> + const union power_supply_propval *val)
> +{
> + switch (psp) {
> + case POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR:
> + battery_charge_behaviour = val->intval;
> + break;

This should check if user supplied val->intval is valid, otherwise
LGTM.

-- Sebastian

Attachment: signature.asc
Description: PGP signature