dm: Rename U_BOOT_DRIVER_ALIAS to DM_DRIVER_ALIAS

We use the U_BOOT_ prefix (i.e. U_BOOT_DRIVER) to declare a driver but
in every other case we just use DM_. Update the alias macros to use the
DM_ prefix.

We could perhaps rename U_BOOT_DRIVER() to DM_DRIVER(), but this macro
is widely used and there is at least some benefit to indicating it us a
U-Boot driver, particularly for code ported from Linux. So for now, let's
keep that name.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2020-12-28 20:34:57 -07:00
parent 65e25bea59
commit bdf8fd76c0
19 changed files with 26 additions and 26 deletions

View File

@ -184,7 +184,7 @@ via U_BOOT_DRIVER(). This effectively means that a U_BOOT_DRIVER() with a
it to a valid name for C) is needed, so a dedicated driver is required for it to a valid name for C) is needed, so a dedicated driver is required for
each 'compatible' string. each 'compatible' string.
In order to make this a bit more flexible U_BOOT_DRIVER_ALIAS macro can be In order to make this a bit more flexible DM_DRIVER_ALIAS macro can be
used to declare an alias for a driver name, typically a 'compatible' string. used to declare an alias for a driver name, typically a 'compatible' string.
This macro produces no code, but it is by dtoc tool. This macro produces no code, but it is by dtoc tool.
@ -195,7 +195,7 @@ fix-ups required by dtoc. It is not currently used. The values in 'clocks' are
the index of the driver_info for the target device followed by any phandle the index of the driver_info for the target device followed by any phandle
arguments. This is used to support device_get_by_driver_info_idx(). arguments. This is used to support device_get_by_driver_info_idx().
During the build process dtoc parses both U_BOOT_DRIVER and U_BOOT_DRIVER_ALIAS During the build process dtoc parses both U_BOOT_DRIVER and DM_DRIVER_ALIAS
to build a list of valid driver names and driver aliases. If the 'compatible' to build a list of valid driver names and driver aliases. If the 'compatible'
string used for a device does not not match a valid driver name, it will be string used for a device does not not match a valid driver name, it will be
checked against the list of driver aliases in order to get the right driver checked against the list of driver aliases in order to get the right driver
@ -297,7 +297,7 @@ For example:
.plat_auto = sizeof(struct mmc_plat), .plat_auto = sizeof(struct mmc_plat),
}; };
U_BOOT_DRIVER_ALIAS(mmc_drv, vendor_mmc) /* matches compatible string */ DM_DRIVER_ALIAS(mmc_drv, vendor_mmc) /* matches compatible string */
Note that struct mmc_plat is defined in the C file, not in a header. This Note that struct mmc_plat is defined in the C file, not in a header. This
is to avoid needing to include dt-structs.h in a header file. The idea is to is to avoid needing to include dt-structs.h in a header file. The idea is to

View File

@ -345,7 +345,7 @@ U_BOOT_DRIVER(gpio_mxc) = {
.bind = mxc_gpio_bind, .bind = mxc_gpio_bind,
}; };
U_BOOT_DRIVER_ALIAS(gpio_mxc, fsl_imx6q_gpio) DM_DRIVER_ALIAS(gpio_mxc, fsl_imx6q_gpio)
#if !CONFIG_IS_ENABLED(OF_CONTROL) #if !CONFIG_IS_ENABLED(OF_CONTROL)
static const struct mxc_gpio_plat mxc_plat[] = { static const struct mxc_gpio_plat mxc_plat[] = {

View File

@ -306,5 +306,5 @@ U_BOOT_DRIVER(fsl_imx23_gpio) = {
#endif #endif
}; };
U_BOOT_DRIVER_ALIAS(fsl_imx23_gpio, fsl_imx28_gpio) DM_DRIVER_ALIAS(fsl_imx23_gpio, fsl_imx28_gpio)
#endif /* DM_GPIO */ #endif /* DM_GPIO */

View File

@ -327,7 +327,7 @@ U_BOOT_DRIVER(sandbox_gpio) = {
ACPI_OPS_PTR(&gpio_sandbox_acpi_ops) ACPI_OPS_PTR(&gpio_sandbox_acpi_ops)
}; };
U_BOOT_DRIVER_ALIAS(sandbox_gpio, sandbox_gpio_alias) DM_DRIVER_ALIAS(sandbox_gpio, sandbox_gpio_alias)
/* pincontrol: used only to check GPIO pin configuration (pinmux command) */ /* pincontrol: used only to check GPIO pin configuration (pinmux command) */

