aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-11-02 00:32:14 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-02 00:32:14 -0500
commit7f36b1e9582c06d0ddef5f2416c9b17017647d1f (patch)
treef83cbcef623476b9b8a14f7a0cc66eb92552a651 /drivers
parent0e016b9fa134d79341cca5e336ccbcea066d5f81 (diff)
parent73ee723e4c6d179c2e9496cc4caf160a18d95603 (diff)
Merge master.kernel.org:/home/rmk/linux-2.6-arm
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/busses/i2c-iop3xx.c9
-rw-r--r--drivers/net/arm/am79c961a.c41
-rw-r--r--drivers/net/arm/am79c961a.h2
3 files changed, 37 insertions, 15 deletions
diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c
index 13752bcb2afd..cfae4ad00fae 100644
--- a/drivers/i2c/busses/i2c-iop3xx.c
+++ b/drivers/i2c/busses/i2c-iop3xx.c
@@ -11,7 +11,7 @@
11 * 11 *
12 * Copyright (C) 1995-1997 Simon G. Vogl, 1998-2000 Hans Berglund 12 * Copyright (C) 1995-1997 Simon G. Vogl, 1998-2000 Hans Berglund
13 * 13 *
14 * And which acknowledged Kyösti Mälkki <kmalkki@cc.hut.fi>, 14 * And which acknowledged Kyösti Mälkki <kmalkki@cc.hut.fi>,
15 * Frodo Looijaard <frodol@dds.nl>, Martin Bailey<mbailey@littlefeet-inc.com> 15 * Frodo Looijaard <frodol@dds.nl>, Martin Bailey<mbailey@littlefeet-inc.com>
16 * 16 *
17 * Major cleanup by Deepak Saxena <dsaxena@plexity.net>, 01/2005: 17 * Major cleanup by Deepak Saxena <dsaxena@plexity.net>, 01/2005:
@@ -184,7 +184,7 @@ iop3xx_i2c_wait_event(struct i2c_algo_iop3xx_data *iop3xx_adap,
184 do { 184 do {
185 interrupted = wait_event_interruptible_timeout ( 185 interrupted = wait_event_interruptible_timeout (
186 iop3xx_adap->waitq, 186 iop3xx_adap->waitq,
187 (done = compare( sr = iop3xx_i2c_get_srstat(iop3xx_adap) ,flags )), 187 (done = compare( sr = iop3xx_i2c_get_srstat(iop3xx_adap) ,flags )),
188 1 * HZ; 188 1 * HZ;
189 ); 189 );
190 if ((rc = iop3xx_i2c_error(sr)) < 0) { 190 if ((rc = iop3xx_i2c_error(sr)) < 0) {
@@ -472,9 +472,10 @@ iop3xx_i2c_probe(struct device *dev)
472 goto release_region; 472 goto release_region;
473 } 473 }
474 474
475 res = request_irq(platform_get_irq(pdev, 0), iop3xx_i2c_irq_handler, 0, 475 ret = request_irq(platform_get_irq(pdev, 0), iop3xx_i2c_irq_handler, 0,
476 pdev->name, adapter_data); 476 pdev->name, adapter_data);
477 if (res) { 477
478 if (ret) {
478 ret = -EIO; 479 ret = -EIO;
479 goto unmap; 480 goto unmap;
480 } 481 }
diff --git a/drivers/net/arm/am79c961a.c b/drivers/net/arm/am79c961a.c
index 3d50e953faaa..877891a29aaa 100644
--- a/drivers/net/arm/am79c961a.c
+++ b/drivers/net/arm/am79c961a.c
@@ -26,11 +26,11 @@
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/crc32.h> 27#include <linux/crc32.h>
28#include <linux/bitops.h> 28#include <linux/bitops.h>
29#include <linux/platform_device.h>
29 30
30#include <asm/system.h>
31#include <asm/irq.h>
32#include <asm/hardware.h> 31#include <asm/hardware.h>
33#include <asm/io.h> 32#include <asm/io.h>
33#include <asm/system.h>
34 34
35#define TX_BUFFERS 15 35#define TX_BUFFERS 15
36#define RX_BUFFERS 25 36#define RX_BUFFERS 25
@@ -280,10 +280,13 @@ static void am79c961_timer(unsigned long data)
280 lnkstat = read_ireg(dev->base_addr, ISALED0) & ISALED0_LNKST; 280 lnkstat = read_ireg(dev->base_addr, ISALED0) & ISALED0_LNKST;
281 carrier = netif_carrier_ok(dev); 281 carrier = netif_carrier_ok(dev);
282 282
283 if (lnkstat && !carrier) 283 if (lnkstat && !carrier) {
284 netif_carrier_on(dev); 284 netif_carrier_on(dev);
285 else if (!lnkstat && carrier) 285 printk("%s: link up\n", dev->name);
286 } else if (!lnkstat && carrier) {
286 netif_carrier_off(dev); 287 netif_carrier_off(dev);
288 printk("%s: link down\n", dev->name);
289 }
287 290
288 mod_timer(&priv->timer, jiffies + msecs_to_jiffies(500)); 291 mod_timer(&priv->timer, jiffies + msecs_to_jiffies(500));
289} 292}
@@ -665,17 +668,25 @@ static void __init am79c961_banner(void)
665 printk(KERN_INFO "%s", version); 668 printk(KERN_INFO "%s", version);
666} 669}
667 670
668static int __init am79c961_init(void) 671static int __init am79c961_probe(struct device *_dev)
669{ 672{
673 struct platform_device *pdev = to_platform_device(_dev);
674 struct resource *res;
670 struct net_device *dev; 675 struct net_device *dev;
671 struct dev_priv *priv; 676 struct dev_priv *priv;
672 int i, ret; 677 int i, ret;
673 678
679 res = platform_get_resource(pdev, IORESOURCE_IO, 0);
680 if (!res)
681 return -ENODEV;
682
674 dev = alloc_etherdev(sizeof(struct dev_priv)); 683 dev = alloc_etherdev(sizeof(struct dev_priv));
675 ret = -ENOMEM; 684 ret = -ENOMEM;
676 if (!dev) 685 if (!dev)
677 goto out; 686 goto out;
678 687
688 SET_NETDEV_DEV(dev, &pdev->dev);
689
679 priv = netdev_priv(dev); 690 priv = netdev_priv(dev);
680 691
681 /* 692 /*
@@ -683,8 +694,8 @@ static int __init am79c961_init(void)
683 * The PNP initialisation should have been 694 * The PNP initialisation should have been
684 * done by the ether bootp loader. 695 * done by the ether bootp loader.
685 */ 696 */
686 dev->base_addr = 0x220; 697 dev->base_addr = res->start;
687 dev->irq = IRQ_EBSA110_ETHERNET; 698 dev->irq = platform_get_irq(pdev, 0);
688 699
689 ret = -ENODEV; 700 ret = -ENODEV;
690 if (!request_region(dev->base_addr, 0x18, dev->name)) 701 if (!request_region(dev->base_addr, 0x18, dev->name))
@@ -705,11 +716,11 @@ static int __init am79c961_init(void)
705 inb(dev->base_addr + 4) != 0x2b) 716 inb(dev->base_addr + 4) != 0x2b)
706 goto release; 717 goto release;
707 718
708 am79c961_banner();
709
710 for (i = 0; i < 6; i++) 719 for (i = 0; i < 6; i++)
711 dev->dev_addr[i] = inb(dev->base_addr + i * 2) & 0xff; 720 dev->dev_addr[i] = inb(dev->base_addr + i * 2) & 0xff;
712 721
722 am79c961_banner();
723
713 spin_lock_init(&priv->chip_lock); 724 spin_lock_init(&priv->chip_lock);
714 init_timer(&priv->timer); 725 init_timer(&priv->timer);
715 priv->timer.data = (unsigned long)dev; 726 priv->timer.data = (unsigned long)dev;
@@ -732,6 +743,7 @@ static int __init am79c961_init(void)
732 if (ret == 0) { 743 if (ret == 0) {
733 printk(KERN_INFO "%s: ether address ", dev->name); 744 printk(KERN_INFO "%s: ether address ", dev->name);
734 745
746 /* Retrive and print the ethernet address. */
735 for (i = 0; i < 6; i++) 747 for (i = 0; i < 6; i++)
736 printk (i == 5 ? "%02x\n" : "%02x:", dev->dev_addr[i]); 748 printk (i == 5 ? "%02x\n" : "%02x:", dev->dev_addr[i]);
737 749
@@ -746,4 +758,15 @@ out:
746 return ret; 758 return ret;
747} 759}
748 760
761static struct device_driver am79c961_driver = {
762 .name = "am79c961",
763 .bus = &platform_bus_type,
764 .probe = am79c961_probe,
765};
766
767static int __init am79c961_init(void)
768{
769 return driver_register(&am79c961_driver);
770}
771
749__initcall(am79c961_init); 772__initcall(am79c961_init);
diff --git a/drivers/net/arm/am79c961a.h b/drivers/net/arm/am79c961a.h
index 1e9b05050cbe..6a49ac7f6d46 100644
--- a/drivers/net/arm/am79c961a.h
+++ b/drivers/net/arm/am79c961a.h
@@ -143,6 +143,4 @@ struct dev_priv {
143 struct timer_list timer; 143 struct timer_list timer;
144}; 144};
145 145
146extern int am79c961_probe (struct net_device *dev);
147
148#endif 146#endif