Skip to content

Commit 490d5ce

Browse files
JuliaLawallgregkh
authored andcommitted
tty/serial: at91: use of_property_read_bool
Use of_property_read_bool to check for the existence of a property. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression e1,e2; statement S2,S1; @@ - if (of_get_property(e1,e2,NULL)) + if (of_property_read_bool(e1,e2)) S1 else S2 // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 03895cf commit 490d5ce

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/tty/serial/atmel_serial.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,8 +1635,8 @@ static void atmel_init_property(struct atmel_uart_port *atmel_port,
16351635

16361636
if (np) {
16371637
/* DMA/PDC usage specification */
1638-
if (of_get_property(np, "atmel,use-dma-rx", NULL)) {
1639-
if (of_get_property(np, "dmas", NULL)) {
1638+
if (of_property_read_bool(np, "atmel,use-dma-rx")) {
1639+
if (of_property_read_bool(np, "dmas")) {
16401640
atmel_port->use_dma_rx = true;
16411641
atmel_port->use_pdc_rx = false;
16421642
} else {
@@ -1648,8 +1648,8 @@ static void atmel_init_property(struct atmel_uart_port *atmel_port,
16481648
atmel_port->use_pdc_rx = false;
16491649
}
16501650

1651-
if (of_get_property(np, "atmel,use-dma-tx", NULL)) {
1652-
if (of_get_property(np, "dmas", NULL)) {
1651+
if (of_property_read_bool(np, "atmel,use-dma-tx")) {
1652+
if (of_property_read_bool(np, "dmas")) {
16531653
atmel_port->use_dma_tx = true;
16541654
atmel_port->use_pdc_tx = false;
16551655
} else {

0 commit comments

Comments
 (0)