View File

@ -495,4 +495,4 @@ U_BOOT_DRIVER(rockchip_rk3066_i2c) = {
.ops = &rockchip_i2c_ops, .ops = &rockchip_i2c_ops,
}; };
U_BOOT_DRIVER_ALIAS(rockchip_rk3066_i2c, rockchip_rk3288_i2c) DM_DRIVER_ALIAS(rockchip_rk3066_i2c, rockchip_rk3288_i2c)

View File

@ -1711,5 +1711,5 @@ U_BOOT_DRIVER(fsl_esdhc) = {
.priv_auto = sizeof(struct fsl_esdhc_priv), .priv_auto = sizeof(struct fsl_esdhc_priv),
}; };
U_BOOT_DRIVER_ALIAS(fsl_esdhc, fsl_imx6q_usdhc) DM_DRIVER_ALIAS(fsl_esdhc, fsl_imx6q_usdhc)
#endif #endif

View File

@ -722,5 +722,5 @@ U_BOOT_DRIVER(fsl_imx23_mmc) = {
.plat_auto = sizeof(struct mxsmmc_plat), .plat_auto = sizeof(struct mxsmmc_plat),
}; };
U_BOOT_DRIVER_ALIAS(fsl_imx23_mmc, fsl_imx28_mmc) DM_DRIVER_ALIAS(fsl_imx23_mmc, fsl_imx28_mmc)
#endif /* CONFIG_DM_MMC */ #endif /* CONFIG_DM_MMC */

View File

@ -180,8 +180,8 @@ U_BOOT_DRIVER(rockchip_rk3288_dw_mshc) = {
.plat_auto = sizeof(struct rockchip_mmc_plat), .plat_auto = sizeof(struct rockchip_mmc_plat),
}; };
U_BOOT_DRIVER_ALIAS(rockchip_rk3288_dw_mshc, rockchip_rk3328_dw_mshc) DM_DRIVER_ALIAS(rockchip_rk3288_dw_mshc, rockchip_rk3328_dw_mshc)
U_BOOT_DRIVER_ALIAS(rockchip_rk3288_dw_mshc, rockchip_rk3368_dw_mshc) DM_DRIVER_ALIAS(rockchip_rk3288_dw_mshc, rockchip_rk3368_dw_mshc)
#ifdef CONFIG_PWRSEQ #ifdef CONFIG_PWRSEQ
static int rockchip_dwmmc_pwrseq_set_power(struct udevice *dev, bool enable) static int rockchip_dwmmc_pwrseq_set_power(struct udevice *dev, bool enable)

View File

@ -170,6 +170,6 @@ U_BOOT_DRIVER(jedec_spi_nor) = {
.ops = &spi_flash_std_ops, .ops = &spi_flash_std_ops,
}; };
U_BOOT_DRIVER_ALIAS(jedec_spi_nor, spansion_m25p16) DM_DRIVER_ALIAS(jedec_spi_nor, spansion_m25p16)
#endif /* CONFIG_DM_SPI_FLASH */ #endif /* CONFIG_DM_SPI_FLASH */

View File

@ -52,4 +52,4 @@ U_BOOT_DRIVER(fsl_imx6q_iomuxc) = {
.flags = DM_FLAG_PRE_RELOC, .flags = DM_FLAG_PRE_RELOC,
}; };
U_BOOT_DRIVER_ALIAS(fsl_imx6q_iomuxc, fsl_imx6dl_iomuxc) DM_DRIVER_ALIAS(fsl_imx6q_iomuxc, fsl_imx6dl_iomuxc)

View File

@ -192,4 +192,4 @@ U_BOOT_DRIVER(fsl_imx23_pinctrl) = {
.ops = &mxs_pinctrl_ops, .ops = &mxs_pinctrl_ops,
}; };
U_BOOT_DRIVER_ALIAS(fsl_imx23_pinctrl, fsl_imx28_pinctrl) DM_DRIVER_ALIAS(fsl_imx23_pinctrl, fsl_imx28_pinctrl)

View File

@ -528,4 +528,4 @@ U_BOOT_DRIVER(atmel_sama5d3_pinctrl) = {
.ops = &at91_pinctrl_ops, .ops = &at91_pinctrl_ops,
}; };
U_BOOT_DRIVER_ALIAS(atmel_sama5d3_pinctrl, atmel_at91rm9200_pinctrl) DM_DRIVER_ALIAS(atmel_sama5d3_pinctrl, atmel_at91rm9200_pinctrl)

