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 --- lib/efi_driver/efi_block_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/efi_driver/efi_block_device.c') diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c index 0e72a68bced..fcd6eb87991 100644 --- a/lib/efi_driver/efi_block_device.c +++ b/lib/efi_driver/efi_block_device.c @@ -196,7 +196,7 @@ U_BOOT_DRIVER(efi_blk) = { .name = "efi_blk", .id = UCLASS_BLK, .ops = &efi_blk_ops, - .platdata_auto_alloc_size = sizeof(struct efi_blk_platdata), + .platdata_auto = sizeof(struct efi_blk_platdata), }; /* EFI driver operators */ -- 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 --- lib/efi_driver/efi_block_device.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'lib/efi_driver/efi_block_device.c') diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c index fcd6eb87991..830fdabe387 100644 --- a/lib/efi_driver/efi_block_device.c +++ b/lib/efi_driver/efi_block_device.c @@ -59,8 +59,8 @@ struct efi_blk_platdata { static ulong efi_bl_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, void *buffer) { - struct efi_blk_platdata *platdata = dev_get_platdata(dev); - struct efi_block_io *io = platdata->io; + struct efi_blk_platdata *plat = dev_get_platdata(dev); + struct efi_block_io *io = plat->io; efi_status_t ret; EFI_PRINT("%s: read '%s', from block " LBAFU ", " LBAFU " blocks\n", @@ -88,8 +88,8 @@ static ulong efi_bl_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, static ulong efi_bl_write(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, const void *buffer) { - struct efi_blk_platdata *platdata = dev_get_platdata(dev); - struct efi_block_io *io = platdata->io; + struct efi_blk_platdata *plat = dev_get_platdata(dev); + struct efi_block_io *io = plat->io; efi_status_t ret; EFI_PRINT("%s: write '%s', from block " LBAFU ", " LBAFU " blocks\n", @@ -118,7 +118,7 @@ static int efi_bl_bind_partitions(efi_handle_t handle, struct udevice *dev) struct blk_desc *desc; const char *if_typename; - desc = dev_get_uclass_platdata(dev); + desc = dev_get_uclass_plat(dev); if_typename = blk_get_if_type_name(desc->if_type); return efi_disk_create_partitions(handle, desc, if_typename, @@ -140,7 +140,7 @@ static int efi_bl_bind(efi_handle_t handle, void *interface) struct efi_object *obj = efi_search_obj(handle); struct efi_block_io *io = interface; int disks; - struct efi_blk_platdata *platdata; + struct efi_blk_platdata *plat; EFI_PRINT("%s: handle %p, interface %p\n", __func__, handle, io); @@ -169,9 +169,9 @@ static int efi_bl_bind(efi_handle_t handle, void *interface) /* Set the DM_FLAG_NAME_ALLOCED flag to avoid a memory leak */ device_set_name_alloced(bdev); - platdata = dev_get_platdata(bdev); - platdata->handle = handle; - platdata->io = interface; + plat = dev_get_platdata(bdev); + plat->handle = handle; + plat->io = interface; ret = device_probe(bdev); if (ret) @@ -196,7 +196,7 @@ U_BOOT_DRIVER(efi_blk) = { .name = "efi_blk", .id = UCLASS_BLK, .ops = &efi_blk_ops, - .platdata_auto = sizeof(struct efi_blk_platdata), + .plat_auto = sizeof(struct efi_blk_platdata), }; /* EFI driver operators */ -- 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 --- lib/efi_driver/efi_block_device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/efi_driver/efi_block_device.c') diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c index 830fdabe387..5cccc0ce4da 100644 --- a/lib/efi_driver/efi_block_device.c +++ b/lib/efi_driver/efi_block_device.c @@ -59,7 +59,7 @@ struct efi_blk_platdata { static ulong efi_bl_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, void *buffer) { - struct efi_blk_platdata *plat = dev_get_platdata(dev); + struct efi_blk_platdata *plat = dev_get_plat(dev); struct efi_block_io *io = plat->io; efi_status_t ret; @@ -88,7 +88,7 @@ static ulong efi_bl_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, static ulong efi_bl_write(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, const void *buffer) { - struct efi_blk_platdata *plat = dev_get_platdata(dev); + struct efi_blk_platdata *plat = dev_get_plat(dev); struct efi_block_io *io = plat->io; efi_status_t ret; @@ -169,7 +169,7 @@ static int efi_bl_bind(efi_handle_t handle, void *interface) /* Set the DM_FLAG_NAME_ALLOCED flag to avoid a memory leak */ device_set_name_alloced(bdev); - plat = dev_get_platdata(bdev); + plat = dev_get_plat(bdev); plat->handle = handle; plat->io = interface; -- 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 --- lib/efi_driver/efi_block_device.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/efi_driver/efi_block_device.c') diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c index 5cccc0ce4da..0937e3595a4 100644 --- a/lib/efi_driver/efi_block_device.c +++ b/lib/efi_driver/efi_block_device.c @@ -42,7 +42,7 @@ * handle handle of the controller on which this driver is installed * io block io protocol proxied by this driver */ -struct efi_blk_platdata { +struct efi_blk_plat { efi_handle_t handle; struct efi_block_io *io; }; @@ -59,7 +59,7 @@ struct efi_blk_platdata { static ulong efi_bl_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, void *buffer) { - struct efi_blk_platdata *plat = dev_get_plat(dev); + struct efi_blk_plat *plat = dev_get_plat(dev); struct efi_block_io *io = plat->io; efi_status_t ret; @@ -88,7 +88,7 @@ static ulong efi_bl_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, static ulong efi_bl_write(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt, const void *buffer) { - struct efi_blk_platdata *plat = dev_get_plat(dev); + struct efi_blk_plat *plat = dev_get_plat(dev); struct efi_block_io *io = plat->io; efi_status_t ret; @@ -140,7 +140,7 @@ static int efi_bl_bind(efi_handle_t handle, void *interface) struct efi_object *obj = efi_search_obj(handle); struct efi_block_io *io = interface; int disks; - struct efi_blk_platdata *plat; + struct efi_blk_plat *plat; EFI_PRINT("%s: handle %p, interface %p\n", __func__, handle, io); @@ -196,7 +196,7 @@ U_BOOT_DRIVER(efi_blk) = { .name = "efi_blk", .id = UCLASS_BLK, .ops = &efi_blk_ops, - .plat_auto = sizeof(struct efi_blk_platdata), + .plat_auto = sizeof(struct efi_blk_plat), }; /* EFI driver operators */ -- cgit v1.2.3