From 41575d8e4c334df148c4cdd7c40cc825dc0fcaa1 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 3 Dec 2020 16:55:17 -0700 Subject: dm: treewide: Rename auto_alloc_size members to be shorter This construct is quite long-winded. In earlier days it made some sense since auto-allocation was a strange concept. But with driver model now used pretty universally, we can shorten this to 'auto'. This reduces verbosity and makes it easier to read. Coincidentally it also ensures that every declaration is on one line, thus making dtoc's job easier. Signed-off-by: Simon Glass --- test/dm/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/dm/acpi.c') diff --git a/test/dm/acpi.c b/test/dm/acpi.c index f5eddac10d0..d53f9977604 100644 --- a/test/dm/acpi.c +++ b/test/dm/acpi.c @@ -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), + .platdata_auto = sizeof(struct testacpi_platdata), ACPI_OPS_PTR(&testacpi_ops) }; -- cgit v1.2.3 From caa4daa2ae3dc0a3e516addea5772c9af76abcb0 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 3 Dec 2020 16:55:18 -0700 Subject: dm: treewide: Rename 'platdata' variables to just 'plat' We use 'priv' for private data but often use 'platdata' for platform data. We can't really use 'pdata' since that is ambiguous (it could mean private or platform data). Rename some of the latter variables to end with 'plat' for consistency. Signed-off-by: Simon Glass --- test/dm/acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/dm/acpi.c') diff --git a/test/dm/acpi.c b/test/dm/acpi.c index d53f9977604..d0c49c73ce0 100644 --- a/test/dm/acpi.c +++ b/test/dm/acpi.c @@ -110,7 +110,7 @@ U_BOOT_DRIVER(testacpi_drv) = { .of_match = testacpi_ids, .id = UCLASS_TEST_ACPI, .bind = dm_scan_fdt_dev, - .platdata_auto = sizeof(struct testacpi_platdata), + .plat_auto = sizeof(struct testacpi_platdata), ACPI_OPS_PTR(&testacpi_ops) }; -- cgit v1.2.3 From c69cda25c9b59e53a6bc8969ada58942549f5b5d Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 3 Dec 2020 16:55:20 -0700 Subject: dm: treewide: Rename dev_get_platdata() to dev_get_plat() Rename this to be consistent with the change from 'platdata'. Signed-off-by: Simon Glass --- test/dm/acpi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/dm/acpi.c') diff --git a/test/dm/acpi.c b/test/dm/acpi.c index d0c49c73ce0..1c7c6caf1bd 100644 --- a/test/dm/acpi.c +++ b/test/dm/acpi.c @@ -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_platdata *plat = dev_get_plat(dev); if (plat->return_error) return -EINVAL; @@ -442,13 +442,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))); -- cgit v1.2.3 From 8a8d24bdf174851ebb8607f359d54b72e3283b97 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 3 Dec 2020 16:55:23 -0700 Subject: dm: treewide: Rename ..._platdata variables to just ..._plat Try to maintain some consistency between these variables by using _plat as a suffix for them. Signed-off-by: Simon Glass --- test/dm/acpi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/dm/acpi.c') diff --git a/test/dm/acpi.c b/test/dm/acpi.c index 1c7c6caf1bd..c5c3726382e 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_plat(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, - .plat_auto = sizeof(struct testacpi_platdata), + .plat_auto = sizeof(struct testacpi_plat), ACPI_OPS_PTR(&testacpi_ops) }; @@ -422,7 +422,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; -- cgit v1.2.3 From d1e85308feed8ea66d2af71860130f004d5f9632 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 16 Dec 2020 21:20:23 -0700 Subject: 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 --- test/dm/acpi.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'test/dm/acpi.c') diff --git a/test/dm/acpi.c b/test/dm/acpi.c index c5c3726382e..e0a323ecd40 100644 --- a/test/dm/acpi.c +++ b/test/dm/acpi.c @@ -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)); -- cgit v1.2.3