View File

@ -195,4 +195,4 @@ U_BOOT_DRIVER(rockchip_rk805) = {
.ops = &rk8xx_ops, .ops = &rk8xx_ops,
}; };
U_BOOT_DRIVER_ALIAS(rockchip_rk805, rockchip_rk808) DM_DRIVER_ALIAS(rockchip_rk805, rockchip_rk808)

View File

@ -621,9 +621,9 @@ U_BOOT_DRIVER(ns16550_serial) = {
#endif #endif
}; };
U_BOOT_DRIVER_ALIAS(ns16550_serial, rockchip_rk3328_uart) DM_DRIVER_ALIAS(ns16550_serial, rockchip_rk3328_uart)
U_BOOT_DRIVER_ALIAS(ns16550_serial, rockchip_rk3368_uart) DM_DRIVER_ALIAS(ns16550_serial, rockchip_rk3368_uart)
U_BOOT_DRIVER_ALIAS(ns16550_serial, ti_da830_uart) DM_DRIVER_ALIAS(ns16550_serial, ti_da830_uart)
#endif #endif
#endif /* SERIAL_PRESENT */ #endif /* SERIAL_PRESENT */

View File

@ -493,4 +493,4 @@ U_BOOT_DRIVER(fsl_imx23_spi) = {
.probe = mxs_spi_probe, .probe = mxs_spi_probe,
}; };
U_BOOT_DRIVER_ALIAS(fsl_imx23_spi, fsl_imx28_spi) DM_DRIVER_ALIAS(fsl_imx23_spi, fsl_imx28_spi)

View File

@ -565,4 +565,4 @@ U_BOOT_DRIVER(rockchip_rk3288_spi) = {
.probe = rockchip_spi_probe, .probe = rockchip_spi_probe,
}; };
U_BOOT_DRIVER_ALIAS(rockchip_rk3288_spi, rockchip_rk3368_spi) DM_DRIVER_ALIAS(rockchip_rk3288_spi, rockchip_rk3368_spi)

View File

@ -343,7 +343,7 @@ struct driver {
* produce no code but its information will be parsed by tools like * produce no code but its information will be parsed by tools like
* dtoc * dtoc
*/ */
#define U_BOOT_DRIVER_ALIAS(__name, __alias) #define DM_DRIVER_ALIAS(__name, __alias)
/** /**
* dev_get_plat() - Get the platform data for a device * dev_get_plat() - Get the platform data for a device

View File

@ -187,7 +187,7 @@ class DtbPlatdata():
value: Driver for that driver value: Driver for that driver
_driver_aliases: Dict that holds aliases for driver names _driver_aliases: Dict that holds aliases for driver names
key: Driver alias declared with key: Driver alias declared with
U_BOOT_DRIVER_ALIAS(driver_alias, driver_name) DM_DRIVER_ALIAS(driver_alias, driver_name)
value: Driver name declared with U_BOOT_DRIVER(driver_name) value: Driver name declared with U_BOOT_DRIVER(driver_name)
_drivers_additional: List of additional drivers to use during scanning _drivers_additional: List of additional drivers to use during scanning
_dirname: Directory to hold output files, or None for none (all files _dirname: Directory to hold output files, or None for none (all files
@ -416,9 +416,9 @@ class DtbPlatdata():
self._drivers[driver] = Driver(driver) self._drivers[driver] = Driver(driver)
# The following re will search for driver aliases declared as # The following re will search for driver aliases declared as
# U_BOOT_DRIVER_ALIAS(alias, driver_name) # DM_DRIVER_ALIAS(alias, driver_name)
driver_aliases = re.findall( driver_aliases = re.findall(
r'U_BOOT_DRIVER_ALIAS\(\s*(\w+)\s*,\s*(\w+)\s*\)', r'DM_DRIVER_ALIAS\(\s*(\w+)\s*,\s*(\w+)\s*\)',
buff) buff)
for alias in driver_aliases: # pragma: no cover for alias in driver_aliases: # pragma: no cover

View File

@ -1 +1 @@
U_BOOT_DRIVER_ALIAS(sandbox_gpio, sandbox_gpio_alias2) DM_DRIVER_ALIAS(sandbox_gpio, sandbox_gpio_alias2)