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 --- drivers/i2c/i2c-emul-uclass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/i2c/i2c-emul-uclass.c') diff --git a/drivers/i2c/i2c-emul-uclass.c b/drivers/i2c/i2c-emul-uclass.c index 84b6a219d19..956ebeefb61 100644 --- a/drivers/i2c/i2c-emul-uclass.c +++ b/drivers/i2c/i2c-emul-uclass.c @@ -64,14 +64,14 @@ int i2c_emul_find(struct udevice *dev, struct udevice **emulp) UCLASS_DRIVER(i2c_emul) = { .id = UCLASS_I2C_EMUL, .name = "i2c_emul", - .per_device_platdata_auto_alloc_size = + .per_device_platdata_auto = sizeof(struct i2c_emul_uc_platdata), }; /* * This uclass is a child of the i2c bus. Its platdata is not defined here so * is defined by its parent, UCLASS_I2C, which uses struct dm_i2c_chip. See - * per_child_platdata_auto_alloc_size in UCLASS_DRIVER(i2c). + * per_child_platdata_auto in UCLASS_DRIVER(i2c). */ UCLASS_DRIVER(i2c_emul_parent) = { .id = UCLASS_I2C_EMUL_PARENT, -- 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 --- drivers/i2c/i2c-emul-uclass.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers/i2c/i2c-emul-uclass.c') diff --git a/drivers/i2c/i2c-emul-uclass.c b/drivers/i2c/i2c-emul-uclass.c index 956ebeefb61..83f0f90831d 100644 --- a/drivers/i2c/i2c-emul-uclass.c +++ b/drivers/i2c/i2c-emul-uclass.c @@ -14,7 +14,7 @@ * i2c emulation works using an 'emul' node at the bus level. Each device in * that node is in the UCLASS_I2C_EMUL uclass, and emulates one i2c device. A * pointer to the device it emulates is in the 'dev' property of the emul device - * uclass platdata (struct i2c_emul_platdata), put there by i2c_emul_find(). + * uclass plat (struct i2c_emul_platdata), put there by i2c_emul_find(). * When sandbox wants an emulator for a device, it calls i2c_emul_find() which * searches for the emulator with the correct address. To find the device for an * emulator, call i2c_emul_get_device(). @@ -27,7 +27,7 @@ * struct i2c_emul_uc_platdata - information about the emulator for this device * * This is used by devices in UCLASS_I2C_EMUL to record information about the - * device being emulated. It is accessible with dev_get_uclass_platdata() + * device being emulated. It is accessible with dev_get_uclass_plat() * * @dev: Device being emulated */ @@ -37,7 +37,7 @@ struct i2c_emul_uc_platdata { struct udevice *i2c_emul_get_device(struct udevice *emul) { - struct i2c_emul_uc_platdata *uc_plat = dev_get_uclass_platdata(emul); + struct i2c_emul_uc_platdata *uc_plat = dev_get_uclass_plat(emul); return uc_plat->dev; } @@ -54,7 +54,7 @@ int i2c_emul_find(struct udevice *dev, struct udevice **emulp) log_err("No emulators for device '%s'\n", dev->name); return ret; } - uc_plat = dev_get_uclass_platdata(emul); + uc_plat = dev_get_uclass_plat(emul); uc_plat->dev = dev; *emulp = emul; @@ -64,14 +64,14 @@ int i2c_emul_find(struct udevice *dev, struct udevice **emulp) UCLASS_DRIVER(i2c_emul) = { .id = UCLASS_I2C_EMUL, .name = "i2c_emul", - .per_device_platdata_auto = + .per_device_plat_auto = sizeof(struct i2c_emul_uc_platdata), }; /* - * This uclass is a child of the i2c bus. Its platdata is not defined here so + * This uclass is a child of the i2c bus. Its plat is not defined here so * is defined by its parent, UCLASS_I2C, which uses struct dm_i2c_chip. See - * per_child_platdata_auto in UCLASS_DRIVER(i2c). + * per_child_plat_auto in UCLASS_DRIVER(i2c). */ UCLASS_DRIVER(i2c_emul_parent) = { .id = UCLASS_I2C_EMUL_PARENT, -- cgit v1.2.3 From b012ff1f1b0d662587dcf8707fe7cbf1c1f35d2f Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 3 Dec 2020 16:55:22 -0700 Subject: dm: treewide: Update 'auto' declarations to be on one line Fix up the code style for those declarations that should now fit onto one line, which is all of them that currently do not. This is needed for dtoc to detect the structs correctly, at present. Signed-off-by: Simon Glass --- drivers/i2c/i2c-emul-uclass.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/i2c/i2c-emul-uclass.c') diff --git a/drivers/i2c/i2c-emul-uclass.c b/drivers/i2c/i2c-emul-uclass.c index 83f0f90831d..4fbf20e2759 100644 --- a/drivers/i2c/i2c-emul-uclass.c +++ b/drivers/i2c/i2c-emul-uclass.c @@ -64,8 +64,7 @@ int i2c_emul_find(struct udevice *dev, struct udevice **emulp) UCLASS_DRIVER(i2c_emul) = { .id = UCLASS_I2C_EMUL, .name = "i2c_emul", - .per_device_plat_auto = - sizeof(struct i2c_emul_uc_platdata), + .per_device_plat_auto = sizeof(struct i2c_emul_uc_platdata), }; /* -- 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 --- drivers/i2c/i2c-emul-uclass.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/i2c/i2c-emul-uclass.c') diff --git a/drivers/i2c/i2c-emul-uclass.c b/drivers/i2c/i2c-emul-uclass.c index 4fbf20e2759..085b824e895 100644 --- a/drivers/i2c/i2c-emul-uclass.c +++ b/drivers/i2c/i2c-emul-uclass.c @@ -14,7 +14,7 @@ * i2c emulation works using an 'emul' node at the bus level. Each device in * that node is in the UCLASS_I2C_EMUL uclass, and emulates one i2c device. A * pointer to the device it emulates is in the 'dev' property of the emul device - * uclass plat (struct i2c_emul_platdata), put there by i2c_emul_find(). + * uclass plat (struct i2c_emul_plat), put there by i2c_emul_find(). * When sandbox wants an emulator for a device, it calls i2c_emul_find() which * searches for the emulator with the correct address. To find the device for an * emulator, call i2c_emul_get_device(). @@ -24,27 +24,27 @@ */ /** - * struct i2c_emul_uc_platdata - information about the emulator for this device + * struct i2c_emul_uc_plat - information about the emulator for this device * * This is used by devices in UCLASS_I2C_EMUL to record information about the * device being emulated. It is accessible with dev_get_uclass_plat() * * @dev: Device being emulated */ -struct i2c_emul_uc_platdata { +struct i2c_emul_uc_plat { struct udevice *dev; }; struct udevice *i2c_emul_get_device(struct udevice *emul) { - struct i2c_emul_uc_platdata *uc_plat = dev_get_uclass_plat(emul); + struct i2c_emul_uc_plat *uc_plat = dev_get_uclass_plat(emul); return uc_plat->dev; } int i2c_emul_find(struct udevice *dev, struct udevice **emulp) { - struct i2c_emul_uc_platdata *uc_plat; + struct i2c_emul_uc_plat *uc_plat; struct udevice *emul; int ret; @@ -64,7 +64,7 @@ int i2c_emul_find(struct udevice *dev, struct udevice **emulp) UCLASS_DRIVER(i2c_emul) = { .id = UCLASS_I2C_EMUL, .name = "i2c_emul", - .per_device_plat_auto = sizeof(struct i2c_emul_uc_platdata), + .per_device_plat_auto = sizeof(struct i2c_emul_uc_plat), }; /* -- cgit v1.2.3