Subject: [PATCH v4] pwm: vt8500: Update vt8500 PWM driver support

From: [email-masked] (Arnd Bergmann)
Date: Fri, 26 Oct 2012 21:11:56 +0000

On Friday 26 October 2012, Chris Brand wrote:
> > @@ -124,6 +156,12 @@ static int __devinit pwm_probe(struct
> > platform_device *pdev)
> >       chip->chip.base = -1;
> >       chip->chip.npwm = VT8500_NR_PWMS;
> > 
> > +     chip->clk = devm_clk_get(&pdev->dev, NULL);
> > +     if (IS_ERR_OR_NULL(chip->clk)) {
> > +             dev_err(&pdev->dev, "clock source not specified\n");
> > +             return PTR_ERR(chip->clk);
> > +     }
> > +
> 
> Do you want IS_ERR() rather than IS_ERR_OR_NULL() here ?
> Otherwise you may return PTR_ERR(NULL).
> 

Right. devm_clk_get() never returns NULL, but as Russell pointed out
recently, this usage of IS_ERR_OR_NULL() is completely bogus.

	Arnd