drivers/base/auxiliary.c | 10 ++++++++++ include/linux/auxiliary_bus.h | 2 ++ 2 files changed, 12 insertions(+)
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Introduce dev_is_auxiliary() in analogy with dev_is_platform() to
facilitate subsequent changes.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
Danilo, Greg, please let me know if you have objections or concerns
regarding this one.
The new function is used in the next patch to limit the scope of the
search when looking for duplicates of the device being probed.
---
drivers/base/auxiliary.c | 10 ++++++++++
include/linux/auxiliary_bus.h | 2 ++
2 files changed, 12 insertions(+)
--- a/drivers/base/auxiliary.c
+++ b/drivers/base/auxiliary.c
@@ -502,6 +502,16 @@ struct auxiliary_device *__devm_auxiliar
}
EXPORT_SYMBOL_GPL(__devm_auxiliary_device_create);
+/**
+ * dev_is_auxiliary - check if the device is an auxiliary one
+ * @dev: device to check
+ */
+bool dev_is_auxiliary(struct device *dev)
+{
+ return dev->bus == &auxiliary_bus_type;
+}
+EXPORT_SYMBOL_GPL(dev_is_auxiliary);
+
void __init auxiliary_bus_init(void)
{
WARN_ON(bus_register(&auxiliary_bus_type));
--- a/include/linux/auxiliary_bus.h
+++ b/include/linux/auxiliary_bus.h
@@ -271,6 +271,8 @@ struct auxiliary_device *__devm_auxiliar
__devm_auxiliary_device_create(dev, KBUILD_MODNAME, devname, \
platform_data, 0)
+bool dev_is_auxiliary(struct device *dev);
+
/**
* module_auxiliary_driver() - Helper macro for registering an auxiliary driver
* @__auxiliary_driver: auxiliary driver struct
On Fri Mar 13, 2026 at 1:53 PM CET, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > Introduce dev_is_auxiliary() in analogy with dev_is_platform() to > facilitate subsequent changes. > > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Danilo Krummrich <dakr@kernel.org>
On Fri, Mar 13, 2026 at 01:53:03PM +0100, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > Introduce dev_is_auxiliary() in analogy with dev_is_platform() to > facilitate subsequent changes. > > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > --- > > Danilo, Greg, please let me know if you have objections or concerns > regarding this one. > > The new function is used in the next patch to limit the scope of the > search when looking for duplicates of the device being probed. > > --- > drivers/base/auxiliary.c | 10 ++++++++++ > include/linux/auxiliary_bus.h | 2 ++ > 2 files changed, 12 insertions(+) > Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
© 2016 - 2026 Red Hat, Inc.