Bluetooth: hci_bcm: Clean up unnecessary #ifdef
authorLukas Wunner <lukas@wunner.de>
Wed, 10 Jan 2018 15:32:10 +0000 (16:32 +0100)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Fri, 14 Dec 2018 10:04:15 +0000 (11:04 +0100)
pm_runtime_disable() and pm_runtime_set_suspended() are replaced with
empty inlines if CONFIG_PM is disabled, so there's no need to #ifdef
them.

device_init_wakeup() is likewise replaced with an inline, though it's
not empty, but it and devm_free_irq() can be made conditional on
IS_ENABLED(CONFIG_PM), which is preferable to #ifdef as per section 20
of Documentation/process/coding-style.rst.

Cc: Frédéric Danis <frederic.danis.oss@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/hci_bcm.c

index 825204cddb6e0f5ccacd6afb13706329f700d6e6..ad4127fdad399c021b0734ea72fefbd3c751b0f6 100644 (file)
@@ -371,15 +371,13 @@ static int bcm_close(struct hci_uart *hu)
 
        if (bdev) {
                bcm_gpio_set_power(bdev, false);
-#ifdef CONFIG_PM
                pm_runtime_disable(bdev->dev);
                pm_runtime_set_suspended(bdev->dev);
 
-               if (bdev->irq > 0) {
+               if (IS_ENABLED(CONFIG_PM) && bdev->irq > 0) {
                        devm_free_irq(bdev->dev, bdev->irq, bdev);
                        device_init_wakeup(bdev->dev, false);
                }
-#endif
        }
        mutex_unlock(&bcm_device_lock);