From 20e442ab2df355450006574fff178c746d254a18 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 28 Dec 2020 20:34:54 -0700 Subject: dm: Rename U_BOOT_DEVICE() to U_BOOT_DRVINFO() The current macro is a misnomer since it does not declare a device directly. Instead, it declares driver_info record which U-Boot uses at runtime to create a device. The distinction seems somewhat minor most of the time, but is becomes quite confusing when we actually want to declare a device, with of-platdata. We are left trying to distinguish between a device which isn't actually device, and a device that is (perhaps an 'instance'?) It seems better to rename this macro to describe what it actually is. The macros is not widely used, since boards should use devicetree to declare devices. Rename it to U_BOOT_DRVINFO(), which indicates clearly that this is declaring a new driver_info record, not a device. Signed-off-by: Simon Glass --- board/st/stv0991/stv0991.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'board/st') diff --git a/board/st/stv0991/stv0991.c b/board/st/stv0991/stv0991.c index 3371973..95e203f 100644 --- a/board/st/stv0991/stv0991.c +++ b/board/st/stv0991/stv0991.c @@ -30,7 +30,7 @@ static const struct pl01x_serial_plat serial_plat = { .clock = 2700 * 1000, }; -U_BOOT_DEVICE(stv09911_serials) = { +U_BOOT_DRVINFO(stv09911_serials) = { .name = "serial_pl01x", .plat = &serial_plat, }; -- cgit v1.1 From 65e25bea597ccaaea756c593318bea1e574d8df1 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 28 Dec 2020 20:34:56 -0700 Subject: dm: Rename DM_GET_DRIVER() to DM_DRIVER_GET() In the spirit of using the same base name for all of these related macros, rename this to have the operation at the end. This is not widely used so the impact is fairly small. Signed-off-by: Simon Glass --- board/st/common/cmd_stboard.c | 2 +- board/st/common/stm32mp_dfu.c | 4 ++-- board/st/common/stpmic1.c | 4 ++-- board/st/common/stusb160x.c | 2 +- board/st/stm32mp1/stm32mp1.c | 12 ++++++------ 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'board/st') diff --git a/board/st/common/cmd_stboard.c b/board/st/common/cmd_stboard.c index e103861..2fba383 100644 --- a/board/st/common/cmd_stboard.c +++ b/board/st/common/cmd_stboard.c @@ -85,7 +85,7 @@ static int do_stboard(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_USAGE; ret = uclass_get_device_by_driver(UCLASS_MISC, - DM_GET_DRIVER(stm32mp_bsec), + DM_DRIVER_GET(stm32mp_bsec), &dev); ret = misc_read(dev, STM32_BSEC_OTP(BSEC_OTP_BOARD), diff --git a/board/st/common/stm32mp_dfu.c b/board/st/common/stm32mp_dfu.c index aab7d74..9c3d115 100644 --- a/board/st/common/stm32mp_dfu.c +++ b/board/st/common/stm32mp_dfu.c @@ -163,7 +163,7 @@ static int dfu_otp_read(u64 offset, u8 *buffer, long *size) int ret; ret = uclass_get_device_by_driver(UCLASS_MISC, - DM_GET_DRIVER(stm32mp_bsec), + DM_DRIVER_GET(stm32mp_bsec), &dev); if (ret) return ret; @@ -184,7 +184,7 @@ static int dfu_pmic_read(u64 offset, u8 *buffer, long *size) struct udevice *dev; ret = uclass_get_device_by_driver(UCLASS_MISC, - DM_GET_DRIVER(stpmic1_nvm), + DM_DRIVER_GET(stpmic1_nvm), &dev); if (ret) return ret; diff --git a/board/st/common/stpmic1.c b/board/st/common/stpmic1.c index 3aa379e..a313b81 100644 --- a/board/st/common/stpmic1.c +++ b/board/st/common/stpmic1.c @@ -20,7 +20,7 @@ int board_ddr_power_init(enum ddr_type ddr_type) u32 buck2; ret = uclass_get_device_by_driver(UCLASS_PMIC, - DM_GET_DRIVER(pmic_stpmic1), &dev); + DM_DRIVER_GET(pmic_stpmic1), &dev); if (ret) /* No PMIC on board */ return 0; @@ -187,7 +187,7 @@ void stpmic1_init(u32 voltage_mv) struct udevice *dev; if (uclass_get_device_by_driver(UCLASS_PMIC, - DM_GET_DRIVER(pmic_stpmic1), &dev)) + DM_DRIVER_GET(pmic_stpmic1), &dev)) return; /* update VDDCORE = BUCK1 */ diff --git a/board/st/common/stusb160x.c b/board/st/common/stusb160x.c index f1197f9..e0a2b76 100644 --- a/board/st/common/stusb160x.c +++ b/board/st/common/stusb160x.c @@ -22,7 +22,7 @@ int stusb160x_cable_connected(void) int ret; ret = uclass_get_device_by_driver(UCLASS_I2C_GENERIC, - DM_GET_DRIVER(stusb160x), + DM_DRIVER_GET(stusb160x), &dev); if (ret < 0) return ret; diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 8a3ce0a..08393b2 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -116,7 +116,7 @@ int checkboard(void) /* display the STMicroelectronics board identification */ if (CONFIG_IS_ENABLED(CMD_STBOARD)) { ret = uclass_get_device_by_driver(UCLASS_MISC, - DM_GET_DRIVER(stm32mp_bsec), + DM_DRIVER_GET(stm32mp_bsec), &dev); if (!ret) ret = misc_read(dev, STM32_BSEC_SHADOW(BSEC_OTP_BOARD), @@ -196,7 +196,7 @@ int g_dnl_board_usb_cable_connected(void) return ret; ret = uclass_get_device_by_driver(UCLASS_USB_GADGET_GENERIC, - DM_GET_DRIVER(dwc2_udc_otg), + DM_DRIVER_GET(dwc2_udc_otg), &dwc2_udc_otg); if (!ret) debug("dwc2_udc_otg init failed\n"); @@ -464,11 +464,11 @@ static void sysconf_init(void) * but this value need to be consistent with board design */ ret = uclass_get_device_by_driver(UCLASS_PMIC, - DM_GET_DRIVER(stm32mp_pwr_pmic), + DM_DRIVER_GET(stm32mp_pwr_pmic), &pwr_dev); if (!ret && IS_ENABLED(CONFIG_DM_REGULATOR)) { ret = uclass_get_device_by_driver(UCLASS_MISC, - DM_GET_DRIVER(stm32mp_bsec), + DM_DRIVER_GET(stm32mp_bsec), &dev); if (ret) { pr_err("Can't find stm32mp_bsec driver\n"); @@ -618,7 +618,7 @@ static void board_ev1_init(void) struct udevice *dev; /* configure IRQ line on EV1 for touchscreen before LCD reset */ - uclass_get_device_by_driver(UCLASS_NOP, DM_GET_DRIVER(goodix), &dev); + uclass_get_device_by_driver(UCLASS_NOP, DM_DRIVER_GET(goodix), &dev); } /* board dependent setup after realloc */ @@ -680,7 +680,7 @@ int board_late_init(void) } } ret = uclass_get_device_by_driver(UCLASS_MISC, - DM_GET_DRIVER(stm32mp_bsec), + DM_DRIVER_GET(stm32mp_bsec), &dev); if (!ret) -- cgit v1.1