mirror of https://gitee.com/openkylin/linux.git
greybus: usb: Create separate module
Create separate module for usb 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:
parent
66b9e09e28
commit
ea7c47771b
|
@ -14,8 +14,7 @@ greybus-y := core.o \
|
|||
operation.o \
|
||||
legacy.o
|
||||
|
||||
gb-phy-y := gpbridge.o \
|
||||
usb.o
|
||||
gb-phy-y := gpbridge.o
|
||||
|
||||
# Prefix all modules with gb-
|
||||
gb-vibrator-y := vibrator.o
|
||||
|
@ -40,6 +39,7 @@ gb-uart-y := uart.o
|
|||
gb-pwm-y := pwm.o
|
||||
gb-gpio-y := gpio.o
|
||||
gb-i2c-y := i2c.o
|
||||
gb-usb-y := usb.o
|
||||
|
||||
obj-m += greybus.o
|
||||
obj-m += gb-phy.o
|
||||
|
@ -68,6 +68,7 @@ obj-m += gb-uart.o
|
|||
obj-m += gb-pwm.o
|
||||
obj-m += gb-gpio.o
|
||||
obj-m += gb-i2c.o
|
||||
obj-m += gb-usb.o
|
||||
|
||||
KERNELVER ?= $(shell uname -r)
|
||||
KERNELDIR ?= /lib/modules/$(KERNELVER)/build
|
||||
|
|
|
@ -317,15 +317,8 @@ static int __init gpbridge_init(void)
|
|||
goto error_gpbridge;
|
||||
}
|
||||
|
||||
if (gb_usb_driver_init()) {
|
||||
pr_err("error initializing usb driver\n");
|
||||
goto error_usb;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error_usb:
|
||||
greybus_deregister(&gb_gpbridge_driver);
|
||||
error_gpbridge:
|
||||
bus_unregister(&gpbridge_bus_type);
|
||||
ida_destroy(&gpbridge_id);
|
||||
|
@ -335,8 +328,6 @@ module_init(gpbridge_init);
|
|||
|
||||
static void __exit gpbridge_exit(void)
|
||||
{
|
||||
gb_usb_driver_exit();
|
||||
|
||||
greybus_deregister(&gb_gpbridge_driver);
|
||||
bus_unregister(&gpbridge_bus_type);
|
||||
ida_destroy(&gpbridge_id);
|
||||
|
|
|
@ -66,9 +66,6 @@ void gb_##__driver##_exit(void) \
|
|||
gb_gpbridge_deregister(&__driver); \
|
||||
}
|
||||
|
||||
extern int gb_usb_driver_init(void);
|
||||
extern void gb_usb_driver_exit(void);
|
||||
|
||||
/**
|
||||
* module_gpbridge_driver() - Helper macro for registering a gpbridge driver
|
||||
* @__gpbridge_driver: gpbridge_driver structure
|
||||
|
|
|
@ -242,6 +242,7 @@ static const struct gpbridge_device_id gb_usb_id_table[] = {
|
|||
{ GPBRIDGE_PROTOCOL(GREYBUS_PROTOCOL_USB) },
|
||||
{ },
|
||||
};
|
||||
MODULE_DEVICE_TABLE(gpbridge, gb_usb_id_table);
|
||||
|
||||
static struct gpbridge_driver usb_driver = {
|
||||
.name = "usb",
|
||||
|
@ -249,4 +250,6 @@ static struct gpbridge_driver usb_driver = {
|
|||
.remove = gb_usb_remove,
|
||||
.id_table = gb_usb_id_table,
|
||||
};
|
||||
gb_gpbridge_builtin_driver(usb_driver);
|
||||
|
||||
module_gpbridge_driver(usb_driver);
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
|
Loading…
Reference in New Issue