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

Commit 669c9af0 authored by Mahesh Kumar Sharma's avatar Mahesh Kumar Sharma
Browse files

Bluetooth: Add conditional check before requesting gpio



Add a condition check before calling gpio_request in order
to avoid non-fatal panic.

Change-Id: Id77b99b0a7c119efb75e50c85ec185895dd8c031
Signed-off-by: default avatarMahesh Kumar Sharma <smahesh@codeaurora.org>
parent 73db1046
Loading
Loading
Loading
Loading
+22 −17
Original line number Diff line number Diff line
@@ -398,6 +398,10 @@ static int bt_configure_gpios(int on)
			bt_power_src_status[BT_RESET_GPIO] =
				gpio_get_value(bt_reset_gpio);
		}

		pr_info("xo_reset_gpio(%d)\n", xo_reset_gpio);

		if (xo_reset_gpio > 0) {
			rc = gpio_request(xo_reset_gpio, "xo_reset_gpio_n");
			if (rc) {
				pr_err("%s: unable to request gpio %d (%d)\n",
@@ -419,6 +423,7 @@ static int bt_configure_gpios(int on)
						__func__);
				}
			}
		}
		msleep(50);
		/*  Check  if  SW_CTRL  is  asserted  */
		if  (bt_sw_ctrl_gpio  >=  0)  {