mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
ACPI: provide acpi_bus_find_device_by_name()
Provide a helper allowing to locate an ACPI device by its name. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Acked-by: Rafael J. Wysocki (Intel) <rafael@kernel.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://patch.msgid.link/20260504-baytrail-real-swnode-v5-1-c7878b69e383@oss.qualcomm.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
parent
fa84425e53
commit
083a59e05d
|
|
@ -1181,6 +1181,21 @@ int acpi_bus_for_each_dev(int (*fn)(struct device *, void *), void *data)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(acpi_bus_for_each_dev);
|
||||
|
||||
/**
|
||||
* acpi_bus_find_device_by_name() - Locate an ACPI device by its name
|
||||
* @name: Name of the device to match
|
||||
*
|
||||
* The caller is responsible for calling put_device() on the returned object.
|
||||
*
|
||||
* Returns:
|
||||
* New reference to the matched device or NULL if the device can't be found.
|
||||
*/
|
||||
struct device *acpi_bus_find_device_by_name(const char *name)
|
||||
{
|
||||
return bus_find_device_by_name(&acpi_bus_type, NULL, name);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(acpi_bus_find_device_by_name);
|
||||
|
||||
struct acpi_dev_walk_context {
|
||||
int (*fn)(struct acpi_device *, void *);
|
||||
void *data;
|
||||
|
|
|
|||
|
|
@ -798,6 +798,8 @@ int acpi_get_local_u64_address(acpi_handle handle, u64 *addr);
|
|||
int acpi_get_local_address(acpi_handle handle, u32 *addr);
|
||||
const char *acpi_get_subsystem_id(acpi_handle handle);
|
||||
|
||||
struct device *acpi_bus_find_device_by_name(const char *name);
|
||||
|
||||
#ifdef CONFIG_ACPI_MRRM
|
||||
int acpi_mrrm_max_mem_region(void);
|
||||
#endif
|
||||
|
|
@ -1106,6 +1108,11 @@ static inline const char *acpi_get_subsystem_id(acpi_handle handle)
|
|||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
static inline struct device *acpi_bus_find_device_by_name(const char *name)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline int acpi_register_wakeup_handler(int wake_irq,
|
||||
bool (*wakeup)(void *context), void *context)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user