diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2014-11-02 02:15:39 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-11-02 03:03:51 -0500 |
commit | 882809fb724c46b8ebc4de0944e94914ceb94e1c (patch) | |
tree | 33d68f35c715967571a7235d1132efbcf75989d9 /drivers/bluetooth/hci_h5.c | |
parent | 75e0569f7fc22272ec5e3b99bf94c6f0ad43b35f (diff) |
Bluetooth: Switch HCI H5 driver to use hci_reset_dev() function
Instead of having the driver generate the HCI Hardware Error event
manually, just call hci_reset_dev() to trigger the upper stack reset.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'drivers/bluetooth/hci_h5.c')
-rw-r--r-- | drivers/bluetooth/hci_h5.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c index bd1fe37a7993..ec0fa7732c0d 100644 --- a/drivers/bluetooth/hci_h5.c +++ b/drivers/bluetooth/hci_h5.c | |||
@@ -171,8 +171,6 @@ wakeup: | |||
171 | static void h5_peer_reset(struct hci_uart *hu) | 171 | static void h5_peer_reset(struct hci_uart *hu) |
172 | { | 172 | { |
173 | struct h5 *h5 = hu->priv; | 173 | struct h5 *h5 = hu->priv; |
174 | struct sk_buff *skb; | ||
175 | const u8 hw_err[] = { HCI_EV_HARDWARE_ERROR, 0x01, 0x00 }; | ||
176 | 174 | ||
177 | BT_ERR("Peer device has reset"); | 175 | BT_ERR("Peer device has reset"); |
178 | 176 | ||
@@ -187,15 +185,8 @@ static void h5_peer_reset(struct hci_uart *hu) | |||
187 | h5->tx_seq = 0; | 185 | h5->tx_seq = 0; |
188 | h5->tx_ack = 0; | 186 | h5->tx_ack = 0; |
189 | 187 | ||
190 | skb = bt_skb_alloc(3, GFP_ATOMIC); | 188 | /* Send reset request to upper stack */ |
191 | if (!skb) | 189 | hci_reset_dev(hu->hdev); |
192 | return; | ||
193 | |||
194 | bt_cb(skb)->pkt_type = HCI_EVENT_PKT; | ||
195 | memcpy(skb_put(skb, 3), hw_err, 3); | ||
196 | |||
197 | /* Send Hardware Error to upper stack */ | ||
198 | hci_recv_frame(hu->hdev, skb); | ||
199 | } | 190 | } |
200 | 191 | ||
201 | static int h5_open(struct hci_uart *hu) | 192 | static int h5_open(struct hci_uart *hu) |