aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorGravatar Greg Kroah-Hartman <greg@kroah.com> 2014-12-24 13:01:45 -0800
committerGravatar Greg Kroah-Hartman <greg@kroah.com> 2015-01-02 13:06:48 -0800
commit7422a1ec2e208762cacd3c3368e6313046b3e3d5 (patch)
tree3842f7dcee433a09fdf82852cf2a7c04033fc56c /drivers/staging
parentgreybus: module: get rid of global list of modules (diff)
downloadlinux-7422a1ec2e208762cacd3c3368e6313046b3e3d5.tar.gz
linux-7422a1ec2e208762cacd3c3368e6313046b3e3d5.tar.bz2
linux-7422a1ec2e208762cacd3c3368e6313046b3e3d5.zip
greybus: protocol: name protocols.
We want to be able to "blame" a protocol for things at times, so give them a name we can refer to them by. Announce when they are added or removed from the system so we have a chance to know what is going on in the kernel logs. Signed-off-by: Greg Kroah-Hartman <greg@kroah.com> Reviewed-by: Alex Elder <elder@linaro.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/greybus/battery-gb.c1
-rw-r--r--drivers/staging/greybus/gpio-gb.c1
-rw-r--r--drivers/staging/greybus/i2c-gb.c1
-rw-r--r--drivers/staging/greybus/protocol.c7
-rw-r--r--drivers/staging/greybus/protocol.h1
-rw-r--r--drivers/staging/greybus/pwm-gb.c1
-rw-r--r--drivers/staging/greybus/sdio-gb.c1
-rw-r--r--drivers/staging/greybus/uart-gb.c1
-rw-r--r--drivers/staging/greybus/usb-gb.c1
-rw-r--r--drivers/staging/greybus/vibrator-gb.c1
10 files changed, 16 insertions, 0 deletions
diff --git a/drivers/staging/greybus/battery-gb.c b/drivers/staging/greybus/battery-gb.c
index 7ce37377bca5..2130d73cbfde 100644
--- a/drivers/staging/greybus/battery-gb.c
+++ b/drivers/staging/greybus/battery-gb.c
@@ -359,6 +359,7 @@ static void gb_battery_connection_exit(struct gb_connection *connection)
}
static struct gb_protocol battery_protocol = {
+ .name = "battery",
.id = GREYBUS_PROTOCOL_BATTERY,
.major = 0,
.minor = 1,
diff --git a/drivers/staging/greybus/gpio-gb.c b/drivers/staging/greybus/gpio-gb.c
index cf60a4a96b29..5fcd01814126 100644
--- a/drivers/staging/greybus/gpio-gb.c
+++ b/drivers/staging/greybus/gpio-gb.c
@@ -524,6 +524,7 @@ static void gb_gpio_connection_exit(struct gb_connection *connection)
}
static struct gb_protocol gpio_protocol = {
+ .name = "gpio",
.id = GREYBUS_PROTOCOL_GPIO,
.major = 0,
.minor = 1,
diff --git a/drivers/staging/greybus/i2c-gb.c b/drivers/staging/greybus/i2c-gb.c
index b78de6b4be10..3b86258d2dcf 100644
--- a/drivers/staging/greybus/i2c-gb.c
+++ b/drivers/staging/greybus/i2c-gb.c
@@ -430,6 +430,7 @@ static void gb_i2c_connection_exit(struct gb_connection *connection)
}
static struct gb_protocol i2c_protocol = {
+ .name = "i2c",
.id = GREYBUS_PROTOCOL_I2C,
.major = 0,
.minor = 1,
diff --git a/drivers/staging/greybus/protocol.c b/drivers/staging/greybus/protocol.c
index 654adbc0b787..4d6ffdd04ab8 100644
--- a/drivers/staging/greybus/protocol.c
+++ b/drivers/staging/greybus/protocol.c
@@ -7,6 +7,8 @@
* Released under the GPLv2 only.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include "greybus.h"
/* Global list of registered protocols */
@@ -86,6 +88,8 @@ int __gb_protocol_register(struct gb_protocol *protocol, struct module *module)
list_add_tail(&protocol->links, &existing->links);
spin_unlock_irq(&gb_protocols_lock);
+ pr_info("Registered %s protocol.\n", protocol->name);
+
/*
* Go try to bind any unbound connections, as we have a
* new protocol in the system
@@ -124,6 +128,9 @@ int gb_protocol_deregister(struct gb_protocol *protocol)
}
spin_unlock_irq(&gb_protocols_lock);
+ if (protocol)
+ pr_info("Deregistered %s protocol.\n", protocol->name);
+
return protocol && !protocol_count;
}
EXPORT_SYMBOL_GPL(gb_protocol_deregister);
diff --git a/drivers/staging/greybus/protocol.h b/drivers/staging/greybus/protocol.h
index 2d4fcfac8052..8bda524a4d6d 100644
--- a/drivers/staging/greybus/protocol.h
+++ b/drivers/staging/greybus/protocol.h
@@ -35,6 +35,7 @@ struct gb_protocol {
gb_connection_exit_t connection_exit;
gb_request_recv_t request_recv;
struct module *owner;
+ char *name;
};
int __gb_protocol_register(struct gb_protocol *protocol, struct module *module);
diff --git a/drivers/staging/greybus/pwm-gb.c b/drivers/staging/greybus/pwm-gb.c
index 5f02e7802949..91f7b87a1cae 100644
--- a/drivers/staging/greybus/pwm-gb.c
+++ b/drivers/staging/greybus/pwm-gb.c
@@ -311,6 +311,7 @@ static void gb_pwm_connection_exit(struct gb_connection *connection)
}
static struct gb_protocol pwm_protocol = {
+ .name = "pwm",
.id = GREYBUS_PROTOCOL_PWM,
.major = 0,
.minor = 1,
diff --git a/drivers/staging/greybus/sdio-gb.c b/drivers/staging/greybus/sdio-gb.c
index 13293a6f358e..d324846d09ab 100644
--- a/drivers/staging/greybus/sdio-gb.c
+++ b/drivers/staging/greybus/sdio-gb.c
@@ -79,6 +79,7 @@ static void gb_sdio_connection_exit(struct gb_connection *connection)
}
static struct gb_protocol sdio_protocol = {
+ .name = "sdio",
.id = GREYBUS_PROTOCOL_SDIO,
.major = 0,
.minor = 1,
diff --git a/drivers/staging/greybus/uart-gb.c b/drivers/staging/greybus/uart-gb.c
index 825de7462f7b..032062019d20 100644
--- a/drivers/staging/greybus/uart-gb.c
+++ b/drivers/staging/greybus/uart-gb.c
@@ -767,6 +767,7 @@ static void gb_tty_exit(void)
}
static struct gb_protocol uart_protocol = {
+ .name = "uart",
.id = GREYBUS_PROTOCOL_UART,
.major = 0,
.minor = 1,
diff --git a/drivers/staging/greybus/usb-gb.c b/drivers/staging/greybus/usb-gb.c
index b3ba50b502ec..010ef9ee831f 100644
--- a/drivers/staging/greybus/usb-gb.c
+++ b/drivers/staging/greybus/usb-gb.c
@@ -376,6 +376,7 @@ static void gb_usb_connection_exit(struct gb_connection *connection)
}
static struct gb_protocol usb_protocol = {
+ .name = "usb",
.id = GREYBUS_PROTOCOL_USB,
.major = 0,
.minor = 1,
diff --git a/drivers/staging/greybus/vibrator-gb.c b/drivers/staging/greybus/vibrator-gb.c
index 71c96d3da9ed..c85d95085040 100644
--- a/drivers/staging/greybus/vibrator-gb.c
+++ b/drivers/staging/greybus/vibrator-gb.c
@@ -197,6 +197,7 @@ static void gb_vibrator_connection_exit(struct gb_connection *connection)
}
static struct gb_protocol vibrator_protocol = {
+ .name = "vibrator",
.id = GREYBUS_PROTOCOL_VIBRATOR,
.major = 0,
.minor = 1,