Bluetooth: fix error return code in rfcomm_add_listener()

Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Bluetooth: Fix HCI request for Inquiry command

Some HCI commands don't send a Command Complete Event once the
HCI command has completed so they require special handling by
the HCI request framework. HCI Inquiry command is one of those.

The HCI Inquiry command causes the controller to enter in inquiry
mode. A successful Command Status Event for this command means the
the controller is running the inquiry procedure therefore the HCI
Inquiry command has completed.

For that reason, the HCI request framework should consider the
HCI Inquiry command has completed once the host receives the
Command Status Event, instead of the Inquiry Complete Event. The
Inquiry Complete Event means the inquiry procedure has completed
(not the inquiry command).

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Bluetooth: Fix hci_inquiry

Since the HCI request framework was properly fixed to handle HCI
Inquiry commands, the hci_req_sync call, in hci_inquiry, will return
as soon as the HCI command completes (not the Inquiry procedure).
However, in inquiry ioctl implementation, we want to sleep the user
process until the inquiry procedure finishes.

This patch changes hci_inquiry so, in case the HCI Inquiry command
was executed successfully, it waits the HCI_INQUIRY flag to be cleared.
This way, the user process will sleep until the inquiry procedure
finishes.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>