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/pwm/pwm-meson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/pwm/pwm-meson.c') diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c index cafb571f16f..e538e27e136 100644 --- a/drivers/pwm/pwm-meson.c +++ b/drivers/pwm/pwm-meson.c @@ -524,5 +524,5 @@ U_BOOT_DRIVER(meson_pwm) = { .ops = &meson_pwm_ops, .ofdata_to_platdata = meson_pwm_ofdata_to_platdata, .probe = meson_pwm_probe, - .priv_auto_alloc_size = sizeof(struct meson_pwm), + .priv_auto = sizeof(struct meson_pwm), }; -- cgit v1.2.3 From d1998a9fde0a917d6496299f6a97b6bccfdc6724 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 3 Dec 2020 16:55:21 -0700 Subject: dm: treewide: Rename ofdata_to_platdata() to of_to_plat() This name is far too long. Rename it to remove the 'data' bits. This makes it consistent with the platdata->plat rename. Signed-off-by: Simon Glass --- drivers/pwm/pwm-meson.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/pwm/pwm-meson.c') diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c index e538e27e136..58b7469f977 100644 --- a/drivers/pwm/pwm-meson.c +++ b/drivers/pwm/pwm-meson.c @@ -249,7 +249,7 @@ static int meson_pwm_set_invert(struct udevice *dev, uint channeln, bool polarit return meson_pwm_set_config(dev, channeln, channel->period_ns, channel->duty_ns); } -static int meson_pwm_ofdata_to_platdata(struct udevice *dev) +static int meson_pwm_of_to_plat(struct udevice *dev) { struct meson_pwm *priv = dev_get_priv(dev); @@ -522,7 +522,7 @@ U_BOOT_DRIVER(meson_pwm) = { .id = UCLASS_PWM, .of_match = meson_pwm_ids, .ops = &meson_pwm_ops, - .ofdata_to_platdata = meson_pwm_ofdata_to_platdata, + .of_to_plat = meson_pwm_of_to_plat, .probe = meson_pwm_probe, .priv_auto = sizeof(struct meson_pwm), }; -- cgit v1.2.3 From f10643cf8a4ca006d1ad194e930cd292fd869d17 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 19 Dec 2020 10:40:14 -0700 Subject: dm: core: Access device ofnode through functions At present ofnode is present in the device even if it is never used. With of-platdata this field is not used, so can be removed. In preparation for this, change the access to go through inline functions. Signed-off-by: Simon Glass --- drivers/pwm/pwm-meson.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'drivers/pwm/pwm-meson.c') diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c index 58b7469f977..03eeacc286d 100644 --- a/drivers/pwm/pwm-meson.c +++ b/drivers/pwm/pwm-meson.c @@ -304,13 +304,14 @@ static int meson_pwm_probe(struct udevice *dev) if (strcmp(cdev->driver->name, "fixed_rate_clock")) continue; - str = ofnode_read_string(cdev->node, "clock-output-names"); + str = ofnode_read_string(dev_ofnode(cdev), + "clock-output-names"); if (!str) continue; if (!strcmp(str, "xtal")) { err = uclass_get_device_by_ofnode(UCLASS_CLK, - cdev->node, + dev_ofnode(cdev), &cdev); if (err) { printf("%s%d: Failed to get xtal clk\n", __func__, i); @@ -345,7 +346,9 @@ static int meson_pwm_probe(struct udevice *dev) return -EINVAL; } - err = uclass_get_device_by_ofnode(UCLASS_CLK, cdev->node, &cdev); + err = uclass_get_device_by_ofnode(UCLASS_CLK, + dev_ofnode(cdev), + &cdev); if (err) { printf("%s%d: Failed to get clk controller\n", __func__, i); return err; -- cgit v1.2.3