Skip to content

Commit d2988fc

Browse files
maass-hamburghenrikbrixandersen
authored andcommitted
drivers: serial: litex: trivial changes
some trivial changes Signed-off-by: Fin Maaß <[email protected]>
1 parent cf3701c commit d2988fc

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

drivers/serial/uart_litex.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ static int uart_litex_poll_in(const struct device *dev, unsigned char *c)
7979
*/
8080
litex_write8(UART_EV_RX, config->ev_pending_addr);
8181
return 0;
82-
} else {
83-
return -1;
8482
}
83+
84+
return -1;
8585
}
8686

8787
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
@@ -171,11 +171,7 @@ static int uart_litex_irq_rx_ready(const struct device *dev)
171171

172172
pending = litex_read8(config->ev_pending_addr);
173173

174-
if (pending & UART_EV_RX) {
175-
return 1;
176-
} else {
177-
return 0;
178-
}
174+
return (pending & UART_EV_RX) > 0;
179175
}
180176

181177
/**
@@ -263,9 +259,8 @@ static void uart_litex_irq_callback_set(const struct device *dev,
263259
uart_irq_callback_user_data_t cb,
264260
void *cb_data)
265261
{
266-
struct uart_litex_data *data;
262+
struct uart_litex_data *data = dev->data;
267263

268-
data = dev->data;
269264
data->callback = cb;
270265
data->cb_data = cb_data;
271266
}

0 commit comments

Comments
 (0)