platform-msi: Store platform private data pointer in msi_device_data

Storing the platform private data in a MSI descriptor is sloppy at
best. The data belongs to the device and not to the descriptor.
Add a pointer to struct msi_device_data and store the pointer there.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/20211210221814.287680528@linutronix.de
This commit is contained in:
Thomas Gleixner 2021-12-10 23:19:11 +01:00
parent 9835cec6d5
commit fc22e7dbcd
2 changed files with 34 additions and 49 deletions

View file

@ -108,11 +108,9 @@ struct pci_msi_desc {
/**
* platform_msi_desc - Platform device specific msi descriptor data
* @msi_priv_data: Pointer to platform private data
* @msi_index: The index of the MSI descriptor for multi MSI
*/
struct platform_msi_desc {
struct platform_msi_priv_data *msi_priv_data;
u16 msi_index;
};
@ -177,10 +175,12 @@ struct msi_desc {
* 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
*/
struct msi_device_data {
unsigned long properties;
const struct attribute_group **attrs;
struct platform_msi_priv_data *platform_data;
};
int msi_setup_device_data(struct device *dev);