[PATCH -next] I2C: Use helper function IS_ERR_OR_NULL()

Yann Sionneau yann at sionneau.net
Wed Aug 16 02:51:54 PDT 2023


Le 16/08/2023 à 11:46, Ruan Jinjie a écrit :

> Use IS_ERR_OR_NULL() instead of open-coding it
> to simplify the code.
>   
>   	rinfo->pinctrl = devm_pinctrl_get(&pdev->dev);
> -	if (!rinfo->pinctrl || IS_ERR(rinfo->pinctrl)) {
> +	if (IS_ERR_OR_NULL(rinfo->pinctrl)) {

Can the return of devm_pinctrl_get really be NULL?

Regards,

-- 

Yann




More information about the linux-arm-kernel mailing list