lkml.org 
[lkml]   [2014]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] USB: ftdi_sio: add GPIO support
    >  #include <linux/kernel.h>
    > #include <linux/errno.h>
    > +#ifdef CONFIG_GPIOLIB
    > +#include <linux/gpio.h>
    > +#endif


    Please create a new struct, a new file and put all the GPIO stuff in
    there rather than #if bombing the driver.

    You can then declare blank methods for the gpio stuff if GPIO is not
    compiled in - ie in the headers


    #ifdef CONFIG_GPIOLIB
    extern int ftdi_gpio_open(struct ftdi_private *priv);
    etc...
    #else
    extern inline int ftdi_gpio_open(struct ftdi_private *priv) { return 0 };
    #endif


    that keeps the code itself clean and easy to read and also ensures all
    the types are checked everywhere we want.

    Functionality wise nothing stands out as a problem. I would expect -EBUSY
    not -ENXIO if the port was being used for GPIO so could not be used for
    tty.

    I would favour the new config option.

    Alan


    \
     
     \ /
      Last update: 2014-06-09 17:01    [W:2.288 / U:0.456 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site