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>
legacy.o
gb-phy-y := gpbridge.o \
- uart.o \
usb.o
# Prefix all modules with gb-
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
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
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;
return 0;
error_usb:
- gb_uart_driver_exit();
-error_uart:
greybus_deregister(&gb_gpbridge_driver);
error_gpbridge:
bus_unregister(&gpbridge_bus_type);
static void __exit gpbridge_exit(void)
{
gb_usb_driver_exit();
- gb_uart_driver_exit();
greybus_deregister(&gb_gpbridge_driver);
bus_unregister(&gpbridge_bus_type);
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);
{ GPBRIDGE_PROTOCOL(GREYBUS_PROTOCOL_UART) },
{ },
};
+MODULE_DEVICE_TABLE(gpbridge, gb_uart_id_table);
static struct gpbridge_driver uart_driver = {
.name = "uart",
.id_table = gb_uart_id_table,
};
-int gb_uart_driver_init(void)
+static int gb_uart_driver_init(void)
{
int ret;
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");