Commit 22db089a authored by Ahmed S. Darwish's avatar Ahmed S. Darwish Committed by Thomas Gleixner

genirq/msi: Add bus token to struct msi_domain_info

Add a bus token member to struct msi_domain_info and let
msi_create_irq_domain() set the bus token.

That allows to remove the bus token updates at the call sites.
Suggested-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarAhmed S. Darwish <darwi@linutronix.de>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20221111122014.294554462@linutronix.de
parent aeef2052
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
* abuse. The only function which is relevant for drivers is msi_get_virq(). * abuse. The only function which is relevant for drivers is msi_get_virq().
*/ */
#include <linux/irqdomain_defs.h>
#include <linux/cpumask.h> #include <linux/cpumask.h>
#include <linux/xarray.h> #include <linux/xarray.h>
#include <linux/mutex.h> #include <linux/mutex.h>
...@@ -365,6 +366,7 @@ struct msi_domain_ops { ...@@ -365,6 +366,7 @@ struct msi_domain_ops {
/** /**
* struct msi_domain_info - MSI interrupt domain data * struct msi_domain_info - MSI interrupt domain data
* @flags: Flags to decribe features and capabilities * @flags: Flags to decribe features and capabilities
* @bus_token: The domain bus token
* @ops: The callback data structure * @ops: The callback data structure
* @chip: Optional: associated interrupt chip * @chip: Optional: associated interrupt chip
* @chip_data: Optional: associated interrupt chip data * @chip_data: Optional: associated interrupt chip data
...@@ -375,6 +377,7 @@ struct msi_domain_ops { ...@@ -375,6 +377,7 @@ struct msi_domain_ops {
*/ */
struct msi_domain_info { struct msi_domain_info {
u32 flags; u32 flags;
enum irq_domain_bus_token bus_token;
struct msi_domain_ops *ops; struct msi_domain_ops *ops;
struct irq_chip *chip; struct irq_chip *chip;
void *chip_data; void *chip_data;
......
...@@ -694,8 +694,11 @@ struct irq_domain *msi_create_irq_domain(struct fwnode_handle *fwnode, ...@@ -694,8 +694,11 @@ struct irq_domain *msi_create_irq_domain(struct fwnode_handle *fwnode,
domain = irq_domain_create_hierarchy(parent, IRQ_DOMAIN_FLAG_MSI, 0, domain = irq_domain_create_hierarchy(parent, IRQ_DOMAIN_FLAG_MSI, 0,
fwnode, &msi_domain_ops, info); fwnode, &msi_domain_ops, info);
if (domain && !domain->name && info->chip) if (domain) {
if (!domain->name && info->chip)
domain->name = info->chip->name; domain->name = info->chip->name;
irq_domain_update_bus_token(domain, info->bus_token);
}
return domain; return domain;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment