Re: [PATCH v4 3/4] serial: mctrl_gpio: enable API usage only for initialized mctrl_gpios struct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Peter,

On Mon, May 23, 2016 at 11:02:53AM -0700, Peter Hurley wrote:
> On 05/23/2016 02:09 AM, Uwe Kleine-König wrote:
> >>  	gpios->port = port;
> >> >  
> >> > @@ -193,7 +202,7 @@ struct mctrl_gpios *mctrl_gpio_init(struct uart_port *port, unsigned int idx)
> >> >  			dev_err(port->dev,
> >> >  				"failed to find corresponding irq for %s (idx=%d, err=%d)\n",
> >> >  				mctrl_gpios_desc[i].name, idx, ret);
> >> > -			return ERR_PTR(ret);
> >> > +			return NULL;
> > 
> > Ditto, if a GPIO is used as handshake line and it doesn't have a
> > corresponding irq, polling must be set up instead of simply ignoring the
> > missing irq.
> 
> I agree that none of the "return NULL" changes are necessary.
> 
> However, note that it's not really possible to recover here by polling;
> some of the gpios may have been claimed and some not when the irq
> claim failure occurs.
> How to know which gpios were claimed?

I don't understand this. You cannot recover if a GPIO is used by a
different driver/device. If a given GPIO doesn't support triggering an
irq, polling can help, it must of course be implemented correctly.
And if gpio_mctrl implements this (which is the right thing to do, as it
is independant from the actual driver) all necessary knowledge is there.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux