summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-03-13 13:57:43 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-03-13 16:48:23 +0100
commit6a8e793ca8db1546d05071ba0807cbf8c4f44a8b (patch)
treed6d934a3d764549fe402b3fb67fb31cae8fa4be9
parent9dc11faca2456384c8f8c5d83b7fc80dafeb9745 (diff)
downloadlinux-6a8e793ca8db1546d05071ba0807cbf8c4f44a8b.tar.gz
linux-6a8e793ca8db1546d05071ba0807cbf8c4f44a8b.zip
ACPI: video: Consolidate pnp.bus_id workarounds handling
Reduce code duplication related to pnp.bus_id workarounds by combining the two existing cases. Also move the definition of static variable "instance" into acpi_video_bus_probe() because it is only used there. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3430879.44csPzL39Z@rafael.j.wysocki
-rw-r--r--drivers/acpi/acpi_video.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
index 037582807453..f48bc7817417 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -1978,14 +1978,13 @@ static bool acpi_video_bus_dev_is_duplicate(struct device *dev)
return device_for_each_child(dev->parent, dev, duplicate_dev_check);
}
-static int instance;
-
static int acpi_video_bus_probe(struct auxiliary_device *aux_dev,
const struct auxiliary_device_id *id_unused)
{
struct acpi_device *device = ACPI_COMPANION(&aux_dev->dev);
static DEFINE_MUTEX(probe_lock);
struct acpi_video_bus *video;
+ static int instance;
bool auto_detect;
int error;
@@ -2005,16 +2004,15 @@ static int acpi_video_bus_probe(struct auxiliary_device *aux_dev,
if (!video)
return -ENOMEM;
- /* a hack to fix the duplicate name "VID" problem on T61 */
- if (!strcmp(device->pnp.bus_id, "VID")) {
- if (instance)
- device->pnp.bus_id[3] = '0' + instance;
- instance++;
- }
- /* a hack to fix the duplicate name "VGA" problem on Pa 3553 */
- if (!strcmp(device->pnp.bus_id, "VGA")) {
+ /*
+ * A hack to fix the duplicate name "VID" problem on T61 and the
+ * duplicate name "VGA" problem on Pa 3553.
+ */
+ if (!strcmp(device->pnp.bus_id, "VID") ||
+ !strcmp(device->pnp.bus_id, "VGA")) {
if (instance)
device->pnp.bus_id[3] = '0' + instance;
+
instance++;
}