Skip to content

Commit

Permalink
fix airplane crash
Browse files Browse the repository at this point in the history
  • Loading branch information
scritch007 committed Nov 15, 2012
1 parent 41af00c commit 0fb1b7c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions drivers/bluetooth/bluesleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
#include <net/bluetooth/hci_core.h> /* event notifications */
#include "hci_uart.h"



#define BT_SLEEP_DBG
#ifndef BT_SLEEP_DBG
#define BT_DBG(fmt, arg...)
Expand Down Expand Up @@ -152,8 +154,7 @@ static inline int bluesleep_can_sleep(void)
{
/* check if MSM_WAKE_BT_GPIO and BT_WAKE_MSM_GPIO are both deasserted */
return gpio_get_value(bsi->ext_wake) &&
gpio_get_value(bsi->host_wake) &&
(bsi->uport != NULL);
gpio_get_value(bsi->host_wake);
}

void bluesleep_sleep_wakeup(void)
Expand All @@ -176,6 +177,11 @@ void bluesleep_sleep_wakeup(void)
*/
static void bluesleep_sleep_work(struct work_struct *work)
{
if(bsi->uport == NULL)
{
// We can't do anythin hci has called unregister
return;
}
if (bluesleep_can_sleep()) {
/* already asleep, this is an error case */
if (test_bit(BT_ASLEEP, &flags)) {
Expand Down Expand Up @@ -319,7 +325,6 @@ static void bluesleep_tx_timer_expire(unsigned long data)
static irqreturn_t bluesleep_hostwake_isr(int irq, void *dev_id)
{
gpio_clear_detect_status(bsi->host_wake_irq);

/* schedule a tasklet to handle the change in the host wake line */
tasklet_schedule(&hostwake_task);
return IRQ_HANDLED;
Expand Down
2 changes: 1 addition & 1 deletion include/linux/autoconf.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Automatically generated C config: don't edit
* Linux kernel version: 2.6.29
* Sun Feb 5 23:21:39 2012
* Wed Nov 14 21:57:02 2012
*/
#define AUTOCONF_INCLUDED
#define CONFIG_VIDEO_V4L1_COMPAT 1
Expand Down

0 comments on commit 0fb1b7c

Please sign in to comment.