History

device: Move MSI related data into a struct

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.

Thomas Gleixner committed 4 years ago

Commit 34fff621 parent ed1533b7 files · +29 −21Browse files

Showing the changes to include (1 of 7 files). Show all

Unified · Split

include/linux/device.h+14−6
@@ -371,6 +371,16 @@ struct dev_links_info { · 370 unmodified lines
371371 enum dl_dev_state status;
372372 };
373373
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+
374384 /**
375385 * struct device - The basic device structure
376386 * @parent: The device's "parent" device, the device to which it is attached.
@@ -407,8 +417,8 @@ struct dev_links_info { · 30 unmodified lines
407417 * @em_pd: device's energy model performance domain
408418 * @pins: For device pin management.
409419 * See Documentation/driver-api/pin-control.rst for details.
420+ * @msi: MSI related data
410421 * @msi_list: Hosts MSI descriptors
411− * @msi_domain: The generic MSI domain this device is using.
412422 * @numa_node: NUMA node this device is close to.
413423 * @dma_ops: DMA mapping operations for this device.
414424 * @dma_mask: Dma mask (if dma'ble device).
@@ -500,12 +510,10 @@ struct device { · 85 unmodified lines
500510 struct em_perf_domain *em_pd;
501511 #endif
502512
503−#ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN
504− struct irq_domain *msi_domain;
505−#endif
506513 #ifdef CONFIG_PINCTRL
507514 struct dev_pin_info *pins;
508515 #endif
516+ struct dev_msi_info msi;
509517 #ifdef CONFIG_GENERIC_MSI_IRQ
510518 struct list_head msi_list;
511519 #endif
@@ -666,7 +674,7 @@ static inline void set_dev_node(struct device *dev, int node) · 154 unmodified lines
666674 static inline struct irq_domain *dev_get_msi_domain(const struct device *dev)
667675 {
668676 #ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN
669− return dev->msi_domain;
677+ return dev->msi.domain;
670678 #else
671679 return NULL;
672680 #endif
@@ -675,7 +683,7 @@ static inline struct irq_domain *dev_get_msi_domain(const struct device *dev) · 2 unmodified lines
675683 static inline void dev_set_msi_domain(struct device *dev, struct irq_domain *d)
676684 {
677685 #ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN
678− dev->msi_domain = d;
686+ dev->msi.domain = d;
679687 #endif
680688 }
681689

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t