summaryrefslogtreecommitdiff
path: root/target/linux/ifxmips/files/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ifxmips/files/drivers')
-rw-r--r--target/linux/ifxmips/files/drivers/mtd/maps/ifxmips.c6
-rw-r--r--target/linux/ifxmips/files/drivers/net/ifxmips_mii0.c23
-rw-r--r--target/linux/ifxmips/files/drivers/watchdog/ifxmips_wdt.c2
3 files changed, 14 insertions, 17 deletions
diff --git a/target/linux/ifxmips/files/drivers/mtd/maps/ifxmips.c b/target/linux/ifxmips/files/drivers/mtd/maps/ifxmips.c
index a2d30cd0b6..6498d12cb1 100644
--- a/target/linux/ifxmips/files/drivers/mtd/maps/ifxmips.c
+++ b/target/linux/ifxmips/files/drivers/mtd/maps/ifxmips.c
@@ -134,8 +134,8 @@ int find_uImage_size(unsigned long start_offset)
unsigned long magic;
unsigned long temp;
ifxmips_copy_from(&ifxmips_map, &magic, start_offset, 4);
- if (!(ntohl(magic) == 0x27051956)) {
- printk(KERN_INFO "ifxmips_mtd: invalid magic (0x%08X) of kernel at 0x%08lx \n", ntohl(magic), start_offset);
+ if (le32_to_cpu(magic) != 0x56190527) {
+ printk(KERN_INFO "ifxmips_mtd: invalid magic (0x%08X) of kernel at 0x%08lx \n", le32_to_cpu(magic), start_offset);
return 0;
}
ifxmips_copy_from(&ifxmips_map, &temp, start_offset + 12, 4);
@@ -159,7 +159,7 @@ int detect_squashfs_partition(unsigned long start_offset)
{
unsigned long temp;
ifxmips_copy_from(&ifxmips_map, &temp, start_offset, 4);
- return temp == SQUASHFS_MAGIC;
+ return le32_to_cpu(temp) == SQUASHFS_MAGIC;
}
static int ifxmips_mtd_probe(struct platform_device *dev)
diff --git a/target/linux/ifxmips/files/drivers/net/ifxmips_mii0.c b/target/linux/ifxmips/files/drivers/net/ifxmips_mii0.c
index 1185a15372..0fddc631ba 100644
--- a/target/linux/ifxmips/files/drivers/net/ifxmips_mii0.c
+++ b/target/linux/ifxmips/files/drivers/net/ifxmips_mii0.c
@@ -79,7 +79,7 @@ EXPORT_SYMBOL(ifxmips_read_mdio);
int ifxmips_ifxmips_mii_open(struct net_device *dev)
{
- struct ifxmips_mii_priv *priv = (struct ifxmips_mii_priv *)dev->priv;
+ struct ifxmips_mii_priv *priv = (struct ifxmips_mii_priv *)netdev_priv(dev);
struct dma_device_info *dma_dev = priv->dma_device;
int i;
@@ -93,7 +93,7 @@ int ifxmips_ifxmips_mii_open(struct net_device *dev)
int ifxmips_mii_release(struct net_device *dev)
{
- struct ifxmips_mii_priv *priv = (struct ifxmips_mii_priv *)dev->priv;
+ struct ifxmips_mii_priv *priv = (struct ifxmips_mii_priv *)netdev_priv(dev);
struct dma_device_info *dma_dev = priv->dma_device;
int i;
@@ -105,7 +105,7 @@ int ifxmips_mii_release(struct net_device *dev)
int ifxmips_mii_hw_receive(struct net_device *dev, struct dma_device_info *dma_dev)
{
- struct ifxmips_mii_priv *priv = (struct ifxmips_mii_priv *)dev->priv;
+ struct ifxmips_mii_priv *priv = (struct ifxmips_mii_priv *)netdev_priv(dev);
unsigned char *buf = NULL;
struct sk_buff *skb = NULL;
int len = 0;
@@ -154,7 +154,7 @@ ifxmips_mii_hw_receive_err_exit:
int ifxmips_mii_hw_tx(char *buf, int len, struct net_device *dev)
{
int ret = 0;
- struct ifxmips_mii_priv *priv = dev->priv;
+ struct ifxmips_mii_priv *priv = netdev_priv(dev);
struct dma_device_info *dma_dev = priv->dma_device;
ret = dma_device_write(dma_dev, buf, len, priv->skb);
return ret;
@@ -164,7 +164,7 @@ int ifxmips_mii_tx(struct sk_buff *skb, struct net_device *dev)
{
int len;
char *data;
- struct ifxmips_mii_priv *priv = dev->priv;
+ struct ifxmips_mii_priv *priv = netdev_priv(dev);
struct dma_device_info *dma_dev = priv->dma_device;
len = skb->len < ETH_ZLEN ? ETH_ZLEN : skb->len;
@@ -192,7 +192,7 @@ int ifxmips_mii_tx(struct sk_buff *skb, struct net_device *dev)
void ifxmips_mii_tx_timeout(struct net_device *dev)
{
int i;
- struct ifxmips_mii_priv *priv = (struct ifxmips_mii_priv *)dev->priv;
+ struct ifxmips_mii_priv *priv = (struct ifxmips_mii_priv *)netdev_priv(dev);
priv->stats.tx_errors++;
for (i = 0; i < priv->dma_device->max_tx_chan_num; i++)
@@ -261,14 +261,13 @@ void ifxmips_etop_dma_buffer_free(unsigned char *dataptr, void *opt)
static struct net_device_stats *ifxmips_get_stats(struct net_device *dev)
{
- return (struct net_device_stats *)dev->priv;
+ return &((struct ifxmips_mii_priv *)netdev_priv(dev))->stats;
}
static int ifxmips_mii_dev_init(struct net_device *dev)
{
int i;
- struct ifxmips_mii_priv *priv;
-
+ struct ifxmips_mii_priv *priv = (struct ifxmips_mii_priv *)netdev_priv(dev);
ether_setup(dev);
printk(KERN_INFO "ifxmips_mii0: %s is up\n", dev->name);
dev->open = ifxmips_ifxmips_mii_open;
@@ -277,8 +276,7 @@ static int ifxmips_mii_dev_init(struct net_device *dev)
dev->get_stats = ifxmips_get_stats;
dev->tx_timeout = ifxmips_mii_tx_timeout;
dev->watchdog_timeo = 10 * HZ;
- memset(dev->priv, 0, sizeof(struct ifxmips_mii_priv));
- priv = dev->priv;
+ memset(priv, 0, sizeof(struct ifxmips_mii_priv));
priv->dma_device = dma_device_reserve("PPE");
if (!priv->dma_device) {
BUG();
@@ -347,14 +345,13 @@ out:
static int ifxmips_mii_remove(struct platform_device *dev)
{
- struct ifxmips_mii_priv *priv = (struct ifxmips_mii_priv *)ifxmips_mii0_dev->priv;
+ struct ifxmips_mii_priv *priv = (struct ifxmips_mii_priv *)netdev_priv(ifxmips_mii0_dev);
printk(KERN_INFO "ifxmips_mii0: ifxmips_mii0 cleanup\n");
dma_device_unregister(priv->dma_device);
dma_device_release(priv->dma_device);
kfree(priv->dma_device);
- kfree(ifxmips_mii0_dev->priv);
unregister_netdev(ifxmips_mii0_dev);
return 0;
}
diff --git a/target/linux/ifxmips/files/drivers/watchdog/ifxmips_wdt.c b/target/linux/ifxmips/files/drivers/watchdog/ifxmips_wdt.c
index e62d2fec38..d75eeeac20 100644
--- a/target/linux/ifxmips/files/drivers/watchdog/ifxmips_wdt.c
+++ b/target/linux/ifxmips/files/drivers/watchdog/ifxmips_wdt.c
@@ -25,7 +25,7 @@
#include <linux/platform_device.h>
#include <linux/uaccess.h>
-#include <asm/ifxmips/ifxmips_cgu.h>
+#include <asm/mach-ifxmips/cgu.h>
#include <asm/ifxmips/ifxmips.h>
#define IFXMIPS_WDT_PW1 0x00BE0000