Четверг, 12 февраля 2015, 14:29 +01:00 от Uwe Kleine-König 
<[email protected]>:
...
> > +int mctrl_gpio_request_irqs(struct mctrl_gpios *gpios)
> 
> > +{
> 
> > +   struct uart_port *port = gpios->port;
> 
> > +   int *irq = gpios->irq;
> 
> > +   enum mctrl_gpio_idx i;
> 
> > +   int err = 0;
> 
> > +
> 
> > +   /* When gpios is NULL just gpio irqs are also never set
> 
> > +    * so return without any error */
> 
> > +   if (IS_ERR_OR_NULL(gpios))
> 
> > +           return err;
> 
> I'd expect drivers using mctrl-gpio to error out if mctrl_gpio_init_dt
> 
> fails. Also mctrl_gpio_init_dt never returns NULL, so IMHO this check
> 
> can be dropped. (There are more places in mctrl-gpio that should be
> 
> fixed accordingly.

At least this check should be moved to start of this function due
future usage of gpios->port and gpios->irq.

---

Reply via email to