The only unconditional part of MSI data in struct device is the irqdomain pointer. Everything else can be allocated on demand. Create a data structure and move the irqdomain pointer into it. The other MSI specific parts are going to be removed from struct device in later steps.
Showing the changes to include (1 of 7 files). Show all
Unified · Split
| @@ -371,6 +371,16 @@ struct dev_links_info { · 370 unmodified lines | ||
| 371 | 371 | enum dl_dev_state status; |
| 372 | 372 | }; |
| 373 | 373 | |
| 374 | +/** | |
| 375 | + * struct dev_msi_info - Device data related to MSI | |
| 376 | + * @domain: The MSI interrupt domain associated to the device | |
| 377 | + */ | |
| 378 | +struct dev_msi_info { | |
| 379 | +#ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN | |
| 380 | + struct irq_domain *domain; | |
| 381 | +#endif | |
| 382 | +}; | |
| 383 | + | |
| 374 | 384 | /** |
| 375 | 385 | * struct device - The basic device structure |
| 376 | 386 | * @parent: The device's "parent" device, the device to which it is attached. |
| @@ -407,8 +417,8 @@ struct dev_links_info { · 30 unmodified lines | ||
| 407 | 417 | * @em_pd: device's energy model performance domain |
| 408 | 418 | * @pins: For device pin management. |
| 409 | 419 | * See Documentation/driver-api/pin-control.rst for details. |
| 420 | + * @msi: MSI related data | |
| 410 | 421 | * @msi_list: Hosts MSI descriptors |
| 411 | − * @msi_domain: The generic MSI domain this device is using. | |
| 412 | 422 | * @numa_node: NUMA node this device is close to. |
| 413 | 423 | * @dma_ops: DMA mapping operations for this device. |
| 414 | 424 | * @dma_mask: Dma mask (if dma'ble device). |
| @@ -500,12 +510,10 @@ struct device { · 85 unmodified lines | ||
| 500 | 510 | struct em_perf_domain *em_pd; |
| 501 | 511 | #endif |
| 502 | 512 | |
| 503 | −#ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN | |
| 504 | − struct irq_domain *msi_domain; | |
| 505 | −#endif | |
| 506 | 513 | #ifdef CONFIG_PINCTRL |
| 507 | 514 | struct dev_pin_info *pins; |
| 508 | 515 | #endif |
| 516 | + struct dev_msi_info msi; | |
| 509 | 517 | #ifdef CONFIG_GENERIC_MSI_IRQ |
| 510 | 518 | struct list_head msi_list; |
| 511 | 519 | #endif |
| @@ -666,7 +674,7 @@ static inline void set_dev_node(struct device *dev, int node) · 154 unmodified lines | ||
| 666 | 674 | static inline struct irq_domain *dev_get_msi_domain(const struct device *dev) |
| 667 | 675 | { |
| 668 | 676 | #ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN |
| 669 | − return dev->msi_domain; | |
| 677 | + return dev->msi.domain; | |
| 670 | 678 | #else |
| 671 | 679 | return NULL; |
| 672 | 680 | #endif |
| @@ -675,7 +683,7 @@ static inline struct irq_domain *dev_get_msi_domain(const struct device *dev) · 2 unmodified lines | ||
| 675 | 683 | static inline void dev_set_msi_domain(struct device *dev, struct irq_domain *d) |
| 676 | 684 | { |
| 677 | 685 | #ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN |
| 678 | − dev->msi_domain = d; | |
| 686 | + dev->msi.domain = d; | |
| 679 | 687 | #endif |
| 680 | 688 | } |
| 681 | 689 | |