diff --git a/drivers/staging/greybus/Makefile b/drivers/staging/greybus/Makefile index bffb1bdb6b6c..61d4ca9d944f 100644 --- a/drivers/staging/greybus/Makefile +++ b/drivers/staging/greybus/Makefile @@ -16,7 +16,6 @@ greybus-y := core.o \ gb-phy-y := gpbridge.o \ uart.o \ - spi.o \ usb.o # Prefix all modules with gb- @@ -36,6 +35,7 @@ gb-audio-manager-y += audio_manager.o gb-audio-manager-y += audio_manager_module.o 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-pwm-y := pwm.o gb-gpio-y := gpio.o @@ -62,6 +62,7 @@ obj-m += gb-audio-gb.o obj-m += gb-audio-apbridgea.o obj-m += gb-audio-manager.o obj-m += gb-firmware.o +obj-m += gb-spi.o obj-m += gb-sdio.o obj-m += gb-pwm.o obj-m += gb-gpio.o diff --git a/drivers/staging/greybus/gpbridge.c b/drivers/staging/greybus/gpbridge.c index d5ccdc4c9003..2425df7a9ebb 100644 --- a/drivers/staging/greybus/gpbridge.c +++ b/drivers/staging/greybus/gpbridge.c @@ -325,15 +325,9 @@ static int __init gpbridge_init(void) pr_err("error initializing usb driver\n"); goto error_usb; } - if (gb_spi_driver_init()) { - pr_err("error initializing spi driver\n"); - goto error_spi; - } return 0; -error_spi: - gb_usb_driver_exit(); error_usb: gb_uart_driver_exit(); error_uart: @@ -347,7 +341,6 @@ module_init(gpbridge_init); static void __exit gpbridge_exit(void) { - gb_spi_driver_exit(); gb_usb_driver_exit(); gb_uart_driver_exit(); diff --git a/drivers/staging/greybus/gpbridge.h b/drivers/staging/greybus/gpbridge.h index 44d4781a5444..4fff2a6048ff 100644 --- a/drivers/staging/greybus/gpbridge.h +++ b/drivers/staging/greybus/gpbridge.h @@ -72,9 +72,6 @@ extern void gb_uart_driver_exit(void); extern int gb_usb_driver_init(void); extern void gb_usb_driver_exit(void); -extern int gb_spi_driver_init(void); -extern void gb_spi_driver_exit(void); - /** * module_gpbridge_driver() - Helper macro for registering a gpbridge driver * @__gpbridge_driver: gpbridge_driver structure diff --git a/drivers/staging/greybus/spi.c b/drivers/staging/greybus/spi.c index dc811b142432..6cf18d179a75 100644 --- a/drivers/staging/greybus/spi.c +++ b/drivers/staging/greybus/spi.c @@ -550,6 +550,7 @@ static const struct gpbridge_device_id gb_spi_id_table[] = { { GPBRIDGE_PROTOCOL(GREYBUS_PROTOCOL_SPI) }, { }, }; +MODULE_DEVICE_TABLE(gpbridge, gb_spi_id_table); static struct gpbridge_driver spi_driver = { .name = "spi", @@ -557,4 +558,6 @@ static struct gpbridge_driver spi_driver = { .remove = gb_spi_remove, .id_table = gb_spi_id_table, }; -gb_gpbridge_builtin_driver(spi_driver); + +module_gpbridge_driver(spi_driver); +MODULE_LICENSE("GPL v2");