diff options
author | Jerry Hoemann <jerry.hoemann@hpe.com> | 2018-12-06 03:42:21 +0300 |
---|---|---|
committer | Wim Van Sebroeck <wim@linux-watchdog.org> | 2018-12-22 14:15:30 +0300 |
commit | 94d6b80c45d3f436d993aa026aa080866cb4b87e (patch) | |
tree | 8920e366e6eba4fded7e8b36f53bf3ff6ed300bd /drivers/watchdog | |
parent | e1b83a31c79811409023aac560d5b0fc2967bec9 (diff) | |
download | linux-94d6b80c45d3f436d993aa026aa080866cb4b87e.tar.xz |
watchdog/hpwdt: Exclude via blacklist
Instead of having explicit if statments excluding devices,
use a pci_device_id table of devices to blacklist.
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/hpwdt.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index 93562304f7aa..eecd014ccd5b 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c @@ -50,6 +50,10 @@ static const struct pci_device_id hpwdt_devices[] = { }; MODULE_DEVICE_TABLE(pci, hpwdt_devices); +static const struct pci_device_id hpwdt_blacklist[] = { + { PCI_DEVICE_SUB(PCI_VENDOR_ID_HP, 0x3306, PCI_VENDOR_ID_HP, 0x1979) }, /* auxilary iLO */ + {0}, /* terminate list */ +}; /* * Watchdog operations @@ -274,12 +278,10 @@ static int hpwdt_init_one(struct pci_dev *dev, return -ENODEV; } - /* - * Ignore all auxilary iLO devices with the following PCI ID - */ - if (dev->subsystem_vendor == PCI_VENDOR_ID_HP && - dev->subsystem_device == 0x1979) + if (pci_match_id(hpwdt_blacklist, dev)) { + dev_dbg(&dev->dev, "Not supported on this device\n"); return -ENODEV; + } if (pci_enable_device(dev)) { dev_warn(&dev->dev, |