diff options
author | Tom Rini <trini@konsulko.com> | 2021-01-11 13:55:03 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-01-11 13:55:03 -0500 |
commit | d71be1990218957b9f05dbf13a72859a2abe06d7 (patch) | |
tree | 99858dc9988f7f7b4c0ab1d8d45738e3abdf38c8 /test/dm/acpi.c | |
parent | c4fddedc48f336eabc4ce3f74940e6aa372de18c (diff) | |
parent | bc0b99bd8b19599f670f42401de655fa9b44cd94 (diff) |
Merge branch 'next'
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'test/dm/acpi.c')
-rw-r--r-- | test/dm/acpi.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/test/dm/acpi.c b/test/dm/acpi.c index f5eddac10d..e0a323ecd4 100644 --- a/test/dm/acpi.c +++ b/test/dm/acpi.c @@ -25,12 +25,12 @@ #define BUF_SIZE 4096 /** - * struct testacpi_platdata - Platform data for the test ACPI device + * struct testacpi_plat - Platform data for the test ACPI device * * @no_name: true to emit an empty ACPI name from testacpi_get_name() * @return_error: true to return an error instead of a name */ -struct testacpi_platdata { +struct testacpi_plat { bool return_error; bool no_name; }; @@ -53,7 +53,7 @@ static int testacpi_write_tables(const struct udevice *dev, static int testacpi_get_name(const struct udevice *dev, char *out_name) { - struct testacpi_platdata *plat = dev_get_platdata(dev); + struct testacpi_plat *plat = dev_get_plat(dev); if (plat->return_error) return -EINVAL; @@ -110,7 +110,7 @@ U_BOOT_DRIVER(testacpi_drv) = { .of_match = testacpi_ids, .id = UCLASS_TEST_ACPI, .bind = dm_scan_fdt_dev, - .platdata_auto_alloc_size = sizeof(struct testacpi_platdata), + .plat_auto = sizeof(struct testacpi_plat), ACPI_OPS_PTR(&testacpi_ops) }; @@ -123,7 +123,7 @@ UCLASS_DRIVER(testacpi) = { static int dm_test_acpi_get_name(struct unit_test_state *uts) { char name[ACPI_NAME_MAX]; - struct udevice *dev, *dev2, *i2c, *spi, *serial, *timer, *sound; + struct udevice *dev, *dev2, *i2c, *spi, *timer, *sound; struct udevice *pci, *root; /* Test getting the name from the driver */ @@ -146,10 +146,6 @@ static int dm_test_acpi_get_name(struct unit_test_state *uts) ut_assertok(acpi_get_name(spi, name)); ut_asserteq_str("SPI0", name); - /* The uart has no sequence number, so this should fail */ - ut_assertok(uclass_first_device(UCLASS_SERIAL, &serial)); - ut_asserteq(-ENXIO, acpi_get_name(serial, name)); - /* ACPI doesn't know about the timer */ ut_assertok(uclass_first_device(UCLASS_TIMER, &timer)); ut_asserteq(-ENOENT, acpi_get_name(timer, name)); @@ -422,7 +418,7 @@ DM_TEST(dm_test_acpi_cmd_dump, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT); /* Test acpi_device_path() */ static int dm_test_acpi_device_path(struct unit_test_state *uts) { - struct testacpi_platdata *plat; + struct testacpi_plat *plat; char buf[ACPI_PATH_MAX]; struct udevice *dev, *child; @@ -442,13 +438,13 @@ static int dm_test_acpi_device_path(struct unit_test_state *uts) buf); /* Test handling of a device which doesn't produce a name */ - plat = dev_get_platdata(dev); + plat = dev_get_plat(dev); plat->no_name = true; ut_assertok(acpi_device_path(child, buf, sizeof(buf))); ut_asserteq_str("\\_SB." ACPI_TEST_CHILD_NAME, buf); /* Test handling of a device which returns an error */ - plat = dev_get_platdata(dev); + plat = dev_get_plat(dev); plat->return_error = true; ut_asserteq(-EINVAL, acpi_device_path(child, buf, sizeof(buf))); |