Skip to content

Commit

Permalink
dm: treewide: Rename 'platdata' variables to just 'plat'
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
sjg20 committed Dec 13, 2020
1 parent 41575d8 commit caa4daa
Show file tree
Hide file tree
Showing 575 changed files with 1,633 additions and 1,644 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-imx/mx6/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static const struct imx_thermal_plat imx6_thermal_plat = {

U_BOOT_DEVICE(imx6_thermal) = {
.name = "imx_thermal",
.platdata = &imx6_thermal_plat,
.plat = &imx6_thermal_plat,
};
#endif

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-imx/mx7/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static const struct imx_thermal_plat imx7_thermal_plat = {

U_BOOT_DEVICE(imx7_thermal) = {
.name = "imx_thermal",
.platdata = &imx7_thermal_plat,
.plat = &imx7_thermal_plat,
};
#endif

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/am33xx/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static const struct omap3_spi_plat omap3_spi_pdata = {

U_BOOT_DEVICE(am33xx_spi) = {
.name = "omap3_spi",
.platdata = &omap3_spi_pdata,
.plat = &omap3_spi_pdata,
};
#endif
#endif
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-rockchip/spl-boot-order.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static int spl_node_to_boot_device(int node)
dev;
device_find_next_child(&dev)) {
if (device_get_uclass_id(dev) == UCLASS_BLK) {
desc = dev_get_uclass_platdata(dev);
desc = dev_get_uclass_plat(dev);
break;
}
}
Expand Down Expand Up @@ -99,7 +99,7 @@ __weak const char *board_spl_was_booted_from(void)

void board_boot_order(u32 *spl_boot_list)
{
/* In case of no fdt (or only platdata), use spl_boot_device() */
/* In case of no fdt (or only plat), use spl_boot_device() */
if (!CONFIG_IS_ENABLED(OF_CONTROL) || CONFIG_IS_ENABLED(OF_PLATDATA)) {
spl_boot_list[0] = spl_boot_device();
return;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-stm32mp/bsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ U_BOOT_DRIVER(stm32mp_bsec) = {
.id = UCLASS_MISC,
.of_match = stm32mp_bsec_ids,
.ofdata_to_platdata = stm32mp_bsec_ofdata_to_platdata,
.platdata_auto = sizeof(struct stm32mp_bsec_platdata),
.plat_auto = sizeof(struct stm32mp_bsec_platdata),
.ops = &stm32mp_bsec_ops,
.probe = stm32mp_bsec_probe,
};
Expand Down
12 changes: 6 additions & 6 deletions arch/arm/mach-stm32mp/pwr_regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ static const struct stm32mp_pwr_reg_info *stm32mp_pwr_reg_infos[] = {
static int stm32mp_pwr_regulator_probe(struct udevice *dev)
{
const struct stm32mp_pwr_reg_info **p = stm32mp_pwr_reg_infos;
struct dm_regulator_uclass_platdata *uc_pdata;
struct dm_regulator_uclass_plat *uc_pdata;

uc_pdata = dev_get_uclass_platdata(dev);
uc_pdata = dev_get_uclass_plat(dev);

while (*p) {
int rc;
Expand Down Expand Up @@ -172,9 +172,9 @@ static int stm32mp_pwr_regulator_probe(struct udevice *dev)

static int stm32mp_pwr_regulator_set_value(struct udevice *dev, int uV)
{
struct dm_regulator_uclass_platdata *uc_pdata;
struct dm_regulator_uclass_plat *uc_pdata;

uc_pdata = dev_get_uclass_platdata(dev);
uc_pdata = dev_get_uclass_plat(dev);
if (!uc_pdata)
return -ENXIO;

Expand All @@ -188,9 +188,9 @@ static int stm32mp_pwr_regulator_set_value(struct udevice *dev, int uV)

static int stm32mp_pwr_regulator_get_value(struct udevice *dev)
{
struct dm_regulator_uclass_platdata *uc_pdata;
struct dm_regulator_uclass_plat *uc_pdata;

uc_pdata = dev_get_uclass_platdata(dev);
uc_pdata = dev_get_uclass_plat(dev);
if (!uc_pdata)
return -ENXIO;

Expand Down
2 changes: 1 addition & 1 deletion arch/x86/cpu/apollolake/hostbridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ U_BOOT_DRIVER(intel_apl_hostbridge) = {
.ofdata_to_platdata = apl_hostbridge_ofdata_to_platdata,
.probe = apl_hostbridge_probe,
.remove = apl_hostbridge_remove,
.platdata_auto = sizeof(struct apl_hostbridge_platdata),
.plat_auto = sizeof(struct apl_hostbridge_platdata),
ACPI_OPS_PTR(&apl_hostbridge_acpi_ops)
.flags = DM_FLAG_OS_PREPARE,
};
2 changes: 1 addition & 1 deletion arch/x86/cpu/apollolake/pmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,5 +224,5 @@ U_BOOT_DRIVER(intel_apl_pmc) = {
.ofdata_to_platdata = apl_pmc_ofdata_to_uc_platdata,
.probe = apl_pmc_probe,
.ops = &apl_pmc_ops,
.platdata_auto = sizeof(struct apl_pmc_platdata),
.plat_auto = sizeof(struct apl_pmc_platdata),
};
4 changes: 2 additions & 2 deletions arch/x86/cpu/apollolake/spl.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static int apl_flash_probe(struct udevice *dev)

/*
* Manually set the parent of the SPI flash to SPI, since dtoc doesn't. We also
* need to allocate the parent_platdata since by the time this function is
* need to allocate the parent_plat since by the time this function is
* called device_bind() has already gone past that step.
*/
static int apl_flash_bind(struct udevice *dev)
Expand All @@ -104,7 +104,7 @@ static int apl_flash_bind(struct udevice *dev)
plat = calloc(sizeof(*plat), 1);
if (!plat)
return -ENOMEM;
dev->parent_platdata = plat;
dev->parent_plat = plat;
}

return 0;
Expand Down
6 changes: 3 additions & 3 deletions arch/x86/cpu/apollolake/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static int apl_ns16550_ofdata_to_platdata(struct udevice *dev)
struct ns16550_platdata *plat;

/*
* Convert our platdata to the ns16550's platdata, so we can just use
* Convert our plat to the ns16550's plat, so we can just use
* that driver
*/
plat = malloc(sizeof(*plat));
Expand All @@ -105,7 +105,7 @@ static int apl_ns16550_ofdata_to_platdata(struct udevice *dev)
plat->clock = dtplat->clock_frequency;
plat->fcr = UART_FCR_DEFVAL;
plat->bdf = pci_ofplat_get_devfn(dtplat->reg[0]);
dev->platdata = plat;
dev->plat = plat;
#else
int ret;

Expand All @@ -126,7 +126,7 @@ U_BOOT_DRIVER(intel_apl_ns16550) = {
.name = "intel_apl_ns16550",
.id = UCLASS_SERIAL,
.of_match = apl_ns16550_serial_ids,
.platdata_auto = sizeof(struct ns16550_platdata),
.plat_auto = sizeof(struct ns16550_platdata),
.priv_auto = sizeof(struct NS16550),
.ops = &ns16550_serial_ops,
.ofdata_to_platdata = apl_ns16550_ofdata_to_platdata,
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/cpu/broadwell/sata.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,5 +266,5 @@ U_BOOT_DRIVER(ahci_broadwell_drv) = {
.of_match = broadwell_ahci_ids,
.ofdata_to_platdata = broadwell_sata_ofdata_to_platdata,
.probe = broadwell_sata_probe,
.platdata_auto = sizeof(struct sata_platdata),
.plat_auto = sizeof(struct sata_platdata),
};
2 changes: 1 addition & 1 deletion arch/x86/cpu/cpu_x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ DECLARE_GLOBAL_DATA_PTR;

int cpu_x86_bind(struct udevice *dev)
{
struct cpu_platdata *plat = dev_get_parent_platdata(dev);
struct cpu_platdata *plat = dev_get_parent_plat(dev);
struct cpuid_result res;

plat->cpu_id = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/cpu/intel_common/itss.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,6 @@ U_BOOT_DRIVER(intel_itss) = {
.ops = &itss_ops,
.bind = itss_bind,
.ofdata_to_platdata = itss_ofdata_to_platdata,
.platdata_auto = sizeof(struct itss_platdata),
.plat_auto = sizeof(struct itss_platdata),
.priv_auto = sizeof(struct itss_priv),
};
6 changes: 3 additions & 3 deletions arch/x86/cpu/intel_common/p2sb.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static int p2sb_remove(struct udevice *dev)
static int p2sb_child_post_bind(struct udevice *dev)
{
#if !CONFIG_IS_ENABLED(OF_PLATDATA)
struct p2sb_child_platdata *pplat = dev_get_parent_platdata(dev);
struct p2sb_child_platdata *pplat = dev_get_parent_plat(dev);
int ret;
u32 pid;

Expand Down Expand Up @@ -197,8 +197,8 @@ U_BOOT_DRIVER(intel_p2sb) = {
.remove = p2sb_remove,
.ops = &p2sb_ops,
.ofdata_to_platdata = p2sb_ofdata_to_platdata,
.platdata_auto = sizeof(struct p2sb_platdata),
.per_child_platdata_auto =
.plat_auto = sizeof(struct p2sb_platdata),
.per_child_plat_auto =
sizeof(struct p2sb_child_platdata),
.child_post_bind = p2sb_child_post_bind,
.flags = DM_FLAG_OS_PREPARE,
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/cpu/mp_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ static int find_cpu_by_apic_id(int apic_id, struct udevice **devp)
for (uclass_find_first_device(UCLASS_CPU, &dev);
dev;
uclass_find_next_device(&dev)) {
struct cpu_platdata *plat = dev_get_parent_platdata(dev);
struct cpu_platdata *plat = dev_get_parent_plat(dev);

if (plat->cpu_id == apic_id) {
*devp = dev;
Expand Down Expand Up @@ -706,7 +706,7 @@ static int ap_wait_for_instruction(struct udevice *cpu, void *unused)

static int mp_init_cpu(struct udevice *cpu, void *unused)
{
struct cpu_platdata *plat = dev_get_parent_platdata(cpu);
struct cpu_platdata *plat = dev_get_parent_plat(cpu);

plat->ucode_version = microcode_read_rev();
plat->device_id = gd->arch.x86_device;
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/cpu/qfw_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int qemu_cpu_fixup(void)
printf("binding cpu@%d failed: %d\n", cpu_num, ret);
return ret;
}
plat = dev_get_parent_platdata(dev);
plat = dev_get_parent_plat(dev);
plat->cpu_id = cpu_num;
}
return 0;
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/cpu/slimbootloader/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static int slimbootloader_serial_ofdata_to_platdata(struct udevice *dev)
{
const efi_guid_t guid = SBL_SERIAL_PORT_INFO_GUID;
struct sbl_serial_port_info *data;
struct ns16550_platdata *plat = dev->platdata;
struct ns16550_platdata *plat = dev->plat;

if (!gd->arch.hob_list)
panic("hob list not found!");
Expand Down Expand Up @@ -58,7 +58,7 @@ U_BOOT_DRIVER(serial_slimbootloader) = {
.id = UCLASS_SERIAL,
.of_match = slimbootloader_serial_ids,
.ofdata_to_platdata = slimbootloader_serial_ofdata_to_platdata,
.platdata_auto = sizeof(struct ns16550_platdata),
.plat_auto = sizeof(struct ns16550_platdata),
.priv_auto = sizeof(struct NS16550),
.probe = ns16550_serial_probe,
.ops = &ns16550_serial_ops,
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/include/asm/intel_pinctrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ extern const struct pinctrl_ops intel_pinctrl_ops;
int intel_pinctrl_probe(struct udevice *dev);

/**
* intel_pinctrl_ofdata_to_platdata() - Handle common platdata setup
* intel_pinctrl_ofdata_to_platdata() - Handle common plat setup
*
* @dev: Pinctrl device
* @comm: Pad community for this device
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/lib/acpi_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ int acpi_create_madt_lapics(u32 current)
for (uclass_find_first_device(UCLASS_CPU, &dev);
dev;
uclass_find_next_device(&dev)) {
struct cpu_platdata *plat = dev_get_parent_platdata(dev);
struct cpu_platdata *plat = dev_get_parent_plat(dev);
int length;

length = acpi_create_madt_lapic(
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/lib/fsp/fsp_graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static int save_vesa_mode(struct vesa_mode_info *vesa)

static int fsp_video_probe(struct udevice *dev)
{
struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
struct video_uc_platdata *plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
struct vesa_mode_info *vesa = &mode_info.vesa;
int ret;
Expand Down Expand Up @@ -124,7 +124,7 @@ static int fsp_video_probe(struct udevice *dev)

static int fsp_video_bind(struct udevice *dev)
{
struct video_uc_platdata *plat = dev_get_uclass_platdata(dev);
struct video_uc_platdata *plat = dev_get_uclass_plat(dev);

/* Set the maximum supported resolution */
plat->size = 2560 * 1600 * 4;
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/lib/mpspec.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void mp_write_processor(struct mp_config_table *mc)
for (uclass_find_first_device(UCLASS_CPU, &dev);
dev;
uclass_find_next_device(&dev)) {
struct cpu_platdata *plat = dev_get_parent_platdata(dev);
struct cpu_platdata *plat = dev_get_parent_plat(dev);
u8 cpuflag = MPC_CPU_EN;

if (!device_active(dev))
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/lib/sfi.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static int sfi_write_cpus(struct table_info *tab)
for (uclass_find_first_device(UCLASS_CPU, &dev);
dev;
uclass_find_next_device(&dev)) {
struct cpu_platdata *plat = dev_get_parent_platdata(dev);
struct cpu_platdata *plat = dev_get_parent_plat(dev);

if (!device_active(dev))
continue;
Expand Down
2 changes: 1 addition & 1 deletion board/armltd/integrator/integrator.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static const struct pl01x_serial_platdata serial_platdata = {

U_BOOT_DEVICE(integrator_serials) = {
.name = "serial_pl01x",
.platdata = &serial_platdata,
.plat = &serial_platdata,
};

void peripheral_power_enable (void);
Expand Down
2 changes: 1 addition & 1 deletion board/armltd/total_compute/total_compute.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static const struct pl01x_serial_platdata serial_platdata = {

U_BOOT_DEVICE(total_compute_serials) = {
.name = "serial_pl01x",
.platdata = &serial_platdata,
.plat = &serial_platdata,
};

static struct mm_region total_compute_mem_map[] = {
Expand Down
2 changes: 1 addition & 1 deletion board/armltd/vexpress64/vexpress64.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static const struct pl01x_serial_platdata serial_platdata = {

U_BOOT_DEVICE(vexpress_serials) = {
.name = "serial_pl01x",
.platdata = &serial_platdata,
.plat = &serial_platdata,
};

static struct mm_region vexpress64_mem_map[] = {
Expand Down
2 changes: 1 addition & 1 deletion board/bluewater/gurnard/gurnard.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,5 +422,5 @@ static struct atmel_serial_platdata at91sam9260_serial_plat = {

U_BOOT_DEVICE(at91sam9260_serial) = {
.name = "serial_atmel",
.platdata = &at91sam9260_serial_plat,
.plat = &at91sam9260_serial_plat,
};
2 changes: 1 addition & 1 deletion board/bluewater/snapper9260/snapper9260.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,5 +149,5 @@ static struct atmel_serial_platdata at91sam9260_serial_plat = {

U_BOOT_DEVICE(at91sam9260_serial) = {
.name = "serial_atmel",
.platdata = &at91sam9260_serial_plat,
.plat = &at91sam9260_serial_plat,
};
2 changes: 1 addition & 1 deletion board/cadence/xtfpga/xtfpga.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,5 @@ static struct ethoc_eth_pdata ethoc_pdata = {

U_BOOT_DEVICE(ethoc) = {
.name = "ethoc",
.platdata = &ethoc_pdata,
.plat = &ethoc_pdata,
};
4 changes: 2 additions & 2 deletions board/cavium/thunderx/thunderx.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static const struct pl01x_serial_platdata serial0 = {

U_BOOT_DEVICE(thunderx_serial0) = {
.name = "serial_pl01x",
.platdata = &serial0,
.plat = &serial0,
};

static const struct pl01x_serial_platdata serial1 = {
Expand All @@ -39,7 +39,7 @@ static const struct pl01x_serial_platdata serial1 = {

U_BOOT_DEVICE(thunderx_serial1) = {
.name = "serial_pl01x",
.platdata = &serial1,
.plat = &serial1,
};
#endif

Expand Down
2 changes: 1 addition & 1 deletion board/compulab/cm_fx6/cm_fx6.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ static struct mxc_serial_platdata cm_fx6_mxc_serial_plat = {

U_BOOT_DEVICE(cm_fx6_serial) = {
.name = "serial_mxc",
.platdata = &cm_fx6_mxc_serial_plat,
.plat = &cm_fx6_mxc_serial_plat,
};

#if CONFIG_IS_ENABLED(AHCI)
Expand Down
4 changes: 2 additions & 2 deletions board/davinci/da8xxevm/omapl138_lcdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ static const struct ns16550_platdata serial_pdata = {

U_BOOT_DEVICE(omapl138_uart) = {
.name = "ns16550_serial",
.platdata = &serial_pdata,
.plat = &serial_pdata,
};

static const struct davinci_mmc_plat mmc_platdata = {
Expand All @@ -381,7 +381,7 @@ static const struct davinci_mmc_plat mmc_platdata = {
};
U_BOOT_DEVICE(omapl138_mmc) = {
.name = "ti_da830_mmc",
.platdata = &mmc_platdata,
.plat = &mmc_platdata,
};

void spl_board_init(void)
Expand Down
4 changes: 2 additions & 2 deletions board/freescale/ls1012afrdm/eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ static struct pfe_eth_pdata pfe_pdata1 = {

U_BOOT_DEVICE(ls1012a_pfe0) = {
.name = "pfe_eth",
.platdata = &pfe_pdata0,
.plat = &pfe_pdata0,
};

U_BOOT_DEVICE(ls1012a_pfe1) = {
.name = "pfe_eth",
.platdata = &pfe_pdata1,
.plat = &pfe_pdata1,
};
Loading

0 comments on commit caa4daa

Please sign in to comment.