From 08a7963aad03b5cf515f1e9c35e0ac9eb7dae072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Pouiller?= Date: Thu, 15 Oct 2009 09:58:27 -0600 Subject: of: Remove nested function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some toolchains dislike nested function definition, so we define function match outside of of_phy_find_device. Signed-off-by: Jérôme Pouiller Acked-by: David S. Miller Signed-off-by: Grant Likely --- drivers/of/of_mdio.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'drivers') diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c index bacaa536fd51..4b22ba568b19 100644 --- a/drivers/of/of_mdio.c +++ b/drivers/of/of_mdio.c @@ -97,6 +97,12 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) } EXPORT_SYMBOL(of_mdiobus_register); +/* Helper function for of_phy_find_device */ +static int of_phy_match(struct device *dev, void *phy_np) +{ + return dev_archdata_get_node(&dev->archdata) == phy_np; +} + /** * of_phy_find_device - Give a PHY node, find the phy_device * @phy_np: Pointer to the phy's device tree node @@ -106,15 +112,10 @@ EXPORT_SYMBOL(of_mdiobus_register); struct phy_device *of_phy_find_device(struct device_node *phy_np) { struct device *d; - int match(struct device *dev, void *phy_np) - { - return dev_archdata_get_node(&dev->archdata) == phy_np; - } - if (!phy_np) return NULL; - d = bus_find_device(&mdio_bus_type, NULL, phy_np, match); + d = bus_find_device(&mdio_bus_type, NULL, phy_np, of_phy_match); return d ? to_phy_device(d) : NULL; } EXPORT_SYMBOL(of_phy_find_device); -- cgit v1.2.3 From b7a8212cae06f3bfa810f941f455bd8bb9aa8528 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Thu, 15 Oct 2009 09:58:28 -0600 Subject: drivers/serial/mpc52xx_uart.c: Use UPIO_MEM rather than SERIAL_IO_MEM As in the commit 9b4a1617772d6d5ab5eeda0cd95302fae119e359, use UPIO_MEM rather than SERIAL_IO_MEM. Both have the same value. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @has_sc@ @@ #include @depends on has_sc@ @@ - SERIAL_IO_MEM + UPIO_MEM // Signed-off-by: Julia Lawall Signed-off-by: Grant Likely --- drivers/serial/mpc52xx_uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index d7bcd074d383..7ce9e9f567a3 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c @@ -705,7 +705,7 @@ mpc52xx_uart_verify_port(struct uart_port *port, struct serial_struct *ser) return -EINVAL; if ((ser->irq != port->irq) || - (ser->io_type != SERIAL_IO_MEM) || + (ser->io_type != UPIO_MEM) || (ser->baud_base != port->uartclk) || (ser->iomem_base != (void *)port->mapbase) || (ser->hub6 != 0)) -- cgit v1.2.3