Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10119026imu; Wed, 5 Dec 2018 16:43:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/U3zL7aD6aLywWxgPPRfVlyiwNuCc4+373SYSoDB0muJV3/E6aD8MpvoJc+6CmFaKArTz6F X-Received: by 2002:a62:59c9:: with SMTP id k70mr26355642pfj.243.1544057026205; Wed, 05 Dec 2018 16:43:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544057026; cv=none; d=google.com; s=arc-20160816; b=PF1iIZpcex74427tCwb1uYyOZpC9sLxdOUrx8LK0qJaGjPv7qCf2HhrUcCdcuBtaqX IOkH+QIJQvd9R/Mf/279Bdj3QuYmuHROf8hcUHqBRpo5SuoPkUo54NjcskdNbLdn7jB2 8pNVrTdAv0QTnbzM07YwZMP8AbqWXbfaPoe2Y2jp1qkRDHUMXf0HVapplhA9ZoM7GnXY YP7fN5K7mlif+tWFurWRNKXiK3co9ufLT4wcJUZjzVLjJ0GZfut24BJ2beMsW41NQwi5 /W0h+pjFEzBzfZigNHTPtdl/UaaLOrFmdl7Z+AYdfvfXezazxvig81qBgTxjYsiVe8Pa 0eeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=Xgnb7rysSwJJZOWZliBlLOnH0/oitFtiDwHu09EJ2ec=; b=FHYJjF/nNpXQY/mkZGqPo1u+5Y8VuuRPaPIkGmqvLwMZ31VKOLvmiCnEq9oiax2h/p g2ywj2pMIYSAuPZuxwrUKybgStF6V9JpECooxxPK8JQJ6C8y5Mbx/s0bmTT7T+njEK+h gfDz+tAh0Q6SRkYiHFvfzl5rA6CXu3372ZsnufKkpHo/sDFMG6XNEzRiTJHdhbgptoMF S2OfEzASOegH1lvkfLhhoYc0oF+N1r1N1jhfUQtKVKjLG901VfZdYI7H6U3/f5RR9HqB hrDlry3Yikyf7fEfV/z0q3Kcat/e5LShJbHBNzuTQSDGMUwCN1FVX95TVIWPzkmUPiSW nH+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d25si17909183pgd.88.2018.12.05.16.43.31; Wed, 05 Dec 2018 16:43:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728808AbeLFAme (ORCPT + 99 others); Wed, 5 Dec 2018 19:42:34 -0500 Received: from g9t1613g.houston.hpe.com ([15.241.32.99]:33195 "EHLO g9t1613g.houston.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727889AbeLFAmc (ORCPT ); Wed, 5 Dec 2018 19:42:32 -0500 Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by g9t1613g.houston.hpe.com (Postfix) with ESMTPS id 7BB3C60B4D; Thu, 6 Dec 2018 00:42:33 +0000 (UTC) Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2353.austin.hpe.com (Postfix) with ESMTP id B46461C2; Thu, 6 Dec 2018 00:42:30 +0000 (UTC) Received: from lxbuild.ftc.rdlabs.hpecorp.net (lxbuild.ftc.rdlabs.hpecorp.net [16.78.34.175]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 5EAE13D; Thu, 6 Dec 2018 00:42:30 +0000 (UTC) From: Jerry Hoemann To: linux@roeck-us.net Cc: wim@linux-watchdog.org, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, Jerry Hoemann Subject: [PATCH v2 1/3] watchdog/hpwdt: Exclude via blacklist Date: Wed, 5 Dec 2018 17:42:21 -0700 Message-Id: <1544056943-79958-2-git-send-email-jerry.hoemann@hpe.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1544056943-79958-1-git-send-email-jerry.hoemann@hpe.com> References: <1544056943-79958-1-git-send-email-jerry.hoemann@hpe.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Instead of having explicit if statments excluding devices, use a pci_device_id table of devices to blacklist. Signed-off-by: Jerry Hoemann --- 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