Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1004217pxv; Thu, 22 Jul 2021 18:57:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLyn56tESgyIn0DZvkTENW4fvadKuJfVyLw7kWLB1NjetvlGynOvhaaXbRVXWnn6zIlDMJ X-Received: by 2002:a02:a913:: with SMTP id n19mr2185926jam.7.1627005469822; Thu, 22 Jul 2021 18:57:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627005469; cv=none; d=google.com; s=arc-20160816; b=RufFJwBqK3KKbUq+CJPEYdWm+pCKl9BbIC5FKieXl1elpW1nwfKsgfS8JcIm9btM4j AwlFWyPBYd/w6bh/WURTBIBS2ZON7rRVHcN2aZUgSU//BzTsmwxRKYRCfdfOM7+UNfTG ypydZLIOCLUAaRdhkLD18m8wjf5OvBkbKULoxm5duBp6AGdIfhm3NT7Wd/2da9jhia6D WD4IH2Xgw49mNcligaV8x20SpgJcSM/xrjcY9ujK8gZN61Res7ASFYGzIKkJyM9Lovaz 7ypRcVyql0lw8YT7HMQ7DeVBc6xRcgr1z577I52b1tBwQP68065deSRjxdbBT8S91gRe wsQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=0Nf0q4sMjibNhSwmB44CTC3WSvcJuoWl79WeGqr4t/I=; b=fZ1iy6OFEYbvsQ697mLtCmrO7BDBPJqUBEeoXlBQPAZOjt2O77WxdUjIYtZhI6uee2 jYjdPX5kS3OZYidGNSkYRGufISspKcuTpOybC3pbXpb0/EXZBmtEKsADRFUbVHzxOJSv 77/T2pF+OyxZUcg0IQ/tA1L5u3QaKq/GzcHA715iPb7WbVwS6E4ZhvTyqRmzEGhZFOEM PYdSlBb6di9o70q5vH2kje1REFLI/JMXZgynA84FxIYS1iTtx6qEHzpC5DlUsqsx5mBo SNqHgdVD8B1Da7mqKOYM263ZYMTVoN/JI1HwqlnpX4XwftBi6Pj9JjRoMjVpUgFHf1Yw IHGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v17si32637161ilo.17.2021.07.22.18.57.38; Thu, 22 Jul 2021 18:57:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233160AbhGWBPn (ORCPT + 99 others); Thu, 22 Jul 2021 21:15:43 -0400 Received: from mx20.baidu.com ([111.202.115.85]:58518 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233145AbhGWBPm (ORCPT ); Thu, 22 Jul 2021 21:15:42 -0400 Received: from BC-Mail-Ex18.internal.baidu.com (unknown [172.31.51.12]) by Forcepoint Email with ESMTPS id 9308CA6D2D1DB7AC8B15; Fri, 23 Jul 2021 09:56:14 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BC-Mail-Ex18.internal.baidu.com (172.31.51.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2242.12; Fri, 23 Jul 2021 09:56:14 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Fri, 23 Jul 2021 09:56:13 +0800 From: Cai Huoqing To: , , , , CC: , , Cai Huoqing Subject: [PATCH v2 2/2] PCI: vmd: Make use of PCI_DEVICE_DATA() helper function Date: Fri, 23 Jul 2021 09:55:59 +0800 Message-ID: <20210723015559.695-3-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210723015559.695-1-caihuoqing@baidu.com> References: <20210723015559.695-1-caihuoqing@baidu.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BJHW-Mail-Ex16.internal.baidu.com (10.127.64.39) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We could make use of PCI_DEVICE_DATA() helper function Signed-off-by: Cai Huoqing --- 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