Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753385AbbGVUld (ORCPT ); Wed, 22 Jul 2015 16:41:33 -0400 Received: from terminus.zytor.com ([198.137.202.10]:59395 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750779AbbGVUlb (ORCPT ); Wed, 22 Jul 2015 16:41:31 -0400 Date: Wed, 22 Jul 2015 13:40:41 -0700 From: tip-bot for Jiang Liu Message-ID: Cc: jiang.liu@linux.intel.com, tony.luck@intel.com, bhelgaas@google.com, linux-kernel@vger.kernel.org, bp@alien8.de, mingo@kernel.org, stuart.yoder@freescale.com, agordeev@redhat.com, tglx@linutronix.de, marc.zyngier@arm.com, grant.likely@linaro.org, wangyijing@huawei.com, hpa@zytor.com Reply-To: linux-kernel@vger.kernel.org, bhelgaas@google.com, tony.luck@intel.com, jiang.liu@linux.intel.com, wangyijing@huawei.com, hpa@zytor.com, grant.likely@linaro.org, marc.zyngier@arm.com, tglx@linutronix.de, agordeev@redhat.com, stuart.yoder@freescale.com, mingo@kernel.org, bp@alien8.de In-Reply-To: <1436428847-8886-11-git-send-email-jiang.liu@linux.intel.com> References: <1436428847-8886-11-git-send-email-jiang.liu@linux.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/core] genirq/MSI: Store 'struct device' instead of ' struct pci_dev' in struct msi_desc Git-Commit-ID: 25a98bd4ff9355a218d2e7aa4d6e3c9bc2c27d6f X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3509 Lines: 101 Commit-ID: 25a98bd4ff9355a218d2e7aa4d6e3c9bc2c27d6f Gitweb: http://git.kernel.org/tip/25a98bd4ff9355a218d2e7aa4d6e3c9bc2c27d6f Author: Jiang Liu AuthorDate: Thu, 9 Jul 2015 16:00:45 +0800 Committer: Thomas Gleixner CommitDate: Wed, 22 Jul 2015 18:37:43 +0200 genirq/MSI: Store 'struct device' instead of 'struct pci_dev' in struct msi_desc Store 'struct device *' instead of 'struct pci_dev *' in struct msi_desc, so struct msi_desc can be reused by non PCI based MSI drivers. Signed-off-by: Jiang Liu Reviewed-by: Yijing Wang Reviewed-by: Marc Zyngier Cc: Tony Luck Cc: linux-arm-kernel@lists.infradead.org Cc: Bjorn Helgaas Cc: Grant Likely Cc: Stuart Yoder Cc: Borislav Petkov Cc: Alexander Gordeev Link: http://lkml.kernel.org/r/1436428847-8886-11-git-send-email-jiang.liu@linux.intel.com Signed-off-by: Thomas Gleixner --- drivers/pci/msi.c | 7 ++++++- include/linux/msi.h | 11 ++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 4ef5021..897e1a4 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -413,7 +413,7 @@ static struct msi_desc *alloc_msi_entry(struct pci_dev *dev) return NULL; INIT_LIST_HEAD(&desc->list); - desc->dev = dev; + desc->dev = &dev->dev; return desc; } @@ -1140,6 +1140,11 @@ int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, } EXPORT_SYMBOL(pci_enable_msix_range); +struct pci_dev *msi_desc_to_pci_dev(struct msi_desc *desc) +{ + return to_pci_dev(desc->dev); +} + void *msi_desc_to_pci_sysdata(struct msi_desc *desc) { struct pci_dev *dev = msi_desc_to_pci_dev(desc); diff --git a/include/linux/msi.h b/include/linux/msi.h index 57fe766..5f77e23 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -14,6 +14,7 @@ extern int pci_msi_ignore_mask; /* Helper functions */ struct irq_data; struct msi_desc; +struct pci_dev; void __get_cached_msi_msg(struct msi_desc *entry, struct msi_msg *msg); void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg); @@ -37,14 +38,14 @@ struct msi_desc { void __iomem *mask_base; u8 mask_pos; }; - struct pci_dev *dev; + struct device *dev; /* Last set MSI message */ struct msi_msg msg; }; /* Helpers to hide struct msi_desc implementation details */ -#define msi_desc_to_dev(desc) (&(desc)->dev.dev) +#define msi_desc_to_dev(desc) ((desc)->dev) #define dev_to_msi_list(dev) (&(dev)->msi_list) #define first_msi_entry(dev) \ list_first_entry(dev_to_msi_list((dev)), struct msi_desc, list) @@ -56,11 +57,7 @@ struct msi_desc { #define for_each_pci_msi_entry(desc, pdev) \ for_each_msi_entry((desc), &(pdev)->dev) -static inline struct pci_dev *msi_desc_to_pci_dev(struct msi_desc *desc) -{ - return desc->dev; -} - +struct pci_dev *msi_desc_to_pci_dev(struct msi_desc *desc); void *msi_desc_to_pci_sysdata(struct msi_desc *desc); #else /* CONFIG_PCI_MSI */ static inline void *msi_desc_to_pci_sysdata(struct msi_desc *desc) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/