Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b22f155 authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman
Browse files

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: default avatarViresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent b22b7104
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -345,6 +345,7 @@ static int gb_hid_open(struct hid_device *hid)
static void gb_hid_close(struct hid_device *hid)
static void gb_hid_close(struct hid_device *hid)
{
{
	struct gb_hid *ghid = hid->driver_data;
	struct gb_hid *ghid = hid->driver_data;
	int ret;


	/*
	/*
	 * Protecting hid->open to make sure we don't restart data acquistion
	 * 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);
		clear_bit(GB_HID_STARTED, &ghid->flags);


		/* Save some power */
		/* 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);
	mutex_unlock(&gb_hid_open_mutex);
}
}