You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
@@ -559,7 +559,7 @@ static int __devinit apbuart_probe(struct of_device *op,
|
||||
|
||||
i = 0;
|
||||
for (i = 0; i < grlib_apbuart_port_nr; i++) {
|
||||
if (op->node == grlib_apbuart_nodes[i])
|
||||
if (op->dev.of_node == grlib_apbuart_nodes[i])
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -1342,7 +1342,7 @@ static int __devinit cpm_uart_probe(struct of_device *ofdev,
|
||||
/* initialize the device pointer for the port */
|
||||
pinfo->port.dev = &ofdev->dev;
|
||||
|
||||
ret = cpm_uart_init_port(ofdev->node, pinfo);
|
||||
ret = cpm_uart_init_port(ofdev->dev.of_node, pinfo);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -1328,14 +1328,14 @@ mpc52xx_uart_of_probe(struct of_device *op, const struct of_device_id *match)
|
||||
|
||||
/* Check validity & presence */
|
||||
for (idx = 0; idx < MPC52xx_PSC_MAXNUM; idx++)
|
||||
if (mpc52xx_uart_nodes[idx] == op->node)
|
||||
if (mpc52xx_uart_nodes[idx] == op->dev.of_node)
|
||||
break;
|
||||
if (idx >= MPC52xx_PSC_MAXNUM)
|
||||
return -EINVAL;
|
||||
pr_debug("Found %s assigned to ttyPSC%x\n",
|
||||
mpc52xx_uart_nodes[idx]->full_name, idx);
|
||||
|
||||
uartclk = psc_ops->getuartclk(op->node);
|
||||
uartclk = psc_ops->getuartclk(op->dev.of_node);
|
||||
if (uartclk == 0) {
|
||||
dev_dbg(&op->dev, "Could not find uart clock frequency!\n");
|
||||
return -EINVAL;
|
||||
@@ -1355,7 +1355,7 @@ mpc52xx_uart_of_probe(struct of_device *op, const struct of_device_id *match)
|
||||
port->dev = &op->dev;
|
||||
|
||||
/* Search for IRQ and mapbase */
|
||||
ret = of_address_to_resource(op->node, 0, &res);
|
||||
ret = of_address_to_resource(op->dev.of_node, 0, &res);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -1365,7 +1365,7 @@ mpc52xx_uart_of_probe(struct of_device *op, const struct of_device_id *match)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
psc_ops->get_irq(port, op->node);
|
||||
psc_ops->get_irq(port, op->dev.of_node);
|
||||
if (port->irq == NO_IRQ) {
|
||||
dev_dbg(&op->dev, "Could not get irq\n");
|
||||
return -EINVAL;
|
||||
|
||||
@@ -344,7 +344,7 @@ int nwpserial_register_port(struct uart_port *port)
|
||||
|
||||
mutex_lock(&nwpserial_mutex);
|
||||
|
||||
dn = to_of_device(port->dev)->node;
|
||||
dn = to_of_device(port->dev)->dev.of_node;
|
||||
if (dn == NULL)
|
||||
goto out;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ static int __devinit of_platform_serial_setup(struct of_device *ofdev,
|
||||
int type, struct uart_port *port)
|
||||
{
|
||||
struct resource resource;
|
||||
struct device_node *np = ofdev->node;
|
||||
struct device_node *np = ofdev->dev.of_node;
|
||||
const unsigned int *clk, *spd;
|
||||
const u32 *prop;
|
||||
int ret, prop_size;
|
||||
@@ -88,7 +88,7 @@ static int __devinit of_platform_serial_probe(struct of_device *ofdev,
|
||||
int port_type;
|
||||
int ret;
|
||||
|
||||
if (of_find_property(ofdev->node, "used-by-rtas", NULL))
|
||||
if (of_find_property(ofdev->dev.of_node, "used-by-rtas", NULL))
|
||||
return -EBUSY;
|
||||
|
||||
info = kmalloc(sizeof(*info), GFP_KERNEL);
|
||||
|
||||
@@ -1609,7 +1609,7 @@ static int pmz_attach(struct macio_dev *mdev, const struct of_device_id *match)
|
||||
/* Iterate the pmz_ports array to find a matching entry
|
||||
*/
|
||||
for (i = 0; i < MAX_ZS_PORTS; i++)
|
||||
if (pmz_ports[i].node == mdev->ofdev.node) {
|
||||
if (pmz_ports[i].node == mdev->ofdev.dev.of_node) {
|
||||
struct uart_pmac_port *uap = &pmz_ports[i];
|
||||
|
||||
uap->dev = mdev;
|
||||
|
||||
@@ -565,7 +565,7 @@ static int __devinit hv_probe(struct of_device *op, const struct of_device_id *m
|
||||
if (err)
|
||||
goto out_free_con_read_page;
|
||||
|
||||
sunserial_console_match(&sunhv_console, op->node,
|
||||
sunserial_console_match(&sunhv_console, op->dev.of_node,
|
||||
&sunhv_reg, port->line, false);
|
||||
|
||||
err = uart_add_one_port(&sunhv_reg, port);
|
||||
|
||||
@@ -883,7 +883,7 @@ static int sunsab_console_setup(struct console *con, char *options)
|
||||
printk("Console: ttyS%d (SAB82532)\n",
|
||||
(sunsab_reg.minor - 64) + con->index);
|
||||
|
||||
sunserial_console_termios(con, to_of_device(up->port.dev)->node);
|
||||
sunserial_console_termios(con, to_of_device(up->port.dev)->dev.of_node);
|
||||
|
||||
switch (con->cflag & CBAUD) {
|
||||
case B150: baud = 150; break;
|
||||
@@ -1026,11 +1026,11 @@ static int __devinit sab_probe(struct of_device *op, const struct of_device_id *
|
||||
if (err)
|
||||
goto out1;
|
||||
|
||||
sunserial_console_match(SUNSAB_CONSOLE(), op->node,
|
||||
sunserial_console_match(SUNSAB_CONSOLE(), op->dev.of_node,
|
||||
&sunsab_reg, up[0].port.line,
|
||||
false);
|
||||
|
||||
sunserial_console_match(SUNSAB_CONSOLE(), op->node,
|
||||
sunserial_console_match(SUNSAB_CONSOLE(), op->dev.of_node,
|
||||
&sunsab_reg, up[1].port.line,
|
||||
false);
|
||||
|
||||
|
||||
@@ -1200,7 +1200,7 @@ static int __devinit sunsu_kbd_ms_init(struct uart_sunsu_port *up)
|
||||
return -ENODEV;
|
||||
|
||||
printk("%s: %s port at %llx, irq %u\n",
|
||||
to_of_device(up->port.dev)->node->full_name,
|
||||
to_of_device(up->port.dev)->dev.of_node->full_name,
|
||||
(up->su_type == SU_PORT_KBD) ? "Keyboard" : "Mouse",
|
||||
(unsigned long long) up->port.mapbase,
|
||||
up->port.irq);
|
||||
@@ -1352,7 +1352,7 @@ static int __init sunsu_console_setup(struct console *co, char *options)
|
||||
spin_lock_init(&port->lock);
|
||||
|
||||
/* Get firmware console settings. */
|
||||
sunserial_console_termios(co, to_of_device(port->dev)->node);
|
||||
sunserial_console_termios(co, to_of_device(port->dev)->dev.of_node);
|
||||
|
||||
memset(&termios, 0, sizeof(struct ktermios));
|
||||
termios.c_cflag = co->cflag;
|
||||
@@ -1409,7 +1409,7 @@ static enum su_type __devinit su_get_type(struct device_node *dp)
|
||||
static int __devinit su_probe(struct of_device *op, const struct of_device_id *match)
|
||||
{
|
||||
static int inst;
|
||||
struct device_node *dp = op->node;
|
||||
struct device_node *dp = op->dev.of_node;
|
||||
struct uart_sunsu_port *up;
|
||||
struct resource *rp;
|
||||
enum su_type type;
|
||||
|
||||
@@ -1180,7 +1180,7 @@ static int __init sunzilog_console_setup(struct console *con, char *options)
|
||||
(sunzilog_reg.minor - 64) + con->index, con->index);
|
||||
|
||||
/* Get firmware console settings. */
|
||||
sunserial_console_termios(con, to_of_device(up->port.dev)->node);
|
||||
sunserial_console_termios(con, to_of_device(up->port.dev)->dev.of_node);
|
||||
|
||||
/* Firmware console speed is limited to 150-->38400 baud so
|
||||
* 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
|
||||
int keyboard_mouse = 0;
|
||||
int err;
|
||||
|
||||
if (of_find_property(op->node, "keyboard", NULL))
|
||||
if (of_find_property(op->dev.of_node, "keyboard", NULL))
|
||||
keyboard_mouse = 1;
|
||||
|
||||
/* 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
|
||||
sunzilog_init_hw(&up[1]);
|
||||
|
||||
if (!keyboard_mouse) {
|
||||
if (sunserial_console_match(SUNZILOG_CONSOLE(), op->node,
|
||||
if (sunserial_console_match(SUNZILOG_CONSOLE(), op->dev.of_node,
|
||||
&sunzilog_reg, up[0].port.line,
|
||||
false))
|
||||
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
|
||||
rp, sizeof(struct zilog_layout));
|
||||
return err;
|
||||
}
|
||||
if (sunserial_console_match(SUNZILOG_CONSOLE(), op->node,
|
||||
if (sunserial_console_match(SUNZILOG_CONSOLE(), op->dev.of_node,
|
||||
&sunzilog_reg, up[1].port.line,
|
||||
false))
|
||||
up->flags |= SUNZILOG_FLAG_IS_CONS;
|
||||
|
||||
@@ -591,15 +591,15 @@ ulite_of_probe(struct of_device *op, const struct of_device_id *match)
|
||||
|
||||
dev_dbg(&op->dev, "%s(%p, %p)\n", __func__, op, match);
|
||||
|
||||
rc = of_address_to_resource(op->node, 0, &res);
|
||||
rc = of_address_to_resource(op->dev.of_node, 0, &res);
|
||||
if (rc) {
|
||||
dev_err(&op->dev, "invalid address\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
irq = irq_of_parse_and_map(op->node, 0);
|
||||
irq = irq_of_parse_and_map(op->dev.of_node, 0);
|
||||
|
||||
id = of_get_property(op->node, "port-number", NULL);
|
||||
id = of_get_property(op->dev.of_node, "port-number", NULL);
|
||||
|
||||
return ulite_assign(&op->dev, id ? *id : -1, res.start+3, irq);
|
||||
}
|
||||
|
||||
@@ -1197,7 +1197,7 @@ static void uart_firmware_cont(const struct firmware *fw, void *context)
|
||||
static int ucc_uart_probe(struct of_device *ofdev,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
struct device_node *np = ofdev->node;
|
||||
struct device_node *np = ofdev->dev.of_node;
|
||||
const unsigned int *iprop; /* Integer OF properties */
|
||||
const char *sprop; /* String OF properties */
|
||||
struct uart_qe_port *qe_port = NULL;
|
||||
|
||||
Reference in New Issue
Block a user