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 <sjg@chromium.org>
This commit is contained in:
Simon Glass
2020-12-03 16:55:23 -07:00
parent b012ff1f1b
commit 8a8d24bdf1
358 changed files with 1404 additions and 1411 deletions

View File

@@ -242,7 +242,7 @@ For example:
#include <dt-structs.h>
struct mmc_platdata {
struct mmc_plat {
#if CONFIG_IS_ENABLED(OF_PLATDATA)
/* Put this first since driver model will copy the data here */
struct dtd_mmc dtplat;
@@ -258,7 +258,7 @@ For example:
{
#if !CONFIG_IS_ENABLED(OF_PLATDATA)
/* Decode the device tree data */
struct mmc_platdata *plat = dev_get_plat(dev);
struct mmc_plat *plat = dev_get_plat(dev);
const void *blob = gd->fdt_blob;
int node = dev_of_offset(dev);
@@ -270,7 +270,7 @@ For example:
static int mmc_probe(struct udevice *dev)
{
struct mmc_platdata *plat = dev_get_plat(dev);
struct mmc_plat *plat = dev_get_plat(dev);
#if CONFIG_IS_ENABLED(OF_PLATDATA)
/* Decode the of-platdata from the C structures */
@@ -294,12 +294,12 @@ For example:
.of_to_plat = mmc_of_to_plat,
.probe = mmc_probe,
.priv_auto = sizeof(struct mmc_priv),
.plat_auto = sizeof(struct mmc_platdata),
.plat_auto = sizeof(struct mmc_plat),
};
U_BOOT_DRIVER_ALIAS(mmc_drv, vendor_mmc) /* matches compatible string */
Note that struct mmc_platdata 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
keep the use of each of-platdata struct to the smallest possible code area.
There is just one driver C file for each struct, that can convert from the

View File

@@ -209,7 +209,7 @@ DM tells you. The name is not quite right. So in this case we would use:
.. code-block:: c
struct exynos_spi_platdata {
struct exynos_spi_plat {
enum periph_id periph_id;
s32 frequency; /* Default clock frequency, -1 for none */
struct exynos_spi *regs;
@@ -231,7 +231,7 @@ tree, but we need to tell it the size:
U_BOOT_DRIVER(spi_exynos) = {
...
.plat_auto = sizeof(struct exynos_spi_platdata),
.plat_auto = sizeof(struct exynos_spi_plat),
Here is a sample function. It gets a pointer to the platform data and
@@ -241,7 +241,7 @@ fills in the fields from device tree.
static int exynos_spi_of_to_plat(struct udevice *bus)
{
struct exynos_spi_platdata *plat = bus->plat;
struct exynos_spi_plat *plat = bus->plat;
const void *blob = gd->fdt_blob;
int node = dev_of_offset(bus);
@@ -274,7 +274,7 @@ Specify this data in a U_BOOT_DEVICE() declaration in your board file:
.. code-block:: c
struct exynos_spi_platdata platdata_spi0 = {
struct exynos_spi_plat platdata_spi0 = {
.periph_id = ...
.frequency = ...
.regs = ...
@@ -357,7 +357,7 @@ what you can copy out to set things up.
static int exynos_spi_probe(struct udevice *bus)
{
struct exynos_spi_platdata *plat = dev_get_plat(bus);
struct exynos_spi_plat *plat = dev_get_plat(bus);
struct exynos_spi_priv *priv = dev_get_priv(bus);
priv->regs = plat->regs;
@@ -437,7 +437,7 @@ Here is an example for the speed part:
static int exynos_spi_set_speed(struct udevice *bus, uint speed)
{
struct exynos_spi_platdata *plat = bus->plat;
struct exynos_spi_plat *plat = bus->plat;
struct exynos_spi_priv *priv = dev_get_priv(bus);
int ret;
@@ -585,7 +585,7 @@ The new version looks like this:
static void spi_cs_activate(struct udevice *dev)
{
struct udevice *bus = dev->parent;
struct exynos_spi_platdata *pdata = dev_get_plat(bus);
struct exynos_spi_plat *pdata = dev_get_plat(bus);
struct exynos_spi_priv *priv = dev_get_priv(bus);
/* If it's too soon to do another transaction, wait */
@@ -657,7 +657,7 @@ A little note about SPI uclass features
The SPI uclass keeps some information about each device 'dev' on the bus:
struct dm_spi_slave_platdata:
struct dm_spi_slave_plat:
This is device_get_parent_plat(dev).
This is where the chip select number is stored, along with
the default bus speed and mode. It is automatically read

View File

@@ -43,7 +43,7 @@ as drivers in the USB uclass. For example:
.probe = tegra_ehci_usb_probe,
.remove = tegra_ehci_usb_remove,
.ops = &ehci_usb_ops,
.plat_auto = sizeof(struct usb_platdata),
.plat_auto = sizeof(struct usb_plat),
.priv_auto = sizeof(struct fdt_usb),
.flags = DM_FLAG_ALLOC_PRIV_DMA,
};
@@ -63,7 +63,7 @@ This can hold run-time information needed by the driver for operation. It
exists when the device is probed (not when it is bound) and is removed when
the driver is removed.
Note that usb_platdata is currently only used to deal with setting up a bus
Note that usb_plat is currently only used to deal with setting up a bus
in USB device mode (OTG operation). It can be omitted if that is not
supported.
@@ -93,12 +93,12 @@ The following primary data structures are in use:
handles that). Once the device is set up, you can find the device
descriptor and current configuration descriptor in this structure.
- struct usb_platdata:
- struct usb_plat:
This holds platform data for a controller. So far this is only used
as a work-around for controllers which can act as USB devices in OTG
mode, since the gadget framework does not use driver model.
- struct usb_dev_platdata:
- struct usb_dev_plat:
This holds platform data for a device. You can access it for a
device 'dev' with dev_get_parent_plat(dev). It holds the device
address and speed - anything that can be determined before the device