Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98dc77d5 authored by Loic Poulain's avatar Loic Poulain Committed by Marcel Holtmann
Browse files

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: default avatarLoic Poulain <loic.poulain@gmail.com>
Reported-by: default avatarIan Molton <ian@mnementh.co.uk>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 04d8980b
Loading
Loading
Loading
Loading
+16 −14
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ static irqreturn_t bcm_host_wake(int irq, void *data)
static int bcm_request_irq(struct bcm_data *bcm)
{
	struct bcm_device *bdev = bcm->dev;
	int err = 0;
	int err;

	/* If this is not a platform device, do not enable PM functionalities */
	mutex_lock(&bcm_device_lock);
@@ -185,10 +185,13 @@ static int bcm_request_irq(struct bcm_data *bcm)
		goto unlock;
	}

	if (bdev->irq > 0) {
		err = devm_request_irq(&bdev->pdev->dev, bdev->irq,
				       bcm_host_wake, IRQF_TRIGGER_RISING,
				       "host_wake", bdev);
	if (bdev->irq <= 0) {
		err = -EOPNOTSUPP;
		goto unlock;
	}

	err = devm_request_irq(&bdev->pdev->dev, bdev->irq, bcm_host_wake,
			       IRQF_TRIGGER_RISING, "host_wake", bdev);
	if (err)
		goto unlock;

@@ -199,7 +202,6 @@ static int bcm_request_irq(struct bcm_data *bcm)
	pm_runtime_use_autosuspend(&bdev->pdev->dev);
	pm_runtime_set_active(&bdev->pdev->dev);
	pm_runtime_enable(&bdev->pdev->dev);
	}

unlock:
	mutex_unlock(&bcm_device_lock);