summaryrefslogtreecommitdiff
path: root/drivers/i2c/i2c-uclass.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-12-04 02:55:18 +0300
committerSimon Glass <sjg@chromium.org>2020-12-14 02:51:08 +0300
commitcaa4daa2ae3dc0a3e516addea5772c9af76abcb0 (patch)
tree0abbc5b538894532f4db28d56e4645d3be230d27 /drivers/i2c/i2c-uclass.c
parent41575d8e4c334df148c4cdd7c40cc825dc0fcaa1 (diff)
downloadu-boot-caa4daa2ae3dc0a3e516addea5772c9af76abcb0.tar.xz
dm: treewide: Rename 'platdata' variables to just 'plat'
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 <sjg@chromium.org>
Diffstat (limited to 'drivers/i2c/i2c-uclass.c')
-rw-r--r--drivers/i2c/i2c-uclass.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/i2c/i2c-uclass.c b/drivers/i2c/i2c-uclass.c
index 2feb5882e6..e81420558d 100644
--- a/drivers/i2c/i2c-uclass.c
+++ b/drivers/i2c/i2c-uclass.c
@@ -79,7 +79,7 @@ static int i2c_setup_offset(struct dm_i2c_chip *chip, uint offset,
static int i2c_read_bytewise(struct udevice *dev, uint offset,
uint8_t *buffer, int len)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
struct udevice *bus = dev_get_parent(dev);
struct dm_i2c_ops *ops = i2c_get_ops(bus);
struct i2c_msg msg[2], *ptr;
@@ -108,7 +108,7 @@ static int i2c_read_bytewise(struct udevice *dev, uint offset,
static int i2c_write_bytewise(struct udevice *dev, uint offset,
const uint8_t *buffer, int len)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
struct udevice *bus = dev_get_parent(dev);
struct dm_i2c_ops *ops = i2c_get_ops(bus);
struct i2c_msg msg[1];
@@ -131,7 +131,7 @@ static int i2c_write_bytewise(struct udevice *dev, uint offset,
int dm_i2c_read(struct udevice *dev, uint offset, uint8_t *buffer, int len)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
struct udevice *bus = dev_get_parent(dev);
struct dm_i2c_ops *ops = i2c_get_ops(bus);
struct i2c_msg msg[2], *ptr;
@@ -162,7 +162,7 @@ int dm_i2c_read(struct udevice *dev, uint offset, uint8_t *buffer, int len)
int dm_i2c_write(struct udevice *dev, uint offset, const uint8_t *buffer,
int len)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
struct udevice *bus = dev_get_parent(dev);
struct dm_i2c_ops *ops = i2c_get_ops(bus);
struct i2c_msg msg[1];
@@ -297,7 +297,7 @@ static int i2c_bind_driver(struct udevice *bus, uint chip_addr, uint offset_len,
goto err_bind;
/* Tell the device what we know about it */
- chip = dev_get_parent_platdata(dev);
+ chip = dev_get_parent_plat(dev);
chip->chip_addr = chip_addr;
chip->offset_len = offset_len;
ret = device_probe(dev);
@@ -328,7 +328,7 @@ int i2c_get_chip(struct udevice *bus, uint chip_addr, uint offset_len,
bus->name, chip_addr);
for (device_find_first_child(bus, &dev); dev;
device_find_next_child(&dev)) {
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
int ret;
if (chip->chip_addr == (chip_addr &
@@ -433,7 +433,7 @@ int dm_i2c_get_bus_speed(struct udevice *bus)
int i2c_set_chip_flags(struct udevice *dev, uint flags)
{
struct udevice *bus = dev->parent;
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
struct dm_i2c_ops *ops = i2c_get_ops(bus);
int ret;
@@ -449,7 +449,7 @@ int i2c_set_chip_flags(struct udevice *dev, uint flags)
int i2c_get_chip_flags(struct udevice *dev, uint *flagsp)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
*flagsp = chip->flags;
@@ -458,7 +458,7 @@ int i2c_get_chip_flags(struct udevice *dev, uint *flagsp)
int i2c_set_chip_offset_len(struct udevice *dev, uint offset_len)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
if (offset_len > I2C_MAX_OFFSET_LEN)
return log_ret(-EINVAL);
@@ -469,14 +469,14 @@ int i2c_set_chip_offset_len(struct udevice *dev, uint offset_len)
int i2c_get_chip_offset_len(struct udevice *dev)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
return chip->offset_len;
}
int i2c_set_chip_addr_offset_mask(struct udevice *dev, uint mask)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
chip->chip_addr_offset_mask = mask;
@@ -485,7 +485,7 @@ int i2c_set_chip_addr_offset_mask(struct udevice *dev, uint mask)
uint i2c_get_chip_addr_offset_mask(struct udevice *dev)
{
- struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *chip = dev_get_parent_plat(dev);
return chip->chip_addr_offset_mask;
}
@@ -676,7 +676,7 @@ static int i2c_post_probe(struct udevice *dev)
static int i2c_child_post_bind(struct udevice *dev)
{
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
- struct dm_i2c_chip *plat = dev_get_parent_platdata(dev);
+ struct dm_i2c_chip *plat = dev_get_parent_plat(dev);
if (!dev_of_valid(dev))
return 0;
@@ -743,7 +743,7 @@ UCLASS_DRIVER(i2c) = {
.pre_probe = i2c_pre_probe,
.post_probe = i2c_post_probe,
.per_device_auto = sizeof(struct dm_i2c_bus),
- .per_child_platdata_auto = sizeof(struct dm_i2c_chip),
+ .per_child_plat_auto = sizeof(struct dm_i2c_chip),
.child_post_bind = i2c_child_post_bind,
};