adm5120: merge 2.6.30+ specific patches
authorGabor Juhos <juhosg@openwrt.org>
Sat, 2 Jan 2010 15:07:31 +0000 (15:07 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Sat, 2 Jan 2010 15:07:31 +0000 (15:07 +0000)
SVN-Revision: 18999

14 files changed:
target/linux/adm5120/files/arch/mips/adm5120/common/clock.c
target/linux/adm5120/files/arch/mips/adm5120/common/platform.c
target/linux/adm5120/files/drivers/mtd/maps/adm5120-flash.c
target/linux/adm5120/files/drivers/net/adm5120sw.c
target/linux/adm5120/patches-2.6.30/800-adm5120-remove-amba-bus-id.patch [deleted file]
target/linux/adm5120/patches-2.6.30/801-adm5120-flash-remove-bus-id.patch [deleted file]
target/linux/adm5120/patches-2.6.30/802-adm5120-switch-remove-redundant-napi-functions.patch [deleted file]
target/linux/adm5120/patches-2.6.30/803-adm5120-fix-clock-for-amba-uart.patch [deleted file]
target/linux/adm5120/patches-2.6.30/810-adm5120sw-netdev_ops.patch [deleted file]
target/linux/adm5120/patches-2.6.31/800-adm5120-remove-amba-bus-id.patch [deleted file]
target/linux/adm5120/patches-2.6.31/801-adm5120-flash-remove-bus-id.patch [deleted file]
target/linux/adm5120/patches-2.6.31/802-adm5120-switch-remove-redundant-napi-functions.patch [deleted file]
target/linux/adm5120/patches-2.6.31/803-adm5120-fix-clock-for-amba-uart.patch [deleted file]
target/linux/adm5120/patches-2.6.31/810-adm5120sw-netdev_ops.patch [deleted file]

index d004309..1ada60f 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/module.h>
 #include <linux/err.h>
 #include <linux/clk.h>
+#include <linux/device.h>
 
 #include <asm/mach-adm5120/adm5120_defs.h>
 
@@ -32,7 +33,9 @@ static struct clk uart_clk = {
 
 struct clk *clk_get(struct device *dev, const char *id)
 {
-       if (!strcmp(id, "UARTCLK"))
+       char *name = dev_name(dev);
+
+       if (!strcmp(name, "apb:uart0") || !strcmp(name, "apb:uart1"))
                return &uart_clk;
 
        return ERR_PTR(-ENOENT);
index 9526fe9..7fe86a1 100644 (file)
@@ -190,7 +190,7 @@ struct amba_pl010_data adm5120_uart0_data = {
 
 struct amba_device adm5120_uart0_device = {
        .dev            = {
-               .bus_id = "APB:UART0",
+               .init_name = "apb:uart0",
                .platform_data = &adm5120_uart0_data,
        },
        .res            = {
@@ -208,7 +208,7 @@ struct amba_pl010_data adm5120_uart1_data = {
 
 struct amba_device adm5120_uart1_device = {
        .dev            = {
-               .bus_id = "APB:UART1",
+               .init_name = "apb:uart1",
                .platform_data = &adm5120_uart1_data,
        },
        .res            = {
index 8bd7ae1..ed407eb 100644 (file)
@@ -233,7 +233,7 @@ static int adm5120_flash_initinfo(struct adm5120_flash_info *info,
        struct flash_desc *fdesc;
        u32 t = 0;
 
-       map->name = dev->dev.bus_id;
+       map->name = dev_name(&dev->dev);
 
        if (dev->id > 1) {
                MAP_ERR(map, "invalid flash id\n");
index 7acc84d..06a69fd 100644 (file)
@@ -517,7 +517,7 @@ static int adm5120_if_poll(struct napi_struct *napi, int limit)
        status = sw_int_status() & SWITCH_INTS_POLL;
        if ((done < limit) && (!status)) {
                SW_DBG("disable polling mode for %s\n", dev->name);
-               netif_rx_complete(dev, napi);
+               napi_complete(napi);
                sw_int_unmask(SWITCH_INTS_POLL);
                return 0;
        }
@@ -548,7 +548,7 @@ static irqreturn_t adm5120_switch_irq(int irq, void *dev_id)
                sw_dump_intr_mask("poll ints", status);
                SW_DBG("enable polling mode for %s\n", dev->name);
                sw_int_mask(SWITCH_INTS_POLL);
-               netif_rx_schedule(dev, &priv->napi);
+               napi_schedule(&priv->napi);
        }
 #else
        sw_int_ack(status);
@@ -973,9 +973,12 @@ static void adm5120_if_set_multicast_list(struct net_device *dev)
 
 static int adm5120_if_set_mac_address(struct net_device *dev, void *p)
 {
-       struct sockaddr *addr = p;
+       int ret;
+
+       ret = eth_mac_addr(dev, p);
+       if (ret)
+               return ret;
 
-       memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
        adm5120_write_mac(dev);
        return 0;
 }
@@ -1017,6 +1020,18 @@ static int adm5120_if_do_ioctl(struct net_device *dev, struct ifreq *rq,
        return 0;
 }
 
+static const struct net_device_ops adm5120sw_netdev_ops = {
+        .ndo_open               = adm5120_if_open,
+        .ndo_stop               = adm5120_if_stop,
+        .ndo_start_xmit         = adm5120_if_hard_start_xmit,
+        .ndo_set_multicast_list = adm5120_if_set_multicast_list,
+        .ndo_do_ioctl           = adm5120_if_do_ioctl,
+        .ndo_tx_timeout         = adm5120_if_tx_timeout,
+        .ndo_validate_addr      = eth_validate_addr,
+        .ndo_change_mtu         = eth_change_mtu,
+       .ndo_set_mac_address    = adm5120_if_set_mac_address,
+};
+
 static struct net_device *adm5120_if_alloc(void)
 {
        struct net_device *dev;
@@ -1030,14 +1045,8 @@ static struct net_device *adm5120_if_alloc(void)
        priv->dev = dev;
 
        dev->irq                = ADM5120_IRQ_SWITCH;
-       dev->open               = adm5120_if_open;
-       dev->hard_start_xmit    = adm5120_if_hard_start_xmit;
-       dev->stop               = adm5120_if_stop;
-       dev->set_multicast_list = adm5120_if_set_multicast_list;
-       dev->do_ioctl           = adm5120_if_do_ioctl;
-       dev->tx_timeout         = adm5120_if_tx_timeout;
+       dev->netdev_ops         = &adm5120sw_netdev_ops;
        dev->watchdog_timeo     = TX_TIMEOUT;
-       dev->set_mac_address    = adm5120_if_set_mac_address;
 
 #ifdef CONFIG_ADM5120_SWITCH_NAPI
        netif_napi_add(dev, &priv->napi, adm5120_if_poll, 64);
diff --git a/target/linux/adm5120/patches-2.6.30/800-adm5120-remove-amba-bus-id.patch b/target/linux/adm5120/patches-2.6.30/800-adm5120-remove-amba-bus-id.patch
deleted file mode 100644 (file)
index 6be70ca..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/arch/mips/adm5120/common/platform.c
-+++ b/arch/mips/adm5120/common/platform.c
-@@ -190,7 +190,7 @@ struct amba_pl010_data adm5120_uart0_dat
- struct amba_device adm5120_uart0_device = {
-       .dev            = {
--              .bus_id = "APB:UART0",
-+              .init_name = "apb:uart0",
-               .platform_data = &adm5120_uart0_data,
-       },
-       .res            = {
-@@ -208,7 +208,7 @@ struct amba_pl010_data adm5120_uart1_dat
- struct amba_device adm5120_uart1_device = {
-       .dev            = {
--              .bus_id = "APB:UART1",
-+              .init_name = "apb:uart1",
-               .platform_data = &adm5120_uart1_data,
-       },
-       .res            = {
diff --git a/target/linux/adm5120/patches-2.6.30/801-adm5120-flash-remove-bus-id.patch b/target/linux/adm5120/patches-2.6.30/801-adm5120-flash-remove-bus-id.patch
deleted file mode 100644 (file)
index d9e72e0..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/drivers/mtd/maps/adm5120-flash.c
-+++ b/drivers/mtd/maps/adm5120-flash.c
-@@ -233,7 +233,7 @@ static int adm5120_flash_initinfo(struct
-       struct flash_desc *fdesc;
-       u32 t = 0;
--      map->name = dev->dev.bus_id;
-+      map->name = dev_name(&dev->dev);
-       if (dev->id > 1) {
-               MAP_ERR(map, "invalid flash id\n");
diff --git a/target/linux/adm5120/patches-2.6.30/802-adm5120-switch-remove-redundant-napi-functions.patch b/target/linux/adm5120/patches-2.6.30/802-adm5120-switch-remove-redundant-napi-functions.patch
deleted file mode 100644 (file)
index 5c5873b..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/drivers/net/adm5120sw.c
-+++ b/drivers/net/adm5120sw.c
-@@ -517,7 +517,7 @@ static int adm5120_if_poll(struct napi_s
-       status = sw_int_status() & SWITCH_INTS_POLL;
-       if ((done < limit) && (!status)) {
-               SW_DBG("disable polling mode for %s\n", dev->name);
--              netif_rx_complete(dev, napi);
-+              napi_complete(napi);
-               sw_int_unmask(SWITCH_INTS_POLL);
-               return 0;
-       }
-@@ -548,7 +548,7 @@ static irqreturn_t adm5120_switch_irq(in
-               sw_dump_intr_mask("poll ints", status);
-               SW_DBG("enable polling mode for %s\n", dev->name);
-               sw_int_mask(SWITCH_INTS_POLL);
--              netif_rx_schedule(dev, &priv->napi);
-+              napi_schedule(&priv->napi);
-       }
- #else
-       sw_int_ack(status);
diff --git a/target/linux/adm5120/patches-2.6.30/803-adm5120-fix-clock-for-amba-uart.patch b/target/linux/adm5120/patches-2.6.30/803-adm5120-fix-clock-for-amba-uart.patch
deleted file mode 100644 (file)
index 795c285..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/arch/mips/adm5120/common/clock.c
-+++ b/arch/mips/adm5120/common/clock.c
-@@ -19,6 +19,7 @@
- #include <linux/module.h>
- #include <linux/err.h>
- #include <linux/clk.h>
-+#include <linux/device.h>
- #include <asm/mach-adm5120/adm5120_defs.h>
-@@ -32,7 +33,9 @@ static struct clk uart_clk = {
- struct clk *clk_get(struct device *dev, const char *id)
- {
--      if (!strcmp(id, "UARTCLK"))
-+      char *name = dev_name(dev);
-+
-+      if (!strcmp(name, "apb:uart0") || !strcmp(name, "apb:uart1"))
-               return &uart_clk;
-       return ERR_PTR(-ENOENT);
diff --git a/target/linux/adm5120/patches-2.6.30/810-adm5120sw-netdev_ops.patch b/target/linux/adm5120/patches-2.6.30/810-adm5120sw-netdev_ops.patch
deleted file mode 100644 (file)
index ae11650..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
---- a/drivers/net/adm5120sw.c
-+++ b/drivers/net/adm5120sw.c
-@@ -973,9 +973,12 @@ static void adm5120_if_set_multicast_lis
- static int adm5120_if_set_mac_address(struct net_device *dev, void *p)
- {
--      struct sockaddr *addr = p;
-+      int ret;
-+
-+      ret = eth_mac_addr(dev, p);
-+      if (ret)
-+              return ret;
--      memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
-       adm5120_write_mac(dev);
-       return 0;
- }
-@@ -1017,6 +1020,18 @@ static int adm5120_if_do_ioctl(struct ne
-       return 0;
- }
-+static const struct net_device_ops adm5120sw_netdev_ops = {
-+        .ndo_open               = adm5120_if_open,
-+        .ndo_stop               = adm5120_if_stop,
-+        .ndo_start_xmit         = adm5120_if_hard_start_xmit,
-+        .ndo_set_multicast_list = adm5120_if_set_multicast_list,
-+        .ndo_do_ioctl           = adm5120_if_do_ioctl,
-+        .ndo_tx_timeout         = adm5120_if_tx_timeout,
-+        .ndo_validate_addr      = eth_validate_addr,
-+        .ndo_change_mtu         = eth_change_mtu,
-+      .ndo_set_mac_address    = adm5120_if_set_mac_address,
-+};
-+
- static struct net_device *adm5120_if_alloc(void)
- {
-       struct net_device *dev;
-@@ -1030,14 +1045,8 @@ static struct net_device *adm5120_if_all
-       priv->dev = dev;
-       dev->irq                = ADM5120_IRQ_SWITCH;
--      dev->open               = adm5120_if_open;
--      dev->hard_start_xmit    = adm5120_if_hard_start_xmit;
--      dev->stop               = adm5120_if_stop;
--      dev->set_multicast_list = adm5120_if_set_multicast_list;
--      dev->do_ioctl           = adm5120_if_do_ioctl;
--      dev->tx_timeout         = adm5120_if_tx_timeout;
-+      dev->netdev_ops         = &adm5120sw_netdev_ops;
-       dev->watchdog_timeo     = TX_TIMEOUT;
--      dev->set_mac_address    = adm5120_if_set_mac_address;
- #ifdef CONFIG_ADM5120_SWITCH_NAPI
-       netif_napi_add(dev, &priv->napi, adm5120_if_poll, 64);
diff --git a/target/linux/adm5120/patches-2.6.31/800-adm5120-remove-amba-bus-id.patch b/target/linux/adm5120/patches-2.6.31/800-adm5120-remove-amba-bus-id.patch
deleted file mode 100644 (file)
index 6be70ca..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/arch/mips/adm5120/common/platform.c
-+++ b/arch/mips/adm5120/common/platform.c
-@@ -190,7 +190,7 @@ struct amba_pl010_data adm5120_uart0_dat
- struct amba_device adm5120_uart0_device = {
-       .dev            = {
--              .bus_id = "APB:UART0",
-+              .init_name = "apb:uart0",
-               .platform_data = &adm5120_uart0_data,
-       },
-       .res            = {
-@@ -208,7 +208,7 @@ struct amba_pl010_data adm5120_uart1_dat
- struct amba_device adm5120_uart1_device = {
-       .dev            = {
--              .bus_id = "APB:UART1",
-+              .init_name = "apb:uart1",
-               .platform_data = &adm5120_uart1_data,
-       },
-       .res            = {
diff --git a/target/linux/adm5120/patches-2.6.31/801-adm5120-flash-remove-bus-id.patch b/target/linux/adm5120/patches-2.6.31/801-adm5120-flash-remove-bus-id.patch
deleted file mode 100644 (file)
index d9e72e0..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/drivers/mtd/maps/adm5120-flash.c
-+++ b/drivers/mtd/maps/adm5120-flash.c
-@@ -233,7 +233,7 @@ static int adm5120_flash_initinfo(struct
-       struct flash_desc *fdesc;
-       u32 t = 0;
--      map->name = dev->dev.bus_id;
-+      map->name = dev_name(&dev->dev);
-       if (dev->id > 1) {
-               MAP_ERR(map, "invalid flash id\n");
diff --git a/target/linux/adm5120/patches-2.6.31/802-adm5120-switch-remove-redundant-napi-functions.patch b/target/linux/adm5120/patches-2.6.31/802-adm5120-switch-remove-redundant-napi-functions.patch
deleted file mode 100644 (file)
index 5c5873b..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
---- a/drivers/net/adm5120sw.c
-+++ b/drivers/net/adm5120sw.c
-@@ -517,7 +517,7 @@ static int adm5120_if_poll(struct napi_s
-       status = sw_int_status() & SWITCH_INTS_POLL;
-       if ((done < limit) && (!status)) {
-               SW_DBG("disable polling mode for %s\n", dev->name);
--              netif_rx_complete(dev, napi);
-+              napi_complete(napi);
-               sw_int_unmask(SWITCH_INTS_POLL);
-               return 0;
-       }
-@@ -548,7 +548,7 @@ static irqreturn_t adm5120_switch_irq(in
-               sw_dump_intr_mask("poll ints", status);
-               SW_DBG("enable polling mode for %s\n", dev->name);
-               sw_int_mask(SWITCH_INTS_POLL);
--              netif_rx_schedule(dev, &priv->napi);
-+              napi_schedule(&priv->napi);
-       }
- #else
-       sw_int_ack(status);
diff --git a/target/linux/adm5120/patches-2.6.31/803-adm5120-fix-clock-for-amba-uart.patch b/target/linux/adm5120/patches-2.6.31/803-adm5120-fix-clock-for-amba-uart.patch
deleted file mode 100644 (file)
index 795c285..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/arch/mips/adm5120/common/clock.c
-+++ b/arch/mips/adm5120/common/clock.c
-@@ -19,6 +19,7 @@
- #include <linux/module.h>
- #include <linux/err.h>
- #include <linux/clk.h>
-+#include <linux/device.h>
- #include <asm/mach-adm5120/adm5120_defs.h>
-@@ -32,7 +33,9 @@ static struct clk uart_clk = {
- struct clk *clk_get(struct device *dev, const char *id)
- {
--      if (!strcmp(id, "UARTCLK"))
-+      char *name = dev_name(dev);
-+
-+      if (!strcmp(name, "apb:uart0") || !strcmp(name, "apb:uart1"))
-               return &uart_clk;
-       return ERR_PTR(-ENOENT);
diff --git a/target/linux/adm5120/patches-2.6.31/810-adm5120sw-netdev_ops.patch b/target/linux/adm5120/patches-2.6.31/810-adm5120sw-netdev_ops.patch
deleted file mode 100644 (file)
index ae11650..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
---- a/drivers/net/adm5120sw.c
-+++ b/drivers/net/adm5120sw.c
-@@ -973,9 +973,12 @@ static void adm5120_if_set_multicast_lis
- static int adm5120_if_set_mac_address(struct net_device *dev, void *p)
- {
--      struct sockaddr *addr = p;
-+      int ret;
-+
-+      ret = eth_mac_addr(dev, p);
-+      if (ret)
-+              return ret;
--      memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
-       adm5120_write_mac(dev);
-       return 0;
- }
-@@ -1017,6 +1020,18 @@ static int adm5120_if_do_ioctl(struct ne
-       return 0;
- }
-+static const struct net_device_ops adm5120sw_netdev_ops = {
-+        .ndo_open               = adm5120_if_open,
-+        .ndo_stop               = adm5120_if_stop,
-+        .ndo_start_xmit         = adm5120_if_hard_start_xmit,
-+        .ndo_set_multicast_list = adm5120_if_set_multicast_list,
-+        .ndo_do_ioctl           = adm5120_if_do_ioctl,
-+        .ndo_tx_timeout         = adm5120_if_tx_timeout,
-+        .ndo_validate_addr      = eth_validate_addr,
-+        .ndo_change_mtu         = eth_change_mtu,
-+      .ndo_set_mac_address    = adm5120_if_set_mac_address,
-+};
-+
- static struct net_device *adm5120_if_alloc(void)
- {
-       struct net_device *dev;
-@@ -1030,14 +1045,8 @@ static struct net_device *adm5120_if_all
-       priv->dev = dev;
-       dev->irq                = ADM5120_IRQ_SWITCH;
--      dev->open               = adm5120_if_open;
--      dev->hard_start_xmit    = adm5120_if_hard_start_xmit;
--      dev->stop               = adm5120_if_stop;
--      dev->set_multicast_list = adm5120_if_set_multicast_list;
--      dev->do_ioctl           = adm5120_if_do_ioctl;
--      dev->tx_timeout         = adm5120_if_tx_timeout;
-+      dev->netdev_ops         = &adm5120sw_netdev_ops;
-       dev->watchdog_timeo     = TX_TIMEOUT;
--      dev->set_mac_address    = adm5120_if_set_mac_address;
- #ifdef CONFIG_ADM5120_SWITCH_NAPI
-       netif_napi_add(dev, &priv->napi, adm5120_if_poll, 64);