Message ID | 20240730225339.13165-1-amishin@t-argos.ru |
---|---|
State | Accepted |
Commit | 07442c46abad1d50ac82af5e0f9c5de2732c4592 |
Headers | show |
Series | [v2] ACPI / PMIC: Remove unneeded check in tps68470_pmic_opregion_probe() | expand |
On Wed, Jul 31, 2024 at 12:57 AM Aleksandr Mishin <amishin@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. FWIW, Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> P.S. In case the first version is already applied feel free to use the above tag for the modifications that lead to the code as after this patch.
diff --git a/drivers/acpi/pmic/tps68470_pmic.c b/drivers/acpi/pmic/tps68470_pmic.c index ebd03e472955..0d1a82eeb4b0 100644 --- a/drivers/acpi/pmic/tps68470_pmic.c +++ b/drivers/acpi/pmic/tps68470_pmic.c @@ -376,10 +376,8 @@ static int tps68470_pmic_opregion_probe(struct platform_device *pdev) struct tps68470_pmic_opregion *opregion; acpi_status status; - if (!dev || !tps68470_regmap) { - dev_warn(dev, "dev or regmap is NULL\n"); - return -EINVAL; - } + if (!tps68470_regmap) + return dev_err_probe(dev, -EINVAL, "regmap is missing\n"); if (!handle) { dev_warn(dev, "acpi handle is NULL\n");