diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2010-04-13 19:12:29 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-05-18 18:10:44 -0400 |
commit | 61c7a080a5a061c976988fd4b844dfb468dda255 (patch) | |
tree | 8cb492b73f2755c38a6164d770da34d5af6486a0 /drivers/serial | |
parent | d12d42f744f805a9ccc33cd76f04b237cd83ce56 (diff) |
of: Always use 'struct device.of_node' to get device node pointer.
The following structure elements duplicate the information in
'struct device.of_node' and so are being eliminated. This patch
makes all readers of these elements use device.of_node instead.
(struct of_device *)->node
(struct dev_archdata *)->prom_node (sparc)
(struct dev_archdata *)->of_node (powerpc & microblaze)
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/apbuart.c | 2 | ||||
-rw-r--r-- | drivers/serial/cpm_uart/cpm_uart_core.c | 2 | ||||
-rw-r--r-- | drivers/serial/mpc52xx_uart.c | 8 | ||||
-rw-r--r-- | drivers/serial/nwpserial.c | 2 | ||||
-rw-r--r-- | drivers/serial/of_serial.c | 4 | ||||
-rw-r--r-- | drivers/serial/pmac_zilog.c | 2 | ||||
-rw-r--r-- | drivers/serial/sunhv.c | 2 | ||||
-rw-r--r-- | drivers/serial/sunsab.c | 6 | ||||
-rw-r--r-- | drivers/serial/sunsu.c | 6 | ||||
-rw-r--r-- | drivers/serial/sunzilog.c | 8 | ||||
-rw-r--r-- | drivers/serial/uartlite.c | 6 | ||||
-rw-r--r-- | drivers/serial/ucc_uart.c | 2 |
12 files changed, 25 insertions, 25 deletions
diff --git a/drivers/serial/apbuart.c b/drivers/serial/apbuart.c index fe91319b5f65..52015d7031bb 100644 --- a/drivers/serial/apbuart.c +++ b/drivers/serial/apbuart.c | |||
@@ -559,7 +559,7 @@ static int __devinit apbuart_probe(struct of_device *op, | |||
559 | 559 | ||
560 | i = 0; | 560 | i = 0; |
561 | for (i = 0; i < grlib_apbuart_port_nr; i++) { | 561 | for (i = 0; i < grlib_apbuart_port_nr; i++) { |
562 | if (op->node == grlib_apbuart_nodes[i]) | 562 | if (op->dev.of_node == grlib_apbuart_nodes[i]) |
563 | break; | 563 | break; |
564 | } | 564 | } |
565 | 565 | ||
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c index 300cea768d74..7866cdf8a754 100644 --- a/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/serial/cpm_uart/cpm_uart_core.c | |||
@@ -1342,7 +1342,7 @@ static int __devinit cpm_uart_probe(struct of_device *ofdev, | |||
1342 | /* initialize the device pointer for the port */ | 1342 | /* initialize the device pointer for the port */ |
1343 | pinfo->port.dev = &ofdev->dev; | 1343 | pinfo->port.dev = &ofdev->dev; |
1344 | 1344 | ||
1345 | ret = cpm_uart_init_port(ofdev->node, pinfo); | 1345 | ret = cpm_uart_init_port(ofdev->dev.of_node, pinfo); |
1346 | if (ret) | 1346 | if (ret) |
1347 | return ret; | 1347 | return ret; |
1348 | 1348 | ||
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index 3119fddaedb5..cb079387c5ae 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c | |||
@@ -1328,14 +1328,14 @@ mpc52xx_uart_of_probe(struct of_device *op, const struct of_device_id *match) | |||
1328 | 1328 | ||
1329 | /* Check validity & presence */ | 1329 | /* Check validity & presence */ |
1330 | for (idx = 0; idx < MPC52xx_PSC_MAXNUM; idx++) | 1330 | for (idx = 0; idx < MPC52xx_PSC_MAXNUM; idx++) |
1331 | if (mpc52xx_uart_nodes[idx] == op->node) | 1331 | if (mpc52xx_uart_nodes[idx] == op->dev.of_node) |
1332 | break; | 1332 | break; |
1333 | if (idx >= MPC52xx_PSC_MAXNUM) | 1333 | if (idx >= MPC52xx_PSC_MAXNUM) |
1334 | return -EINVAL; | 1334 | return -EINVAL; |
1335 | pr_debug("Found %s assigned to ttyPSC%x\n", | 1335 | pr_debug("Found %s assigned to ttyPSC%x\n", |
1336 | mpc52xx_uart_nodes[idx]->full_name, idx); | 1336 | mpc52xx_uart_nodes[idx]->full_name, idx); |
1337 | 1337 | ||
1338 | uartclk = psc_ops->getuartclk(op->node); | 1338 | uartclk = psc_ops->getuartclk(op->dev.of_node); |
1339 | if (uartclk == 0) { | 1339 | if (uartclk == 0) { |
1340 | dev_dbg(&op->dev, "Could not find uart clock frequency!\n"); | 1340 | dev_dbg(&op->dev, "Could not find uart clock frequency!\n"); |
1341 | return -EINVAL; | 1341 | return -EINVAL; |
@@ -1355,7 +1355,7 @@ mpc52xx_uart_of_probe(struct of_device *op, const struct of_device_id *match) | |||
1355 | port->dev = &op->dev; | 1355 | port->dev = &op->dev; |
1356 | 1356 | ||
1357 | /* Search for IRQ and mapbase */ | 1357 | /* Search for IRQ and mapbase */ |
1358 | ret = of_address_to_resource(op->node, 0, &res); | 1358 | ret = of_address_to_resource(op->dev.of_node, 0, &res); |
1359 | if (ret) | 1359 | if (ret) |
1360 | return ret; | 1360 | return ret; |
1361 | 1361 | ||
@@ -1365,7 +1365,7 @@ mpc52xx_uart_of_probe(struct of_device *op, const struct of_device_id *match) | |||
1365 | return -EINVAL; | 1365 | return -EINVAL; |
1366 | } | 1366 | } |
1367 | 1367 | ||
1368 | psc_ops->get_irq(port, op->node); | 1368 | psc_ops->get_irq(port, op->dev.of_node); |
1369 | if (port->irq == NO_IRQ) { | 1369 | if (port->irq == NO_IRQ) { |
1370 | dev_dbg(&op->dev, "Could not get irq\n"); | 1370 | dev_dbg(&op->dev, "Could not get irq\n"); |
1371 | return -EINVAL; | 1371 | return -EINVAL; |
diff --git a/drivers/serial/nwpserial.c b/drivers/serial/nwpserial.c index e1ab8ec0a4a6..3c02fa96f282 100644 --- a/drivers/serial/nwpserial.c +++ b/drivers/serial/nwpserial.c | |||
@@ -344,7 +344,7 @@ int nwpserial_register_port(struct uart_port *port) | |||
344 | 344 | ||
345 | mutex_lock(&nwpserial_mutex); | 345 | mutex_lock(&nwpserial_mutex); |
346 | 346 | ||
347 | dn = to_of_device(port->dev)->node; | 347 | dn = to_of_device(port->dev)->dev.of_node; |
348 | if (dn == NULL) | 348 | if (dn == NULL) |
349 | goto out; | 349 | goto out; |
350 | 350 | ||
diff --git a/drivers/serial/of_serial.c b/drivers/serial/of_serial.c index 4abfebdb0fcc..29539805e593 100644 --- a/drivers/serial/of_serial.c +++ b/drivers/serial/of_serial.c | |||
@@ -31,7 +31,7 @@ static int __devinit of_platform_serial_setup(struct of_device *ofdev, | |||
31 | int type, struct uart_port *port) | 31 | int type, struct uart_port *port) |
32 | { | 32 | { |
33 | struct resource resource; | 33 | struct resource resource; |
34 | struct device_node *np = ofdev->node; | 34 | struct device_node *np = ofdev->dev.of_node; |
35 | const unsigned int *clk, *spd; | 35 | const unsigned int *clk, *spd; |
36 | const u32 *prop; | 36 | const u32 *prop; |
37 | int ret, prop_size; | 37 | int ret, prop_size; |
@@ -88,7 +88,7 @@ static int __devinit of_platform_serial_probe(struct of_device *ofdev, | |||
88 | int port_type; | 88 | int port_type; |
89 | int ret; | 89 | int ret; |
90 | 90 | ||
91 | if (of_find_property(ofdev->node, "used-by-rtas", NULL)) | 91 | if (of_find_property(ofdev->dev.of_node, "used-by-rtas", NULL)) |
92 | return -EBUSY; | 92 | return -EBUSY; |
93 | 93 | ||
94 | info = kmalloc(sizeof(*info), GFP_KERNEL); | 94 | info = kmalloc(sizeof(*info), GFP_KERNEL); |
diff --git a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c index 4eaa043ca2a8..1e43bf59c44d 100644 --- a/drivers/serial/pmac_zilog.c +++ b/drivers/serial/pmac_zilog.c | |||
@@ -1609,7 +1609,7 @@ static int pmz_attach(struct macio_dev *mdev, const struct of_device_id *match) | |||
1609 | /* Iterate the pmz_ports array to find a matching entry | 1609 | /* Iterate the pmz_ports array to find a matching entry |
1610 | */ | 1610 | */ |
1611 | for (i = 0; i < MAX_ZS_PORTS; i++) | 1611 | for (i = 0; i < MAX_ZS_PORTS; i++) |
1612 | if (pmz_ports[i].node == mdev->ofdev.node) { | 1612 | if (pmz_ports[i].node == mdev->ofdev.dev.of_node) { |
1613 | struct uart_pmac_port *uap = &pmz_ports[i]; | 1613 | struct uart_pmac_port *uap = &pmz_ports[i]; |
1614 | 1614 | ||
1615 | uap->dev = mdev; | 1615 | uap->dev = mdev; |
diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c index d14cca7fb88d..d1eedf13d85c 100644 --- a/drivers/serial/sunhv.c +++ b/drivers/serial/sunhv.c | |||
@@ -565,7 +565,7 @@ static int __devinit hv_probe(struct of_device *op, const struct of_device_id *m | |||
565 | if (err) | 565 | if (err) |
566 | goto out_free_con_read_page; | 566 | goto out_free_con_read_page; |
567 | 567 | ||
568 | sunserial_console_match(&sunhv_console, op->node, | 568 | sunserial_console_match(&sunhv_console, op->dev.of_node, |
569 | &sunhv_reg, port->line, false); | 569 | &sunhv_reg, port->line, false); |
570 | 570 | ||
571 | err = uart_add_one_port(&sunhv_reg, port); | 571 | err = uart_add_one_port(&sunhv_reg, port); |
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c index d2e0321049e2..9176c41b74ad 100644 --- a/drivers/serial/sunsab.c +++ b/drivers/serial/sunsab.c | |||
@@ -883,7 +883,7 @@ static int sunsab_console_setup(struct console *con, char *options) | |||
883 | printk("Console: ttyS%d (SAB82532)\n", | 883 | printk("Console: ttyS%d (SAB82532)\n", |
884 | (sunsab_reg.minor - 64) + con->index); | 884 | (sunsab_reg.minor - 64) + con->index); |
885 | 885 | ||
886 | sunserial_console_termios(con, to_of_device(up->port.dev)->node); | 886 | sunserial_console_termios(con, to_of_device(up->port.dev)->dev.of_node); |
887 | 887 | ||
888 | switch (con->cflag & CBAUD) { | 888 | switch (con->cflag & CBAUD) { |
889 | case B150: baud = 150; break; | 889 | case B150: baud = 150; break; |
@@ -1026,11 +1026,11 @@ static int __devinit sab_probe(struct of_device *op, const struct of_device_id * | |||
1026 | if (err) | 1026 | if (err) |
1027 | goto out1; | 1027 | goto out1; |
1028 | 1028 | ||
1029 | sunserial_console_match(SUNSAB_CONSOLE(), op->node, | 1029 | sunserial_console_match(SUNSAB_CONSOLE(), op->dev.of_node, |
1030 | &sunsab_reg, up[0].port.line, | 1030 | &sunsab_reg, up[0].port.line, |
1031 | false); | 1031 | false); |
1032 | 1032 | ||
1033 | sunserial_console_match(SUNSAB_CONSOLE(), op->node, | 1033 | sunserial_console_match(SUNSAB_CONSOLE(), op->dev.of_node, |
1034 | &sunsab_reg, up[1].port.line, | 1034 | &sunsab_reg, up[1].port.line, |
1035 | false); | 1035 | false); |
1036 | 1036 | ||
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index 01f7731e59b8..a647b2448071 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c | |||
@@ -1200,7 +1200,7 @@ static int __devinit sunsu_kbd_ms_init(struct uart_sunsu_port *up) | |||
1200 | return -ENODEV; | 1200 | return -ENODEV; |
1201 | 1201 | ||
1202 | printk("%s: %s port at %llx, irq %u\n", | 1202 | printk("%s: %s port at %llx, irq %u\n", |
1203 | to_of_device(up->port.dev)->node->full_name, | 1203 | to_of_device(up->port.dev)->dev.of_node->full_name, |
1204 | (up->su_type == SU_PORT_KBD) ? "Keyboard" : "Mouse", | 1204 | (up->su_type == SU_PORT_KBD) ? "Keyboard" : "Mouse", |
1205 | (unsigned long long) up->port.mapbase, | 1205 | (unsigned long long) up->port.mapbase, |
1206 | up->port.irq); | 1206 | up->port.irq); |
@@ -1352,7 +1352,7 @@ static int __init sunsu_console_setup(struct console *co, char *options) | |||
1352 | spin_lock_init(&port->lock); | 1352 | spin_lock_init(&port->lock); |
1353 | 1353 | ||
1354 | /* Get firmware console settings. */ | 1354 | /* Get firmware console settings. */ |
1355 | sunserial_console_termios(co, to_of_device(port->dev)->node); | 1355 | sunserial_console_termios(co, to_of_device(port->dev)->dev.of_node); |
1356 | 1356 | ||
1357 | memset(&termios, 0, sizeof(struct ktermios)); | 1357 | memset(&termios, 0, sizeof(struct ktermios)); |
1358 | termios.c_cflag = co->cflag; | 1358 | termios.c_cflag = co->cflag; |
@@ -1409,7 +1409,7 @@ static enum su_type __devinit su_get_type(struct device_node *dp) | |||
1409 | static int __devinit su_probe(struct of_device *op, const struct of_device_id *match) | 1409 | static int __devinit su_probe(struct of_device *op, const struct of_device_id *match) |
1410 | { | 1410 | { |
1411 | static int inst; | 1411 | static int inst; |
1412 | struct device_node *dp = op->node; | 1412 | struct device_node *dp = op->dev.of_node; |
1413 | struct uart_sunsu_port *up; | 1413 | struct uart_sunsu_port *up; |
1414 | struct resource *rp; | 1414 | struct resource *rp; |
1415 | enum su_type type; | 1415 | enum su_type type; |
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c index 2c7a66af4f52..20f9be8cd949 100644 --- a/drivers/serial/sunzilog.c +++ b/drivers/serial/sunzilog.c | |||
@@ -1180,7 +1180,7 @@ static int __init sunzilog_console_setup(struct console *con, char *options) | |||
1180 | (sunzilog_reg.minor - 64) + con->index, con->index); | 1180 | (sunzilog_reg.minor - 64) + con->index, con->index); |
1181 | 1181 | ||
1182 | /* Get firmware console settings. */ | 1182 | /* Get firmware console settings. */ |
1183 | sunserial_console_termios(con, to_of_device(up->port.dev)->node); | 1183 | sunserial_console_termios(con, to_of_device(up->port.dev)->dev.of_node); |
1184 | 1184 | ||
1185 | /* Firmware console speed is limited to 150-->38400 baud so | 1185 | /* Firmware console speed is limited to 150-->38400 baud so |
1186 | * this hackish cflag thing is OK. | 1186 | * this hackish cflag thing is OK. |
@@ -1358,7 +1358,7 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m | |||
1358 | int keyboard_mouse = 0; | 1358 | int keyboard_mouse = 0; |
1359 | int err; | 1359 | int err; |
1360 | 1360 | ||
1361 | if (of_find_property(op->node, "keyboard", NULL)) | 1361 | if (of_find_property(op->dev.of_node, "keyboard", NULL)) |
1362 | keyboard_mouse = 1; | 1362 | keyboard_mouse = 1; |
1363 | 1363 | ||
1364 | /* uarts must come before keyboards/mice */ | 1364 | /* uarts must come before keyboards/mice */ |
@@ -1415,7 +1415,7 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m | |||
1415 | sunzilog_init_hw(&up[1]); | 1415 | sunzilog_init_hw(&up[1]); |
1416 | 1416 | ||
1417 | if (!keyboard_mouse) { | 1417 | if (!keyboard_mouse) { |
1418 | if (sunserial_console_match(SUNZILOG_CONSOLE(), op->node, | 1418 | if (sunserial_console_match(SUNZILOG_CONSOLE(), op->dev.of_node, |
1419 | &sunzilog_reg, up[0].port.line, | 1419 | &sunzilog_reg, up[0].port.line, |
1420 | false)) | 1420 | false)) |
1421 | up->flags |= SUNZILOG_FLAG_IS_CONS; | 1421 | up->flags |= SUNZILOG_FLAG_IS_CONS; |
@@ -1425,7 +1425,7 @@ static int __devinit zs_probe(struct of_device *op, const struct of_device_id *m | |||
1425 | rp, sizeof(struct zilog_layout)); | 1425 | rp, sizeof(struct zilog_layout)); |
1426 | return err; | 1426 | return err; |
1427 | } | 1427 | } |
1428 | if (sunserial_console_match(SUNZILOG_CONSOLE(), op->node, | 1428 | if (sunserial_console_match(SUNZILOG_CONSOLE(), op->dev.of_node, |
1429 | &sunzilog_reg, up[1].port.line, | 1429 | &sunzilog_reg, up[1].port.line, |
1430 | false)) | 1430 | false)) |
1431 | up->flags |= SUNZILOG_FLAG_IS_CONS; | 1431 | up->flags |= SUNZILOG_FLAG_IS_CONS; |
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c index f0a6c61b17f7..8fc2583d06ff 100644 --- a/drivers/serial/uartlite.c +++ b/drivers/serial/uartlite.c | |||
@@ -591,15 +591,15 @@ ulite_of_probe(struct of_device *op, const struct of_device_id *match) | |||
591 | 591 | ||
592 | dev_dbg(&op->dev, "%s(%p, %p)\n", __func__, op, match); | 592 | dev_dbg(&op->dev, "%s(%p, %p)\n", __func__, op, match); |
593 | 593 | ||
594 | rc = of_address_to_resource(op->node, 0, &res); | 594 | rc = of_address_to_resource(op->dev.of_node, 0, &res); |
595 | if (rc) { | 595 | if (rc) { |
596 | dev_err(&op->dev, "invalid address\n"); | 596 | dev_err(&op->dev, "invalid address\n"); |
597 | return rc; | 597 | return rc; |
598 | } | 598 | } |
599 | 599 | ||
600 | irq = irq_of_parse_and_map(op->node, 0); | 600 | irq = irq_of_parse_and_map(op->dev.of_node, 0); |
601 | 601 | ||
602 | id = of_get_property(op->node, "port-number", NULL); | 602 | id = of_get_property(op->dev.of_node, "port-number", NULL); |
603 | 603 | ||
604 | return ulite_assign(&op->dev, id ? *id : -1, res.start+3, irq); | 604 | return ulite_assign(&op->dev, id ? *id : -1, res.start+3, irq); |
605 | } | 605 | } |
diff --git a/drivers/serial/ucc_uart.c b/drivers/serial/ucc_uart.c index 074904912f64..529890f044e2 100644 --- a/drivers/serial/ucc_uart.c +++ b/drivers/serial/ucc_uart.c | |||
@@ -1197,7 +1197,7 @@ static void uart_firmware_cont(const struct firmware *fw, void *context) | |||
1197 | static int ucc_uart_probe(struct of_device *ofdev, | 1197 | static int ucc_uart_probe(struct of_device *ofdev, |
1198 | const struct of_device_id *match) | 1198 | const struct of_device_id *match) |
1199 | { | 1199 | { |
1200 | struct device_node *np = ofdev->node; | 1200 | struct device_node *np = ofdev->dev.of_node; |
1201 | const unsigned int *iprop; /* Integer OF properties */ | 1201 | const unsigned int *iprop; /* Integer OF properties */ |
1202 | const char *sprop; /* String OF properties */ | 1202 | const char *sprop; /* String OF properties */ |
1203 | struct uart_qe_port *qe_port = NULL; | 1203 | struct uart_qe_port *qe_port = NULL; |