• Lukas Wunner's avatar
    Bluetooth: hci_bcm: Handle errors properly · 8bfa7e1e
    Lukas Wunner authored
    A significant portion of this driver lacks error handling.  As a first
    step, add error paths to bcm_gpio_set_power(), bcm_open(), bcm_close(),
    bcm_suspend_device(), bcm_resume_device(), bcm_resume(), bcm_probe() and
    bcm_serdev_probe().  (I've also scrutinized bcm_suspend() but think it's
    fine as is.)
    
    Those are all the functions accessing the device wake and shutdown GPIO.
    On Apple Macs the pins are accessed through ACPI methods, which may fail
    for various reasons, hence proper error handling is necessary.  Non-Macs
    access the pins directly, which may fail as well but the GPIO core does
    not yet pass back errors to consumers.
    
    Cc: Frédéric Danis <frederic.danis.oss@gmail.com>
    Cc: Hans de Goede <hdegoede@redhat.com>
    Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
    Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
    Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
    8bfa7e1e
hci_bcm.c 26.6 KB