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]
Message-ID: <CAHp75VfrROx1oM54x1Bc8+zLkPi6-ivxPtFS2ECyPPLKsYFd1g@mail.gmail.com>
Date:   Tue, 5 Jul 2022 20:56:16 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Vincent Knecht <vincent.knecht@...loo.org>
Cc:     Pavel Machek <pavel@....cz>, Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Linux LED Subsystem <linux-leds@...r.kernel.org>,
        devicetree <devicetree@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        ~postmarketos/upstreaming@...ts.sr.ht, phone-devel@...r.kernel.org,
        "H. Nikolaus Schaller" <hns@...delico.com>
Subject: Re: [PATCH v3 6/6] leds: is31fl319x: Add support for is31fl319{0,1,3} chips

On Tue, Jul 5, 2022 at 6:32 PM Vincent Knecht <vincent.knecht@...loo.org> wrote:
>
> Set specific chipset structs values for is31fl319{0,1,3}
> so that those chips can actually work.
> Datasheets:
> https://lumissil.com/assets/pdf/core/IS31FL3190_DS.pdf
> https://lumissil.com/assets/pdf/core/IS31FL3191_DS.pdf
> https://lumissil.com/assets/pdf/core/IS31FL3193_DS.pdf
> https://lumissil.com/assets/pdf/core/IS31FL3196_DS.pdf
> https://lumissil.com/assets/pdf/core/IS31FL3199_DS.pdf

...

Two comments as per previous patch reviews.

...

> +       struct is31fl319x_led *led = container_of(cdev, struct is31fl319x_led,
> +                                                 cdev);

One line?

...

> +               ret = regmap_read(is31->regmap, IS31FL3190_PWM(i), &pwm_value);

> +               dev_dbg(&is31->client->dev, "%s read %d: ret=%d: %d\n",
> +                       __func__, i, ret, pwm_value);

regmap has tracepoints Do you need to duplicate it with slow printk()?

...

> +static inline int is31fl3190_microamp_to_cs(struct device *dev, u32 microamp)
> +{
> +       switch (microamp) {
> +       case 5000:
> +               return IS31FL3190_CURRENT_5_mA;
> +       case 10000:
> +               return IS31FL3190_CURRENT_10_mA;
> +       case 17500:
> +               return IS31FL3190_CURRENT_17dot5_mA;
> +       case 30000:
> +               return IS31FL3190_CURRENT_30_mA;
> +       case 42000:
> +               return IS31FL3190_CURRENT_42_mA;
> +       default:
> +               dev_warn(dev, "Unsupported current value: %d, using 5000 µA!\n", microamp);
> +       }
> +
> +       return IS31FL3190_CURRENT_5_mA;

It's more consistent to return directly from the default case.

> +}

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