Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: sirf: Introduce helper variable struct device_node *np

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Geert Uytterhoeven and committed by
Greg Kroah-Hartman
af99c187 182cdcb8

+18 -20
+18 -20
drivers/tty/serial/sirfsoc_uart.c
··· 1264 1264 1265 1265 static int sirfsoc_uart_probe(struct platform_device *pdev) 1266 1266 { 1267 + struct device_node *np = pdev->dev.of_node; 1267 1268 struct sirfsoc_uart_port *sirfport; 1268 1269 struct uart_port *port; 1269 1270 struct resource *res; ··· 1277 1276 }; 1278 1277 const struct of_device_id *match; 1279 1278 1280 - match = of_match_node(sirfsoc_uart_ids, pdev->dev.of_node); 1279 + match = of_match_node(sirfsoc_uart_ids, np); 1281 1280 sirfport = devm_kzalloc(&pdev->dev, sizeof(*sirfport), GFP_KERNEL); 1282 1281 if (!sirfport) { 1283 1282 ret = -ENOMEM; 1284 1283 goto err; 1285 1284 } 1286 - sirfport->port.line = of_alias_get_id(pdev->dev.of_node, "serial"); 1285 + sirfport->port.line = of_alias_get_id(np, "serial"); 1287 1286 sirf_ports[sirfport->port.line] = sirfport; 1288 1287 sirfport->port.iotype = UPIO_MEM; 1289 1288 sirfport->port.flags = UPF_BOOT_AUTOCONF; ··· 1292 1291 port->private_data = sirfport; 1293 1292 sirfport->uart_reg = (struct sirfsoc_uart_register *)match->data; 1294 1293 1295 - sirfport->hw_flow_ctrl = of_property_read_bool(pdev->dev.of_node, 1296 - "sirf,uart-has-rtscts"); 1297 - if (of_device_is_compatible(pdev->dev.of_node, "sirf,prima2-uart") || 1298 - of_device_is_compatible(pdev->dev.of_node, "sirf,atlas7-uart")) 1294 + sirfport->hw_flow_ctrl = 1295 + of_property_read_bool(np, "sirf,uart-has-rtscts"); 1296 + if (of_device_is_compatible(np, "sirf,prima2-uart") || 1297 + of_device_is_compatible(np, "sirf,atlas7-uart")) 1299 1298 sirfport->uart_reg->uart_type = SIRF_REAL_UART; 1300 - if (of_device_is_compatible(pdev->dev.of_node, 1301 - "sirf,prima2-usp-uart") || of_device_is_compatible( 1302 - pdev->dev.of_node, "sirf,atlas7-usp-uart")) { 1299 + if (of_device_is_compatible(np, "sirf,prima2-usp-uart") || 1300 + of_device_is_compatible(np, "sirf,atlas7-usp-uart")) { 1303 1301 sirfport->uart_reg->uart_type = SIRF_USP_UART; 1304 1302 if (!sirfport->hw_flow_ctrl) 1305 1303 goto usp_no_flow_control; 1306 - if (of_find_property(pdev->dev.of_node, "cts-gpios", NULL)) 1307 - sirfport->cts_gpio = of_get_named_gpio( 1308 - pdev->dev.of_node, "cts-gpios", 0); 1304 + if (of_find_property(np, "cts-gpios", NULL)) 1305 + sirfport->cts_gpio = 1306 + of_get_named_gpio(np, "cts-gpios", 0); 1309 1307 else 1310 1308 sirfport->cts_gpio = -1; 1311 - if (of_find_property(pdev->dev.of_node, "rts-gpios", NULL)) 1312 - sirfport->rts_gpio = of_get_named_gpio( 1313 - pdev->dev.of_node, "rts-gpios", 0); 1309 + if (of_find_property(np, "rts-gpios", NULL)) 1310 + sirfport->rts_gpio = 1311 + of_get_named_gpio(np, "rts-gpios", 0); 1314 1312 else 1315 1313 sirfport->rts_gpio = -1; 1316 1314 ··· 1336 1336 gpio_direction_output(sirfport->rts_gpio, 1); 1337 1337 } 1338 1338 usp_no_flow_control: 1339 - if (of_device_is_compatible(pdev->dev.of_node, "sirf,atlas7-uart") || 1340 - of_device_is_compatible(pdev->dev.of_node, "sirf,atlas7-usp-uart")) 1339 + if (of_device_is_compatible(np, "sirf,atlas7-uart") || 1340 + of_device_is_compatible(np, "sirf,atlas7-usp-uart")) 1341 1341 sirfport->is_atlas7 = true; 1342 1342 1343 - if (of_property_read_u32(pdev->dev.of_node, 1344 - "fifosize", 1345 - &port->fifosize)) { 1343 + if (of_property_read_u32(np, "fifosize", &port->fifosize)) { 1346 1344 dev_err(&pdev->dev, 1347 1345 "Unable to find fifosize in uart node.\n"); 1348 1346 ret = -EFAULT;