mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 04:34:03 +02:00
ACPI: utils: Introduce acpi_dev_is_video_device() helper
There are a couple of users that open code functionality of matching a given handle against ACPI video device IDs. The current approach duplicates ID table along with the matching code. Consolidate it under the acpi_dev_is_video_device() helper's hood. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> [ rjw: Moved the static var declaration into the function body ] Link: https://patch.msgid.link/20260714185915.865396-2-andriy.shevchenko@linux.intel.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
c01576a7f5
commit
c75c99aafe
|
|
@ -1047,6 +1047,23 @@ static int __init acpi_backlight(char *str)
|
|||
}
|
||||
__setup("acpi_backlight=", acpi_backlight);
|
||||
|
||||
/**
|
||||
* acpi_dev_is_video_device - test if device matches against ACPI video device IDs
|
||||
* @adev: ACPI device to test
|
||||
*
|
||||
* Return: true when matches, otherwise false.
|
||||
*/
|
||||
bool acpi_dev_is_video_device(struct acpi_device *adev)
|
||||
{
|
||||
static const struct acpi_device_id video_device_ids[] = {
|
||||
{ .id = ACPI_VIDEO_HID },
|
||||
{ }
|
||||
};
|
||||
|
||||
return adev && !acpi_match_device_ids(adev, video_device_ids);
|
||||
}
|
||||
EXPORT_SYMBOL(acpi_dev_is_video_device);
|
||||
|
||||
/**
|
||||
* acpi_match_platform_list - Check if the system matches with a given list
|
||||
* @plat: pointer to acpi_platform_list table terminated by a NULL entry
|
||||
|
|
|
|||
|
|
@ -448,6 +448,7 @@ extern char *wmi_get_acpi_device_uid(const char *guid);
|
|||
#define ACPI_VIDEO_OUTPUT_SWITCHING_DMI_VIDEO 0x0800
|
||||
|
||||
extern char acpi_video_backlight_string[];
|
||||
extern bool acpi_dev_is_video_device(struct acpi_device *adev);
|
||||
extern long acpi_is_video_device(acpi_handle handle);
|
||||
|
||||
extern void acpi_osi_setup(char *str);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user