From: Guenter Roeck <linux@roeck-us.net>
To: Jerry Hoemann <jerry.hoemann@hpe.com>
Cc: wim@linux-watchdog.org, linux-watchdog@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] watchdog/hpwdt: Exclude via blacklist
Date: Thu, 6 Dec 2018 09:57:08 -0800 [thread overview]
Message-ID: <20181206175708.GB11808@roeck-us.net> (raw)
In-Reply-To: <1544056943-79958-2-git-send-email-jerry.hoemann@hpe.com>
On Wed, Dec 05, 2018 at 05:42:21PM -0700, Jerry Hoemann wrote:
> 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>
> ---
> drivers/watchdog/hpwdt.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
> index 9356230..eecd014 100644
> --- a/drivers/watchdog/hpwdt.c
> +++ b/drivers/watchdog/hpwdt.c
> @@ -50,6 +50,10 @@
> };
> 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,
> --
> 1.8.3.1
>
next prev parent reply other threads:[~2018-12-06 17:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-06 0:42 [PATCH v2 0/3] watchdog/hpwdt: Do not claim on unsupported hardware Jerry Hoemann
2018-12-06 0:42 ` [PATCH v2 1/3] watchdog/hpwdt: Exclude via blacklist Jerry Hoemann
2018-12-06 17:57 ` Guenter Roeck [this message]
2018-12-06 0:42 ` [PATCH v2 2/3] watchdog/hpwdt: Do not claim unsupported hardware Jerry Hoemann
2018-12-06 17:57 ` Guenter Roeck
2018-12-06 0:42 ` [PATCH v2 3/3] watchdog/hpwdt: Update driver version Jerry Hoemann
2018-12-06 17:57 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181206175708.GB11808@roeck-us.net \
--to=linux@roeck-us.net \
--cc=jerry.hoemann@hpe.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=wim@linux-watchdog.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).