Re: [PATCH v2] USB: serial: cp210x: Adding GPIO support for CP2105

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

 



On Thu, Jan 14, 2016 at 10:23:11AM +0000, Martyn Welch wrote:
> On 14/01/16 00:27, Konstantin Shkolnyy wrote:

> >>   static struct usb_serial_driver cp210x_device = {
> >> @@ -219,6 +229,7 @@ static struct usb_serial_driver cp210x_device = {
> >>   	.tx_empty		= cp210x_tx_empty,
> >>   	.tiocmget		= cp210x_tiocmget,
> >>   	.tiocmset		= cp210x_tiocmset,
> >> +	.probe			= cp210x_probe,
> >
> > Enclose this in CONFIG_GPIOLIB?
> > ...
> >
> 
> Can do, though splattering ifdefs all over the driver isn't particularly 
> nice.
> 
> I guess the question I have is: Would the preference be to ifdef out all 
> extraneous functionality when GPIOLIB isn't enabled or to minimise the 
> number of ifdef's at the expense of building in some functionality that 
> wasn't then used?

Try to minimise the ifdefs and use dummy inline functions in case
!CONFIG_GPIOLIB. That way you should not need to add more than two
ifdefs (data + code).

Thanks,
Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux