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]

 



On 05/23/2016 02:49 AM, Uwe Kleine-König wrote:
> Hello Yegor,
> 
> On Mon, May 23, 2016 at 11:40:44AM +0200, Yegor Yefremov wrote:
>>> With the same reasoning that gpiod_get_optional returns -ENOSYS without
>>> GPIOLIB, this also should return -ENOSYS.
>>
>> OK. What do think about such workaround in
>> drivers/tty/serial/8250/8250_core.c for not breaking the UART
>> initialization, when GPIOLIB is disabled?
>>
>> if (IS_ERR(uart->gpios) && IS_ENABLED(CONFIG_GPIOLIB))
>>         return real error;

Don't assign uart->gpios directly.

	gpios = mctrl_gpio_init(&uart->port, 0);
	if (IS_ERR(gpios)) {
		if (PTR_ERR(gpios) != -ENOSYS)
			return PTR_ERR(gpios);
	} else
		mctrl->gpios = gpios;


> If your 8250 has a rts gpio specified in the device tree, what do you
> expect from a kernel without GPIOLIB support?
> 
> If it's important that RTS is setup correctly, you should return
> failure above. If it's not important that RTS is handled correctly, then
> think again what this implies for a GPIOLIB=y .config. Can you just drop
> RTS handling then?

I want to emit a diagnostic for:
1. an actual resource acquisition error
2. a misconfiguration

The driver should fail probe for actual resource acquisition error.
The driver should continue anyway for misconfiguration with mctrl
gpio api calls nop'd.

Regards,
Peter Hurley

--
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