Re: [PATCH v3 1/4] tty: serial_mctrl_gpio: Add irqs helpers for input lines

Alexander Shiyan shc_work at mail.ru
Thu Feb 12 05:45:18 PST 2015


Четверг, 12 февраля 2015, 14:29 +01:00 от Uwe Kleine-König <u.kleine-koenig at pengutronix.de>:
...
> > +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.

---



More information about the linux-arm-kernel mailing list