greybus: uart: Create separate module
Create separate module for uart gpbridge driver. Tested on EVT 1.5 by inserting GP test module, all the devices were enumerated correctly. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Родитель
bebc013baf
Коммит
66b9e09e28
|
@ -15,7 +15,6 @@ greybus-y := core.o \
|
|||
legacy.o
|
||||
|
||||
gb-phy-y := gpbridge.o \
|
||||
uart.o \
|
||||
usb.o
|
||||
|
||||
# Prefix all modules with gb-
|
||||
|
@ -37,6 +36,7 @@ gb-camera-y := camera.o
|
|||
gb-firmware-y := fw-core.o fw-download.o
|
||||
gb-spi-y := spi.o
|
||||
gb-sdio-y := sdio.o
|
||||
gb-uart-y := uart.o
|
||||
gb-pwm-y := pwm.o
|
||||
gb-gpio-y := gpio.o
|
||||
gb-i2c-y := i2c.o
|
||||
|
@ -64,6 +64,7 @@ obj-m += gb-audio-manager.o
|
|||
obj-m += gb-firmware.o
|
||||
obj-m += gb-spi.o
|
||||
obj-m += gb-sdio.o
|
||||
obj-m += gb-uart.o
|
||||
obj-m += gb-pwm.o
|
||||
obj-m += gb-gpio.o
|
||||
obj-m += gb-i2c.o
|
||||
|
|
|
@ -317,10 +317,6 @@ static int __init gpbridge_init(void)
|
|||
goto error_gpbridge;
|
||||
}
|
||||
|
||||
if (gb_uart_driver_init()) {
|
||||
pr_err("error initializing uart driver\n");
|
||||
goto error_uart;
|
||||
}
|
||||
if (gb_usb_driver_init()) {
|
||||
pr_err("error initializing usb driver\n");
|
||||
goto error_usb;
|
||||
|
@ -329,8 +325,6 @@ static int __init gpbridge_init(void)
|
|||
return 0;
|
||||
|
||||
error_usb:
|
||||
gb_uart_driver_exit();
|
||||
error_uart:
|
||||
greybus_deregister(&gb_gpbridge_driver);
|
||||
error_gpbridge:
|
||||
bus_unregister(&gpbridge_bus_type);
|
||||
|
@ -342,7 +336,6 @@ module_init(gpbridge_init);
|
|||
static void __exit gpbridge_exit(void)
|
||||
{
|
||||
gb_usb_driver_exit();
|
||||
gb_uart_driver_exit();
|
||||
|
||||
greybus_deregister(&gb_gpbridge_driver);
|
||||
bus_unregister(&gpbridge_bus_type);
|
||||
|
|
|
@ -66,9 +66,6 @@ void gb_##__driver##_exit(void) \
|
|||
gb_gpbridge_deregister(&__driver); \
|
||||
}
|
||||
|
||||
extern int gb_uart_driver_init(void);
|
||||
extern void gb_uart_driver_exit(void);
|
||||
|
||||
extern int gb_usb_driver_init(void);
|
||||
extern void gb_usb_driver_exit(void);
|
||||
|
||||
|
|
|
@ -804,6 +804,7 @@ static const struct gpbridge_device_id gb_uart_id_table[] = {
|
|||
{ GPBRIDGE_PROTOCOL(GREYBUS_PROTOCOL_UART) },
|
||||
{ },
|
||||
};
|
||||
MODULE_DEVICE_TABLE(gpbridge, gb_uart_id_table);
|
||||
|
||||
static struct gpbridge_driver uart_driver = {
|
||||
.name = "uart",
|
||||
|
@ -812,7 +813,7 @@ static struct gpbridge_driver uart_driver = {
|
|||
.id_table = gb_uart_id_table,
|
||||
};
|
||||
|
||||
int gb_uart_driver_init(void)
|
||||
static int gb_uart_driver_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
@ -828,9 +829,13 @@ int gb_uart_driver_init(void)
|
|||
|
||||
return 0;
|
||||
}
|
||||
module_init(gb_uart_driver_init);
|
||||
|
||||
void gb_uart_driver_exit(void)
|
||||
static void gb_uart_driver_exit(void)
|
||||
{
|
||||
gb_gpbridge_deregister(&uart_driver);
|
||||
gb_tty_exit();
|
||||
}
|
||||
|
||||
module_exit(gb_uart_driver_exit);
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
|
Загрузка…
Ссылка в новой задаче