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

Russell King (Oracle) linux at armlinux.org.uk
Wed Aug 16 03:22:28 PDT 2023


On Wed, Aug 16, 2023 at 11:51:54AM +0200, Yann Sionneau wrote:
> 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?

No.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!



More information about the linux-arm-kernel mailing list