diff --git a/drivers/staging/greybus/Makefile b/drivers/staging/greybus/Makefile index 61d4ca9d944f..e99a9a83dd8e 100644 --- a/drivers/staging/greybus/Makefile +++ b/drivers/staging/greybus/Makefile @@ -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 diff --git a/drivers/staging/greybus/gpbridge.c b/drivers/staging/greybus/gpbridge.c index 2425df7a9ebb..5a65564dc34c 100644 --- a/drivers/staging/greybus/gpbridge.c +++ b/drivers/staging/greybus/gpbridge.c @@ -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); diff --git a/drivers/staging/greybus/gpbridge.h b/drivers/staging/greybus/gpbridge.h index 4fff2a6048ff..532dd5682f02 100644 --- a/drivers/staging/greybus/gpbridge.h +++ b/drivers/staging/greybus/gpbridge.h @@ -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); diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c index 0d8fcb55d9aa..aa28ce5c4fb0 100644 --- a/drivers/staging/greybus/uart.c +++ b/drivers/staging/greybus/uart.c @@ -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");