genirq/msi: Simplify sysfs handling
[linux-2.6-microblaze.git] / include / linux / msi.h
index 70cc6a5..1a00367 100644 (file)
@@ -71,7 +71,7 @@ struct irq_data;
 struct msi_desc;
 struct pci_dev;
 struct platform_msi_priv_data;
-struct attribute_group;
+struct device_attribute;
 
 void __get_cached_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
 #ifdef CONFIG_GENERIC_MSI_IRQ
@@ -129,6 +129,7 @@ struct pci_msi_desc {
  * @dev:       Pointer to the device which uses this descriptor
  * @msg:       The last set MSI message cached for reuse
  * @affinity:  Optional pointer to a cpu affinity mask for this descriptor
+ * @sysfs_attr:        Pointer to sysfs device attribute
  *
  * @write_msi_msg:     Callback that may be called when the MSI message
  *                     address or data changes
@@ -148,6 +149,9 @@ struct msi_desc {
 #ifdef CONFIG_IRQ_MSI_IOMMU
        const void                      *iommu_cookie;
 #endif
+#ifdef CONFIG_SYSFS
+       struct device_attribute         *sysfs_attrs;
+#endif
 
        void (*write_msi_msg)(struct msi_desc *entry, void *data);
        void *write_msi_msg_data;
@@ -171,7 +175,6 @@ enum msi_desc_filter {
 /**
  * msi_device_data - MSI per device data
  * @properties:                MSI properties which are interesting to drivers
- * @attrs:             Pointer to the sysfs attribute group
  * @platform_data:     Platform-MSI specific data
  * @list:              List of MSI descriptors associated to the device
  * @mutex:             Mutex protecting the MSI list
@@ -179,7 +182,6 @@ enum msi_desc_filter {
  */
 struct msi_device_data {
        unsigned long                   properties;
-       const struct attribute_group    **attrs;
        struct platform_msi_priv_data   *platform_data;
        struct list_head                list;
        struct mutex                    mutex;
@@ -264,14 +266,6 @@ 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_unmask_irq(struct irq_data *data);
 
-#ifdef CONFIG_SYSFS
-int msi_device_populate_sysfs(struct device *dev);
-void msi_device_destroy_sysfs(struct device *dev);
-#else /* CONFIG_SYSFS */
-static inline int msi_device_populate_sysfs(struct device *dev) { return 0; }
-static inline void msi_device_destroy_sysfs(struct device *dev) { }
-#endif /* !CONFIG_SYSFS */
-
 /*
  * The arch hooks to setup up msi irqs. Default functions are implemented
  * as weak symbols so that they /can/ be overriden by architecture specific
@@ -285,6 +279,13 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc);
 void arch_teardown_msi_irq(unsigned int irq);
 int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type);
 void arch_teardown_msi_irqs(struct pci_dev *dev);
+#ifdef CONFIG_SYSFS
+int msi_device_populate_sysfs(struct device *dev);
+void msi_device_destroy_sysfs(struct device *dev);
+#else /* CONFIG_SYSFS */
+static inline int msi_device_populate_sysfs(struct device *dev) { return 0; }
+static inline void msi_device_destroy_sysfs(struct device *dev) { }
+#endif /* !CONFIG_SYSFS */
 #endif /* CONFIG_PCI_MSI_ARCH_FALLBACKS */
 
 /*