diff mbox series

[v4,02/10] driver core: add irq_get_affinity callback device_driver

Message ID 20241113-refactor-blk-affinity-helpers-v4-2-dd3baa1e267f@kernel.org
State New
Headers show
Series blk: refactor queue affinity helpers | expand

Commit Message

Daniel Wagner Nov. 13, 2024, 2:26 p.m. UTC
Introducing a callback in struct device_driver so that a device driver
can hook up the getters directly. This approach avoids exposing random
getters in drivers.

Signed-off-by: Daniel Wagner <wagi@kernel.org>
---
 include/linux/device/driver.h | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/include/linux/device/driver.h b/include/linux/device/driver.h
index 5c04b8e3833b995f9fd4d65b8732b3dfce2eba7e..0d1aee423f6c076ae102bdd0536233c259947fac 100644
--- a/include/linux/device/driver.h
+++ b/include/linux/device/driver.h
@@ -74,6 +74,7 @@  enum probe_type {
  * @suspend:	Called to put the device to sleep mode. Usually to a
  *		low power state.
  * @resume:	Called to bring a device from sleep mode.
+ * @irq_get_affinity:	Get IRQ affinity mask for the device.
  * @groups:	Default attributes that get created by the driver core
  *		automatically.
  * @dev_groups:	Additional attributes attached to device instance once
@@ -112,6 +113,8 @@  struct device_driver {
 	void (*shutdown) (struct device *dev);
 	int (*suspend) (struct device *dev, pm_message_t state);
 	int (*resume) (struct device *dev);
+	const struct cpumask *(*irq_get_affinity)(struct device *dev,
+			unsigned int irq_vec);
 	const struct attribute_group **groups;
 	const struct attribute_group **dev_groups;