Re: [PATCH v7] usb:serial:pl2303: add GPIOs interface on PL2303
From: Wang YanQing
Date: Sat Aug 16 2014 - 22:05:54 EST
Hi Johan Hovold.
Another two questions.
On Tue, Aug 12, 2014 at 04:46:25PM +0200, Johan Hovold wrote:
>
> > + int (*gpio_startup)(struct usb_serial *serial);
> > + void (*gpio_release)(struct usb_serial *serial);
>
> This isn't the right place for this abstraction. Most of the setup code
> would be common for any device type with GPIOs.
I assume you mean any pl2303 variant, not any device type, because
no device in drivers/gpio has common setup code except many of them
use struct gpio_chip.
>
> Just keep the generic gpio_startup and release from v6, and verify that
> ngpio > 0. Any further abstraction should only be added once we know how
> the other types handles GPIOs.
Instead of assume code works for all situation firstly, test and write
code for only one type device, and make code become generic when we find
it works for others' type.
I don't known which way is better.
Thanks very much for your patient review !!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/