Commit 1197528a authored by Thomas Gleixner's avatar Thomas Gleixner

genirq/msi: Guard sysfs code

No point in building unused code when CONFIG_SYSFS=n.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarJuergen Gross <jgross@suse.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20211206210223.985907940@linutronix.de
parent 29bbc35e
...@@ -239,9 +239,19 @@ void __pci_write_msi_msg(struct msi_desc *entry, struct msi_msg *msg); ...@@ -239,9 +239,19 @@ void __pci_write_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
void pci_msi_mask_irq(struct irq_data *data); void pci_msi_mask_irq(struct irq_data *data);
void pci_msi_unmask_irq(struct irq_data *data); void pci_msi_unmask_irq(struct irq_data *data);
#ifdef CONFIG_SYSFS
const struct attribute_group **msi_populate_sysfs(struct device *dev); const struct attribute_group **msi_populate_sysfs(struct device *dev);
void msi_destroy_sysfs(struct device *dev, void msi_destroy_sysfs(struct device *dev,
const struct attribute_group **msi_irq_groups); const struct attribute_group **msi_irq_groups);
#else
static inline const struct attribute_group **msi_populate_sysfs(struct device *dev)
{
return NULL;
}
static inline void msi_destroy_sysfs(struct device *dev, const struct attribute_group **msi_irq_groups)
{
}
#endif
/* /*
* The arch hooks to setup up msi irqs. Default functions are implemented * The arch hooks to setup up msi irqs. Default functions are implemented
......
...@@ -72,6 +72,7 @@ void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg) ...@@ -72,6 +72,7 @@ void get_cached_msi_msg(unsigned int irq, struct msi_msg *msg)
} }
EXPORT_SYMBOL_GPL(get_cached_msi_msg); EXPORT_SYMBOL_GPL(get_cached_msi_msg);
#ifdef CONFIG_SYSFS
static ssize_t msi_mode_show(struct device *dev, struct device_attribute *attr, static ssize_t msi_mode_show(struct device *dev, struct device_attribute *attr,
char *buf) char *buf)
{ {
...@@ -204,6 +205,7 @@ void msi_destroy_sysfs(struct device *dev, const struct attribute_group **msi_ir ...@@ -204,6 +205,7 @@ void msi_destroy_sysfs(struct device *dev, const struct attribute_group **msi_ir
kfree(msi_irq_groups); kfree(msi_irq_groups);
} }
} }
#endif
#ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN #ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN
static inline void irq_chip_write_msi_msg(struct irq_data *data, static inline void irq_chip_write_msi_msg(struct irq_data *data,
......
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