Skip to content

Commit 5f70fd1

Browse files
raagjadavrafaeljw
authored andcommitted
ACPI: sysfs: use acpi_device_uid() for fetching _UID
Convert manual _UID references to use the standard ACPI helper. Signed-off-by: Raag Jadav <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 5872080 commit 5f70fd1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/acpi/device_sysfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ static ssize_t uid_show(struct device *dev,
410410
{
411411
struct acpi_device *acpi_dev = to_acpi_device(dev);
412412

413-
return sprintf(buf, "%s\n", acpi_dev->pnp.unique_id);
413+
return sprintf(buf, "%s\n", acpi_device_uid(acpi_dev));
414414
}
415415
static DEVICE_ATTR_RO(uid);
416416

@@ -554,7 +554,7 @@ int acpi_device_setup_files(struct acpi_device *dev)
554554

555555
if (dev->pnp.type.bus_address)
556556
result = device_create_file(&dev->dev, &dev_attr_adr);
557-
if (dev->pnp.unique_id)
557+
if (acpi_device_uid(dev))
558558
result = device_create_file(&dev->dev, &dev_attr_uid);
559559

560560
if (acpi_has_method(dev->handle, "_SUN")) {
@@ -635,7 +635,7 @@ void acpi_device_remove_files(struct acpi_device *dev)
635635
if (acpi_has_method(dev->handle, "_HRV"))
636636
device_remove_file(&dev->dev, &dev_attr_hrv);
637637

638-
if (dev->pnp.unique_id)
638+
if (acpi_device_uid(dev))
639639
device_remove_file(&dev->dev, &dev_attr_uid);
640640
if (dev->pnp.type.bus_address)
641641
device_remove_file(&dev->dev, &dev_attr_adr);

0 commit comments

Comments
 (0)