Commit 81a19053 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Marcel Holtmann

Bluetooth: hci_bcm: fix build error without CONFIG_PM

This was introduced by the rework adding PM support:

drivers/bluetooth/hci_bcm.c: In function 'bcm_device_exists':
drivers/bluetooth/hci_bcm.c:156:22: error: 'struct bcm_device' has no member named 'hu'
  if (device && device->hu && device->hu->serdev)
                      ^~

The pointer is not available otherwise, so I'm enclosing
all references in an #ifdef here.

Fixes: 8a920568 ("Bluetooth: hci_bcm: Add (runtime)pm support to the serdev driver")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 18a39b9a
...@@ -152,9 +152,11 @@ static bool bcm_device_exists(struct bcm_device *device) ...@@ -152,9 +152,11 @@ static bool bcm_device_exists(struct bcm_device *device)
{ {
struct list_head *p; struct list_head *p;
#ifdef CONFIG_PM
/* Devices using serdev always exist */ /* Devices using serdev always exist */
if (device && device->hu && device->hu->serdev) if (device && device->hu && device->hu->serdev)
return true; return true;
#endif
list_for_each(p, &bcm_device_list) { list_for_each(p, &bcm_device_list) {
struct bcm_device *dev = list_entry(p, struct bcm_device, list); struct bcm_device *dev = list_entry(p, struct bcm_device, list);
...@@ -973,7 +975,9 @@ static int bcm_serdev_probe(struct serdev_device *serdev) ...@@ -973,7 +975,9 @@ static int bcm_serdev_probe(struct serdev_device *serdev)
return -ENOMEM; return -ENOMEM;
bcmdev->dev = &serdev->dev; bcmdev->dev = &serdev->dev;
#ifdef CONFIG_PM
bcmdev->hu = &bcmdev->serdev_hu; bcmdev->hu = &bcmdev->serdev_hu;
#endif
bcmdev->serdev_hu.serdev = serdev; bcmdev->serdev_hu.serdev = serdev;
serdev_device_set_drvdata(serdev, bcmdev); serdev_device_set_drvdata(serdev, bcmdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment