From c7b07265046b5db56778dc8c2cfc9056413ec5ba Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 28 Feb 2016 14:42:54 -0800 Subject: [PATCH] greybus: gpbridge.h: move protocol init/exit prototypes Create gpbridge.h for the gpbridge-specific function prototypes, the rest of the greybus drivers don't care about them. Signed-off-by: Greg Kroah-Hartman Reviewed-by: Viresh Kumar Reviewed-by: Johan Hovold --- drivers/staging/greybus/gpbridge.c | 2 +- drivers/staging/greybus/gpbridge.h | 34 ++++++++++++++++++++++++++++++ drivers/staging/greybus/gpio.c | 1 + drivers/staging/greybus/i2c.c | 1 + drivers/staging/greybus/protocol.h | 26 ----------------------- drivers/staging/greybus/pwm.c | 1 + drivers/staging/greybus/sdio.c | 1 + drivers/staging/greybus/spi.c | 1 + drivers/staging/greybus/uart.c | 1 + drivers/staging/greybus/usb.c | 1 + 10 files changed, 42 insertions(+), 27 deletions(-) create mode 100644 drivers/staging/greybus/gpbridge.h diff --git a/drivers/staging/greybus/gpbridge.c b/drivers/staging/greybus/gpbridge.c index 29f0984f7213..c82ded14846d 100644 --- a/drivers/staging/greybus/gpbridge.c +++ b/drivers/staging/greybus/gpbridge.c @@ -17,7 +17,7 @@ #include #include "greybus.h" - +#include "gpbridge.h" static int __init gpbridge_init(void) { diff --git a/drivers/staging/greybus/gpbridge.h b/drivers/staging/greybus/gpbridge.h new file mode 100644 index 000000000000..50ee87b8f737 --- /dev/null +++ b/drivers/staging/greybus/gpbridge.h @@ -0,0 +1,34 @@ +/* + * Greybus GPBridge phy driver + * + * Copyright 2016 Google Inc. + * + * Released under the GPLv2 only. + */ + +#ifndef __GPBRIDGE_H +#define __GPBRIDGE_H + +extern int gb_gpio_protocol_init(void); +extern void gb_gpio_protocol_exit(void); + +extern int gb_pwm_protocol_init(void); +extern void gb_pwm_protocol_exit(void); + +extern int gb_uart_protocol_init(void); +extern void gb_uart_protocol_exit(void); + +extern int gb_sdio_protocol_init(void); +extern void gb_sdio_protocol_exit(void); + +extern int gb_usb_protocol_init(void); +extern void gb_usb_protocol_exit(void); + +extern int gb_i2c_protocol_init(void); +extern void gb_i2c_protocol_exit(void); + +extern int gb_spi_protocol_init(void); +extern void gb_spi_protocol_exit(void); + +#endif /* __GPBRIDGE_H */ + diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c index e7dd99444ea2..7b2cb5d81e54 100644 --- a/drivers/staging/greybus/gpio.c +++ b/drivers/staging/greybus/gpio.c @@ -16,6 +16,7 @@ #include #include "greybus.h" +#include "gpbridge.h" struct gb_gpio_line { /* The following has to be an array of line_max entries */ diff --git a/drivers/staging/greybus/i2c.c b/drivers/staging/greybus/i2c.c index cb68b455f833..4b96f69318bd 100644 --- a/drivers/staging/greybus/i2c.c +++ b/drivers/staging/greybus/i2c.c @@ -13,6 +13,7 @@ #include #include "greybus.h" +#include "gpbridge.h" struct gb_i2c_device { struct gb_connection *connection; diff --git a/drivers/staging/greybus/protocol.h b/drivers/staging/greybus/protocol.h index 26c59efd9ed8..38fe14cf46ce 100644 --- a/drivers/staging/greybus/protocol.h +++ b/drivers/staging/greybus/protocol.h @@ -48,32 +48,6 @@ int gb_protocol_get_version(struct gb_connection *connection); void gb_protocol_put(struct gb_protocol *protocol); -/* - * These are defined in their respective protocol source files. - * Declared here for now. They could be added via modules, or maybe - * just use initcalls (which level?). - */ -extern int gb_gpio_protocol_init(void); -extern void gb_gpio_protocol_exit(void); - -extern int gb_pwm_protocol_init(void); -extern void gb_pwm_protocol_exit(void); - -extern int gb_uart_protocol_init(void); -extern void gb_uart_protocol_exit(void); - -extern int gb_sdio_protocol_init(void); -extern void gb_sdio_protocol_exit(void); - -extern int gb_usb_protocol_init(void); -extern void gb_usb_protocol_exit(void); - -extern int gb_i2c_protocol_init(void); -extern void gb_i2c_protocol_exit(void); - -extern int gb_spi_protocol_init(void); -extern void gb_spi_protocol_exit(void); - /* __protocol: Pointer to struct gb_protocol */ #define gb_protocol_driver(__protocol) \ static int __init protocol_init(void) \ diff --git a/drivers/staging/greybus/pwm.c b/drivers/staging/greybus/pwm.c index c3a3a9dfc6b4..018d5c229070 100644 --- a/drivers/staging/greybus/pwm.c +++ b/drivers/staging/greybus/pwm.c @@ -13,6 +13,7 @@ #include #include "greybus.h" +#include "gpbridge.h" struct gb_pwm_chip { struct gb_connection *connection; diff --git a/drivers/staging/greybus/sdio.c b/drivers/staging/greybus/sdio.c index da9093738d4a..9a20f0e0363d 100644 --- a/drivers/staging/greybus/sdio.c +++ b/drivers/staging/greybus/sdio.c @@ -15,6 +15,7 @@ #include #include "greybus.h" +#include "gpbridge.h" struct gb_sdio_host { struct gb_connection *connection; diff --git a/drivers/staging/greybus/spi.c b/drivers/staging/greybus/spi.c index 7689af0f63a9..35714533a1ac 100644 --- a/drivers/staging/greybus/spi.c +++ b/drivers/staging/greybus/spi.c @@ -14,6 +14,7 @@ #include #include "greybus.h" +#include "gpbridge.h" struct gb_spi { struct gb_connection *connection; diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c index 0685cdcb510d..d169c55b4552 100644 --- a/drivers/staging/greybus/uart.c +++ b/drivers/staging/greybus/uart.c @@ -29,6 +29,7 @@ #include #include "greybus.h" +#include "gpbridge.h" #define GB_NUM_MINORS 16 /* 16 is is more than enough */ #define GB_NAME "ttyGB" diff --git a/drivers/staging/greybus/usb.c b/drivers/staging/greybus/usb.c index 6647868b4960..0cfc00f39b46 100644 --- a/drivers/staging/greybus/usb.c +++ b/drivers/staging/greybus/usb.c @@ -14,6 +14,7 @@ #include #include "greybus.h" +#include "gpbridge.h" /* Version of the Greybus USB protocol we support */ #define GB_USB_VERSION_MAJOR 0x00 -- 2.39.5