summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/control.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-05-27 17:26:39 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2016-05-27 12:24:17 -0700
commit08f94352e8d09f7db07b4e894b3c223ee92df5ad (patch)
treedbb2926d705f413e7cdcc76f6e37a716d584a26a /drivers/staging/greybus/control.c
parente3fbe484323a026ed3689c72bac186ab2009dbcb (diff)
greybus: control: add error message to mode-switch helper
Print an informative error message in case sending the mode-switch request fails. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/control.c')
-rw-r--r--drivers/staging/greybus/control.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/staging/greybus/control.c b/drivers/staging/greybus/control.c
index c5cdf3c8ccf8..3e02bbb5abfe 100644
--- a/drivers/staging/greybus/control.c
+++ b/drivers/staging/greybus/control.c
@@ -163,9 +163,18 @@ int gb_control_disconnecting_operation(struct gb_control *control,
int gb_control_mode_switch_operation(struct gb_control *control)
{
- return gb_operation_unidirectional(control->connection,
+ int ret;
+
+ ret = gb_operation_unidirectional(control->connection,
GB_CONTROL_TYPE_MODE_SWITCH,
NULL, 0);
+ if (ret) {
+ dev_err(&control->dev, "failed to send mode switch: %d\n",
+ ret);
+ return ret;
+ }
+
+ return 0;
}
int gb_control_timesync_enable(struct gb_control *control, u8 count,