Re: [PATCH] spmi: pmic-arb: Replace three IS_ERR() calls by null pointer checks in spmi_pmic_arb_probe()

From: David Collins
Date: Mon Feb 05 2024 - 18:43:24 EST


On 2/4/24 01:24, Markus Elfring wrote:
> From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
> Date: Sun, 4 Feb 2024 09:39:48 +0100
>
> The devm_ioremap() function does not return error pointers.
> It returns NULL on error.
> This issue was detected once more also by using the Coccinelle software.
>
> Update three checks (and corresponding error codes) for failed
> function calls accordingly.
>
> Fixes: ffdfbafdc4f4 ("spmi: Use devm_spmi_controller_alloc()")
> Fixes: 231601cd22bd ("spmi: pmic-arb: Add support for PMIC v7")
> Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
> ---
>
> See also:
> Suggestion by Peng Wu
> [PATCH -next] spmi: pmic-arb: fix a NULL vs IS_ERR() check in spmi_pmic_arb_probe()
> https://lore.kernel.org/lkml/20221115090927.47143-1-wupeng58@xxxxxxxxxx/
> https://lkml.org/lkml/2022/11/15/197
>
>
> drivers/spmi/spmi-pmic-arb.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)

Reviewed-by: David Collins <quic_collinsd@xxxxxxxxxxx>

Thanks for making this fix.

Take care,
David