[lvc-project] [PATCH] ACPI / PMIC: Remove unneeded check in tps68470_pmic_opregion_probe()

Andy Shevchenko andy.shevchenko at gmail.com
Tue Jul 30 22:38:35 MSK 2024


On Fri, Jul 5, 2024 at 1:36 PM Aleksandr Mishin <amishin at t-argos.ru> wrote:
>
> In tps68470_pmic_opregion_probe() pointer 'dev' is compared to NULL which
> is useless.
>
> Fix this issue by removing unneeded check.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.

...

> -       if (!dev || !tps68470_regmap) {
> +       if (!tps68470_regmap) {
>                 dev_warn(dev, "dev or regmap is NULL\n");

Now this message is misleading.

>                 return -EINVAL;
>         }

And I dunno why it's a warning and not an error level.

With all above being said, I would recommend to update to

  if (!tps68470_regmap)
    return dev_err_probe(dev, -EINVAL, "regmap is missing\n");

-- 
With Best Regards,
Andy Shevchenko



More information about the lvc-project mailing list