linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cai Huoqing <caihuoqing@baidu.com>
To: <bhelgaas@google.com>, <jonathan.derrick@intel.com>,
	<kw@linux.com>, <onathan.derrick@intel.com>,
	<lorenzo.pieralisi@arm.com>, <robh@kernel.org>
Cc: <linux-pci@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Cai Huoqing <caihuoqing@baidu.com>
Subject: [PATCH 2/2] PCI: vmd: Make use of PCI_DEVICE_DATA() helper function
Date: Thu, 22 Jul 2021 19:19:03 +0800	[thread overview]
Message-ID: <20210722111903.432-3-caihuoqing@baidu.com> (raw)
In-Reply-To: <20210722111903.432-1-caihuoqing@baidu.com>

We could make use of PCI_DEVICE_DATA() helper function

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
 drivers/pci/controller/vmd.c | 38 ++++++++++++++++++------------------
 include/linux/pci_ids.h      |  2 ++
 2 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index e3fcdfec58b3..565681ed00a1 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -859,25 +859,25 @@ static int vmd_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(vmd_dev_pm_ops, vmd_suspend, vmd_resume);
 
 static const struct pci_device_id vmd_ids[] = {
-       {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_VMD_201D),
-               .driver_data = VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP,},
-       {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_VMD_28C0),
-               .driver_data = VMD_FEAT_HAS_MEMBAR_SHADOW |
-                               VMD_FEAT_HAS_BUS_RESTRICTIONS |
-                               VMD_FEAT_CAN_BYPASS_MSI_REMAP,},
-       {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x467f),
-               .driver_data = VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP |
-                               VMD_FEAT_HAS_BUS_RESTRICTIONS |
-                               VMD_FEAT_OFFSET_FIRST_VECTOR,},
-       {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4c3d),
-               .driver_data = VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP |
-                               VMD_FEAT_HAS_BUS_RESTRICTIONS |
-                               VMD_FEAT_OFFSET_FIRST_VECTOR,},
-       {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_VMD_9A0B),
-               .driver_data = VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP |
-                               VMD_FEAT_HAS_BUS_RESTRICTIONS |
-                               VMD_FEAT_OFFSET_FIRST_VECTOR,},
-       {0,}
+       { PCI_DEVICE_DATA(INTEL, VMD_201D,
+                         VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP) },
+       { PCI_DEVICE_DATA(INTEL, VMD_28C0,
+                         VMD_FEAT_HAS_MEMBAR_SHADOW |
+                         VMD_FEAT_HAS_BUS_RESTRICTIONS |
+                         VMD_FEAT_CAN_BYPASS_MSI_REMAP) },
+       { PCI_DEVICE_DATA(INTEL, VMD_467F,
+                         VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP |
+                         VMD_FEAT_HAS_BUS_RESTRICTIONS |
+                         VMD_FEAT_OFFSET_FIRST_VECTOR) },
+       { PCI_DEVICE_DATA(INTEL, VMD_4C3D,
+                         VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP |
+                         VMD_FEAT_HAS_BUS_RESTRICTIONS |
+                         VMD_FEAT_OFFSET_FIRST_VECTOR) },
+       { PCI_DEVICE_DATA(INTEL, VMD_9A0B,
+                         VMD_FEAT_HAS_MEMBAR_SHADOW_VSCAP |
+                         VMD_FEAT_HAS_BUS_RESTRICTIONS |
+                         VMD_FEAT_OFFSET_FIRST_VECTOR) },
+       { },
 };
 MODULE_DEVICE_TABLE(pci, vmd_ids);
 
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 4bac1831de80..d25552b5ae3e 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2954,6 +2954,8 @@
 #define PCI_DEVICE_ID_INTEL_SBRIDGE_BR         0x3cf5  /* 13.6 */
 #define PCI_DEVICE_ID_INTEL_SBRIDGE_SAD1       0x3cf6  /* 12.7 */
 #define PCI_DEVICE_ID_INTEL_IOAT_SNB   0x402f
+#define PCI_DEVICE_ID_INTEL_VMD_467F   0x467f
+#define PCI_DEVICE_ID_INTEL_VMD_4C3D   0x4c3d
 #define PCI_DEVICE_ID_INTEL_5100_16    0x65f0
 #define PCI_DEVICE_ID_INTEL_5100_19    0x65f3
 #define PCI_DEVICE_ID_INTEL_5100_21    0x65f5
-- 
2.25.1


  parent reply	other threads:[~2021-07-22 11:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22 11:19 [PATCH 0/2] PCI: Make use of PCI_DEVICE_XXX() helper function Cai Huoqing
2021-07-22 11:19 ` [PATCH 1/2] PCI: Make use of PCI_DEVICE_SUB/_CLASS() " Cai Huoqing
2021-07-22 11:19 ` Cai Huoqing [this message]
2021-07-22 16:52 ` [PATCH 0/2] PCI: Make use of PCI_DEVICE_XXX() " Bjorn Helgaas
2021-07-23  1:30   ` Cai,Huoqing
2021-07-22 11:29 Cai Huoqing
2021-07-22 11:29 ` [PATCH 2/2] PCI: vmd: Make use of PCI_DEVICE_DATA() " Cai Huoqing
2021-07-22 16:45   ` Derrick, Jonathan
2021-07-23  1:34     ` Cai,Huoqing
2021-07-23  2:00       ` Krzysztof Wilczyński
2021-07-23  3:28         ` Cai,Huoqing

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=20210722111903.432-3-caihuoqing@baidu.com \
    --to=caihuoqing@baidu.com \
    --cc=bhelgaas@google.com \
    --cc=jonathan.derrick@intel.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=onathan.derrick@intel.com \
    --cc=robh@kernel.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).