From f94e039cc849db7338ae5e30d2b6758de11b7a59 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 7 Jul 2017 12:40:53 +0200 Subject: [PATCH] suspend: check module variant before bringing down/up BT interface Signed-off-by: Javier Viguera --- .../busybox/busybox-1.24.1/ccimx6/suspend | 16 ++++++++++------ .../busybox/busybox-1.24.1/ccimx6ul/suspend | 16 ++++++++++------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6/suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6/suspend index 65aeed292..140645eea 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6/suspend +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6/suspend @@ -40,9 +40,11 @@ suspend_interfaces() { fi # Suspend bluetooth interface - hciconfig hci0 2>&1 | grep -qs UP && up_bt_on_resume="1" - ${BT_DAEMON} stop >/dev/null - ${BT_INIT} stop >/dev/null + if [ -d "/proc/device-tree/bluetooth" ]; then + hciconfig hci0 2>&1 | grep -qs UP && up_bt_on_resume="1" + ${BT_DAEMON} stop >/dev/null + ${BT_INIT} stop >/dev/null + fi } resume_interfaces() { @@ -59,9 +61,11 @@ resume_interfaces() { fi # Resume bluetooth interface - if [ -n "${up_bt_on_resume}" ]; then - ${BT_INIT} start >/dev/null - ${BT_DAEMON} start >/dev/null + if [ -d "/proc/device-tree/bluetooth" ]; then + if [ -n "${up_bt_on_resume}" ]; then + ${BT_INIT} start >/dev/null + ${BT_DAEMON} start >/dev/null + fi fi } diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend index 25b286c14..a74f24d35 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.24.1/ccimx6ul/suspend @@ -40,9 +40,11 @@ suspend_interfaces() { fi # Suspend bluetooth interface - hciconfig hci0 2>&1 | grep -qs UP && up_bt_on_resume="1" - ${BT_DAEMON} stop >/dev/null - ${BT_INIT} stop >/dev/null + if [ -d "/proc/device-tree/bluetooth" ]; then + hciconfig hci0 2>&1 | grep -qs UP && up_bt_on_resume="1" + ${BT_DAEMON} stop >/dev/null + ${BT_INIT} stop >/dev/null + fi } resume_interfaces() { @@ -59,9 +61,11 @@ resume_interfaces() { fi # Resume bluetooth interface - if [ -n "${up_bt_on_resume}" ]; then - ${BT_INIT} start >/dev/null - ${BT_DAEMON} start >/dev/null + if [ -d "/proc/device-tree/bluetooth" ]; then + if [ -n "${up_bt_on_resume}" ]; then + ${BT_INIT} start >/dev/null + ${BT_DAEMON} start >/dev/null + fi fi }