diff options
author | Simon Glass | 2020-12-16 21:20:23 -0700 |
---|---|---|
committer | Simon Glass | 2020-12-18 20:32:21 -0700 |
commit | d1e85308feed8ea66d2af71860130f004d5f9632 (patch) | |
tree | 9ab40b929d5b34f3e092f6aafd118000634b8eaa /lib/acpi | |
parent | df3dc209526e9d8b5636a01cdb5cc0a396742159 (diff) |
x86: Simplify acpi_device_infer_name()
There is no-longer any need to check if sequence numbers are valid, since
this is ensured by driver model. Drop the unwanted logic.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib/acpi')
-rw-r--r-- | lib/acpi/acpi_device.c | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/lib/acpi/acpi_device.c b/lib/acpi/acpi_device.c index 8efa8e9a535..b5f2cebbde1 100644 --- a/lib/acpi/acpi_device.c +++ b/lib/acpi/acpi_device.c @@ -784,16 +784,6 @@ static const char *acpi_name_from_id(enum uclass_id id) } } -static int acpi_check_seq(const struct udevice *dev) -{ - if (dev->req_seq == -1) { - log_warning("Device '%s' has no seq\n", dev->name); - return log_msg_ret("no seq", -ENXIO); - } - - return dev->req_seq; -} - /* If you change this function, add test cases to dm_test_acpi_get_name() */ int acpi_device_infer_name(const struct udevice *dev, char *out_name) { @@ -826,29 +816,18 @@ int acpi_device_infer_name(const struct udevice *dev, char *out_name) } } if (!name) { - int num; - switch (id) { /* DSDT: acpi/lpss.asl */ case UCLASS_SERIAL: - num = acpi_check_seq(dev); - if (num < 0) - return num; - sprintf(out_name, "URT%d", num); + sprintf(out_name, "URT%d", dev_seq(dev)); name = out_name; break; case UCLASS_I2C: - num = acpi_check_seq(dev); - if (num < 0) - return num; - sprintf(out_name, "I2C%d", num); + sprintf(out_name, "I2C%d", dev_seq(dev)); name = out_name; break; case UCLASS_SPI: - num = acpi_check_seq(dev); - if (num < 0) - return num; - sprintf(out_name, "SPI%d", num); + sprintf(out_name, "SPI%d", dev_seq(dev)); name = out_name; break; default: |