summaryrefslogtreecommitdiff
path: root/drivers/serial/serial_sifive.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-12-03 16:55:18 -0700
committerSimon Glass <sjg@chromium.org>2020-12-13 16:51:08 -0700
commitcaa4daa2ae3dc0a3e516addea5772c9af76abcb0 (patch)
tree0abbc5b538894532f4db28d56e4645d3be230d27 /drivers/serial/serial_sifive.c
parent41575d8e4c334df148c4cdd7c40cc825dc0fcaa1 (diff)
downloadu-boot-caa4daa2ae3dc0a3e516addea5772c9af76abcb0.tar.gz
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/serial/serial_sifive.c')
-rw-r--r--drivers/serial/serial_sifive.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/serial/serial_sifive.c b/drivers/serial/serial_sifive.c
index 710bb72363..276f0902db 100644
--- a/drivers/serial/serial_sifive.c
+++ b/drivers/serial/serial_sifive.c
@@ -105,7 +105,7 @@ static int sifive_serial_setbrg(struct udevice *dev, int baudrate)
{
int ret;
struct clk clk;
- struct sifive_uart_platdata *platdata = dev_get_platdata(dev);
+ struct sifive_uart_platdata *plat = dev_get_platdata(dev);
u32 clock = 0;
ret = clk_get_by_index(dev, 0, &clk);
@@ -123,21 +123,21 @@ static int sifive_serial_setbrg(struct udevice *dev, int baudrate)
return 0;
}
}
- platdata->clock = clock;
- _sifive_serial_setbrg(platdata->regs, platdata->clock, baudrate);
+ plat->clock = clock;
+ _sifive_serial_setbrg(plat->regs, plat->clock, baudrate);
return 0;
}
static int sifive_serial_probe(struct udevice *dev)
{
- struct sifive_uart_platdata *platdata = dev_get_platdata(dev);
+ struct sifive_uart_platdata *plat = dev_get_platdata(dev);
/* No need to reinitialize the UART after relocation */
if (gd->flags & GD_FLG_RELOC)
return 0;
- _sifive_serial_init(platdata->regs);
+ _sifive_serial_init(plat->regs);
return 0;
}
@@ -145,8 +145,8 @@ static int sifive_serial_probe(struct udevice *dev)
static int sifive_serial_getc(struct udevice *dev)
{
int c;
- struct sifive_uart_platdata *platdata = dev_get_platdata(dev);
- struct uart_sifive *regs = platdata->regs;
+ struct sifive_uart_platdata *plat = dev_get_platdata(dev);
+ struct uart_sifive *regs = plat->regs;
while ((c = _sifive_serial_getc(regs)) == -EAGAIN) ;
@@ -156,17 +156,17 @@ static int sifive_serial_getc(struct udevice *dev)
static int sifive_serial_putc(struct udevice *dev, const char ch)
{
int rc;
- struct sifive_uart_platdata *platdata = dev_get_platdata(dev);
+ struct sifive_uart_platdata *plat = dev_get_platdata(dev);
- while ((rc = _sifive_serial_putc(platdata->regs, ch)) == -EAGAIN) ;
+ while ((rc = _sifive_serial_putc(plat->regs, ch)) == -EAGAIN) ;
return rc;
}
static int sifive_serial_pending(struct udevice *dev, bool input)
{
- struct sifive_uart_platdata *platdata = dev_get_platdata(dev);
- struct uart_sifive *regs = platdata->regs;
+ struct sifive_uart_platdata *plat = dev_get_platdata(dev);
+ struct uart_sifive *regs = plat->regs;
if (input)
return (readl(&regs->ip) & UART_IP_RXWM);
@@ -176,11 +176,11 @@ static int sifive_serial_pending(struct udevice *dev, bool input)
static int sifive_serial_ofdata_to_platdata(struct udevice *dev)
{
- struct sifive_uart_platdata *platdata = dev_get_platdata(dev);
+ struct sifive_uart_platdata *plat = dev_get_platdata(dev);
- platdata->regs = (struct uart_sifive *)dev_read_addr(dev);
- if (IS_ERR(platdata->regs))
- return PTR_ERR(platdata->regs);
+ plat->regs = (struct uart_sifive *)dev_read_addr(dev);
+ if (IS_ERR(plat->regs))
+ return PTR_ERR(plat->regs);
return 0;
}
@@ -202,7 +202,7 @@ U_BOOT_DRIVER(serial_sifive) = {
.id = UCLASS_SERIAL,
.of_match = sifive_serial_ids,
.ofdata_to_platdata = sifive_serial_ofdata_to_platdata,
- .platdata_auto = sizeof(struct sifive_uart_platdata),
+ .plat_auto = sizeof(struct sifive_uart_platdata),
.probe = sifive_serial_probe,
.ops = &sifive_serial_ops,
};