Re: [PATCH v3] serial: 8250: add gpio support to exar

From: One Thousand Gnomes
Date: Sun Dec 20 2015 - 12:29:45 EST


> > If you are linking it into the driver you don't need the module_init/exit
> > gpio_init/exit methods. Your Kconfig becomes a bool and you combine the
> > file into the driver based upon that bool.
>
> But isn't it better to have the gpio code separete from the 8250 code?
> But how do i combine a file? is it like:
>
> #ifdef SERIAL_8250_EXAR_GPIO
> #include "8250_gpio.c"
> #endif
>
> or should it be:
>
> #ifdef SERIAL_8250_EXAR_GPIO
>
> all c code
>
> #endif

Neither of the above. Take a look how other parts of the kernel combine
multiple files into a single module. It's supported by the
Kconfig/Makefile system, and they will get linked together as a single
binary while being separate sources.

For an example look at drivers/tty/ipwireless



Alan

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