From f26cd41ae56f3c0ef4521505ad5b6e3940849c33 Mon Sep 17 00:00:00 2001 From: Dave Martin Date: Tue, 13 Sep 2011 00:49:29 +0000 Subject: net/smsc911x: Correctly configure 16-bit register access from DT The SMSC911X_USE_16BIT needs to be set when using 16-bit register access. However, currently no flag is set if the device tree doesn't specify 32-bit access, resulting in a BUG() and a non- working driver when 16-bit register access is configured for smsc911x in the DT. This patch should set the SMSC911X_USE_16BIT flag in a manner consistent with the documented DT bindings. Signed-off-by: Dave Martin Acked-by: Grant Likely Signed-off-by: David S. Miller --- drivers/net/ethernet/smsc/smsc911x.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c index 788c4fdab9c2..a3aa4c0e87f3 100644 --- a/drivers/net/ethernet/smsc/smsc911x.c +++ b/drivers/net/ethernet/smsc/smsc911x.c @@ -2121,6 +2121,8 @@ static int __devinit smsc911x_probe_config_dt( of_property_read_u32(np, "reg-io-width", &width); if (width == 4) config->flags |= SMSC911X_USE_32BIT; + else + config->flags |= SMSC911X_USE_16BIT; if (of_get_property(np, "smsc,irq-active-high", NULL)) config->irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH; -- cgit v1.2.3 From ce43aa6c142d69820a267431ea342d1bd9f6d3ce Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Tue, 13 Sep 2011 07:30:25 +0000 Subject: macmace, macsonic: cleanup We check ether_type before registering the platform device in arch/m68k/mac/config.c. Doing the same test again in the driver is redundant so remove it. Multiple probes should not happen since the conversion to platform devices, so lose that test too. Then macmace.c need not include macintosh.h, so remove that and irq.h and include linux/interrupt.h explicitly. Tested on PowerBook 520, Quadra 660av, LC 630. Signed-off-by: Finn Thain Signed-off-by: David S. Miller --- drivers/net/ethernet/apple/macmace.c | 9 +-------- drivers/net/ethernet/natsemi/macsonic.c | 9 --------- 2 files changed, 1 insertion(+), 17 deletions(-) (limited to 'drivers') diff --git a/drivers/net/ethernet/apple/macmace.c b/drivers/net/ethernet/apple/macmace.c index 6cd3f8646dcd..7cf81bbffe0e 100644 --- a/drivers/net/ethernet/apple/macmace.c +++ b/drivers/net/ethernet/apple/macmace.c @@ -31,9 +31,8 @@ #include #include #include +#include #include -#include -#include #include #include #include @@ -203,14 +202,8 @@ static int __devinit mace_probe(struct platform_device *pdev) unsigned char *addr; struct net_device *dev; unsigned char checksum = 0; - static int found = 0; int err; - if (found || macintosh_config->ether_type != MAC_ETHER_MACE) - return -ENODEV; - - found = 1; /* prevent 'finding' one on every device probe */ - dev = alloc_etherdev(PRIV_BYTES); if (!dev) return -ENOMEM; diff --git a/drivers/net/ethernet/natsemi/macsonic.c b/drivers/net/ethernet/natsemi/macsonic.c index 5c36948e54d7..a2eacbfb4252 100644 --- a/drivers/net/ethernet/natsemi/macsonic.c +++ b/drivers/net/ethernet/natsemi/macsonic.c @@ -313,22 +313,13 @@ static void __devinit mac_onboard_sonic_ethernet_addr(struct net_device *dev) static int __devinit mac_onboard_sonic_probe(struct net_device *dev) { - /* Bwahahaha */ - static int once_is_more_than_enough; struct sonic_local* lp = netdev_priv(dev); int sr; int commslot = 0; - if (once_is_more_than_enough) - return -ENODEV; - once_is_more_than_enough = 1; - if (!MACH_IS_MAC) return -ENODEV; - if (macintosh_config->ether_type != MAC_ETHER_SONIC) - return -ENODEV; - printk(KERN_INFO "Checking for internal Macintosh ethernet (SONIC).. "); /* Bogus probing, on the models which may or may not have -- cgit v1.2.3