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  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:   Sun, 31 Oct 2021 01:10:05 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Hans de Goede <hdegoede@...hat.com>
Cc:     Mark Gross <markgross@...nel.org>,
        Andy Shevchenko <andy@...radead.org>,
        Wolfram Sang <wsa@...-dreams.de>,
        Sebastian Reichel <sre@...nel.org>,
        MyungJoo Ham <myungjoo.ham@...sung.com>,
        Chanwoo Choi <cw00.choi@...sung.com>,
        Ard Biesheuvel <ardb@...nel.org>,
        Yauhen Kharuzhy <jekhor@...il.com>,
        Tsuchiya Yuto <kitakar@...il.com>,
        Platform Driver <platform-driver-x86@...r.kernel.org>,
        linux-i2c <linux-i2c@...r.kernel.org>,
        Linux PM <linux-pm@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-efi <linux-efi@...r.kernel.org>
Subject: Re: [PATCH 09/13] power: supply: bq25890: Add bq25890_set_otg_cfg() helper

On Sat, Oct 30, 2021 at 9:28 PM Hans de Goede <hdegoede@...hat.com> wrote:
>
> Add a bq25890_set_otg_cfg() helper function, this is a preparation
> patch for adding regulator support.

...

>         switch (bq->usb_event) {
>         case USB_EVENT_ID:
>                 /* Enable boost mode */
> -               ret = bq25890_field_write(bq, F_OTG_CFG, 1);
> -               if (ret < 0)
> -                       goto error;
> +               bq25890_set_otg_cfg(bq, 1);
>                 break;
>
>         case USB_EVENT_NONE:
>                 /* Disable boost mode */
> -               ret = bq25890_field_write(bq, F_OTG_CFG, 0);
> -               if (ret < 0)
> -                       goto error;
> -
> -               power_supply_changed(bq->charger);
> +               ret = bq25890_set_otg_cfg(bq, 0);
> +               if (ret == 0)
> +                       power_supply_changed(bq->charger);
>                 break;
>         }

While at it,

default:
 break;

?

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists