trivial: style fix
Signed-off-by: Axel Heider <axelheider@gmx.de>
diff --git a/libplatsupport/src/mach/imx/serial/serial.c b/libplatsupport/src/mach/imx/serial/serial.c
index bfc6cb3..a0cf490 100644
--- a/libplatsupport/src/mach/imx/serial/serial.c
+++ b/libplatsupport/src/mach/imx/serial/serial.c
@@ -81,15 +81,16 @@
};
typedef volatile struct imx_uart_regs imx_uart_regs_t;
-static inline imx_uart_regs_t*
-imx_uart_get_priv(ps_chardevice_t *d)
+static inline imx_uart_regs_t *imx_uart_get_priv(
+ ps_chardevice_t *d)
{
- return (imx_uart_regs_t*)d->vaddr;
+ return (imx_uart_regs_t *)d->vaddr;
}
-int uart_getchar(ps_chardevice_t *d)
+int uart_getchar(
+ ps_chardevice_t *d)
{
- imx_uart_regs_t* regs = imx_uart_get_priv(d);
+ imx_uart_regs_t *regs = imx_uart_get_priv(d);
uint32_t reg = 0;
int c = -1;
@@ -102,9 +103,11 @@
return c;
}
-int uart_putchar(ps_chardevice_t* d, int c)
+int uart_putchar(
+ ps_chardevice_t *d,
+ int c)
{
- imx_uart_regs_t* regs = imx_uart_get_priv(d);
+ imx_uart_regs_t *regs = imx_uart_get_priv(d);
if (regs->sr2 & UART_SR2_TXFIFO_EMPTY) {
if (c == '\n' && (d->flags & SERIAL_AUTO_CR)) {
uart_putchar(d, '\r');
@@ -116,8 +119,7 @@
}
}
-static void
-uart_handle_irq(ps_chardevice_t* d UNUSED)
+static void uart_handle_irq(ps_chardevice_t *d UNUSED)
{
/* TODO */
}
@@ -126,10 +128,11 @@
* BaudRate = RefFreq / (16 * (BMR + 1)/(BIR + 1) )
* BMR and BIR are 16 bit
*/
-static void
-imx_uart_set_baud(ps_chardevice_t* d, long bps)
+static void imx_uart_set_baud(
+ ps_chardevice_t *d,
+ long bps)
{
- imx_uart_regs_t* regs = imx_uart_get_priv(d);
+ imx_uart_regs_t *regs = imx_uart_get_priv(d);
uint32_t bmr, bir, fcr;
fcr = regs->fcr;
fcr &= ~UART_FCR_RFDIV_MASK;
@@ -141,10 +144,14 @@
regs->fcr = fcr;
}
-int
-serial_configure(ps_chardevice_t* d, long bps, int char_size, enum serial_parity parity, int stop_bits)
+int serial_configure(
+ ps_chardevice_t *d,
+ long bps,
+ int char_size,
+ enum serial_parity parity,
+ int stop_bits)
{
- imx_uart_regs_t* regs = imx_uart_get_priv(d);
+ imx_uart_regs_t *regs = imx_uart_get_priv(d);
uint32_t cr2;
/* Character size */
cr2 = regs->cr2;
@@ -184,14 +191,13 @@
return 0;
}
-int uart_init(const struct dev_defn* defn,
- const ps_io_ops_t* ops,
- ps_chardevice_t* dev)
+int uart_init(
+ const struct dev_defn *defn,
+ const ps_io_ops_t *ops,
+ ps_chardevice_t *dev)
{
- imx_uart_regs_t* regs;
-
/* Attempt to map the virtual address, assure this works */
- void* vaddr = chardev_map(defn, ops);
+ void *vaddr = chardev_map(defn, ops);
if (vaddr == NULL) {
return -1;
}
@@ -200,7 +206,7 @@
/* Set up all the device properties. */
dev->id = defn->id;
- dev->vaddr = (void*)vaddr;
+ dev->vaddr = (void *)vaddr;
dev->read = &uart_read;
dev->write = &uart_write;
dev->handle_irq = &uart_handle_irq;
@@ -208,7 +214,7 @@
dev->ioops = *ops;
dev->flags = SERIAL_AUTO_CR;
- regs = imx_uart_get_priv(dev);
+ imx_uart_regs_t *regs = imx_uart_get_priv(dev);
/* Software reset */
regs->cr2 &= ~UART_CR2_SRST;
@@ -231,12 +237,12 @@
#ifdef CONFIG_PLAT_IMX6
#include <platsupport/plat/mux.h>
- /* The UART1 on the IMX6 has the problem that the MUX is not correctly set, and the RX PIN is
- * not routed correctly.
+ /* The UART1 on the IMX6 has the problem that the MUX is not correctly set,
+ * and the RX PIN is not routed correctly.
*/
if ((defn->id == IMX_UART1) && mux_sys_valid(&ops->mux_sys)) {
if (mux_feature_enable(&ops->mux_sys, MUX_UART1, 0)) {
- // Failed to configure the mux
+ /* Failed to configure the mux */
return -1;
}
}