mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
Bluetooth: hci_bcm: Make bcm_request_irq fail if no IRQ resource
In case of no IRQ resource associated to the bcm_device, requesting IRQ should return an error in order to not enable low power mgmt. Signed-off-by: Loic Poulain <loic.poulain@gmail.com> Reported-by: Ian Molton <ian@mnementh.co.uk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
04d8980b4a
commit
98dc77d571
1 changed files with 17 additions and 15 deletions
|
@ -176,7 +176,7 @@ static irqreturn_t bcm_host_wake(int irq, void *data)
|
||||||
static int bcm_request_irq(struct bcm_data *bcm)
|
static int bcm_request_irq(struct bcm_data *bcm)
|
||||||
{
|
{
|
||||||
struct bcm_device *bdev = bcm->dev;
|
struct bcm_device *bdev = bcm->dev;
|
||||||
int err = 0;
|
int err;
|
||||||
|
|
||||||
/* If this is not a platform device, do not enable PM functionalities */
|
/* If this is not a platform device, do not enable PM functionalities */
|
||||||
mutex_lock(&bcm_device_lock);
|
mutex_lock(&bcm_device_lock);
|
||||||
|
@ -185,22 +185,24 @@ static int bcm_request_irq(struct bcm_data *bcm)
|
||||||
goto unlock;
|
goto unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bdev->irq > 0) {
|
if (bdev->irq <= 0) {
|
||||||
err = devm_request_irq(&bdev->pdev->dev, bdev->irq,
|
err = -EOPNOTSUPP;
|
||||||
bcm_host_wake, IRQF_TRIGGER_RISING,
|
goto unlock;
|
||||||
"host_wake", bdev);
|
|
||||||
if (err)
|
|
||||||
goto unlock;
|
|
||||||
|
|
||||||
device_init_wakeup(&bdev->pdev->dev, true);
|
|
||||||
|
|
||||||
pm_runtime_set_autosuspend_delay(&bdev->pdev->dev,
|
|
||||||
BCM_AUTOSUSPEND_DELAY);
|
|
||||||
pm_runtime_use_autosuspend(&bdev->pdev->dev);
|
|
||||||
pm_runtime_set_active(&bdev->pdev->dev);
|
|
||||||
pm_runtime_enable(&bdev->pdev->dev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = devm_request_irq(&bdev->pdev->dev, bdev->irq, bcm_host_wake,
|
||||||
|
IRQF_TRIGGER_RISING, "host_wake", bdev);
|
||||||
|
if (err)
|
||||||
|
goto unlock;
|
||||||
|
|
||||||
|
device_init_wakeup(&bdev->pdev->dev, true);
|
||||||
|
|
||||||
|
pm_runtime_set_autosuspend_delay(&bdev->pdev->dev,
|
||||||
|
BCM_AUTOSUSPEND_DELAY);
|
||||||
|
pm_runtime_use_autosuspend(&bdev->pdev->dev);
|
||||||
|
pm_runtime_set_active(&bdev->pdev->dev);
|
||||||
|
pm_runtime_enable(&bdev->pdev->dev);
|
||||||
|
|
||||||
unlock:
|
unlock:
|
||||||
mutex_unlock(&bcm_device_lock);
|
mutex_unlock(&bcm_device_lock);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue