summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2016-02-26 16:44:19 +0530
committerGreg Kroah-Hartman <gregkh@google.com>2016-02-29 14:49:28 -0800
commit9b22f155beb4e5a71f86710034b478ec43af9c43 (patch)
treee9540b2405502af2f024bf6d7b1af1e9f5e4de4d /drivers
parentb22b7104d5930ed4aae2c8494b8f95f20a85d66b (diff)
greybus: hid: Replace WARN_ON() with dev_err()
WARN_ON() is a bit harsh here, as we just failed to power-off the HID device while it is getting removed. Replace it with dev_err(). Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/greybus/hid.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/staging/greybus/hid.c b/drivers/staging/greybus/hid.c
index 601ee6fc81d5..6ef151f61ffc 100644
--- a/drivers/staging/greybus/hid.c
+++ b/drivers/staging/greybus/hid.c
@@ -345,6 +345,7 @@ static int gb_hid_open(struct hid_device *hid)
static void gb_hid_close(struct hid_device *hid)
{
struct gb_hid *ghid = hid->driver_data;
+ int ret;
/*
* Protecting hid->open to make sure we don't restart data acquistion
@@ -355,7 +356,10 @@ static void gb_hid_close(struct hid_device *hid)
clear_bit(GB_HID_STARTED, &ghid->flags);
/* Save some power */
- WARN_ON(gb_hid_set_power(ghid, GB_HID_TYPE_PWR_OFF));
+ ret = gb_hid_set_power(ghid, GB_HID_TYPE_PWR_OFF);
+ if (ret)
+ dev_err(&ghid->connection->bundle->dev,
+ "failed to power off (%d)\n", ret);
}
mutex_unlock(&gb_hid_open_mutex);
}