Skip to content

Commit

Permalink
Merge branch 'sonic-ethernet-cleanups'
Browse files Browse the repository at this point in the history
Finn Thain says:

====================
Fixes, cleanup and modernization for SONIC ethernet drivers

Changes since v4 of combined patch series:
- Removed redundant and non-portable MACH_IS_MAC tests.
- Omitted patches unrelated to SONIC drivers.
- Dropped changes to the 'version_printed' logic and debug message text.
====================

Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
davem330 committed Feb 26, 2018
2 parents a94cf2a + 995b2a6 commit cb31232
Show file tree
Hide file tree
Showing 5 changed files with 210 additions and 197 deletions.
32 changes: 8 additions & 24 deletions drivers/net/ethernet/natsemi/jazzsonic.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,6 @@ do { \
*((volatile unsigned int *)dev->base_addr+(reg)) = (val); \
} while (0)


/* use 0 for production, 1 for verification, >1 for debug */
#ifdef SONIC_DEBUG
static unsigned int sonic_debug = SONIC_DEBUG;
#else
static unsigned int sonic_debug = 1;
#endif

/*
* We cannot use station (ethernet) address prefixes to detect the
* sonic controller since these are board manufacturer depended.
Expand Down Expand Up @@ -117,7 +109,6 @@ static const struct net_device_ops sonic_netdev_ops = {

static int sonic_probe1(struct net_device *dev)
{
static unsigned version_printed;
unsigned int silicon_revision;
unsigned int val;
struct sonic_local *lp = netdev_priv(dev);
Expand All @@ -133,26 +124,17 @@ static int sonic_probe1(struct net_device *dev)
* the expected location.
*/
silicon_revision = SONIC_READ(SONIC_SR);
if (sonic_debug > 1)
printk("SONIC Silicon Revision = 0x%04x\n",silicon_revision);

i = 0;
while (known_revisions[i] != 0xffff &&
known_revisions[i] != silicon_revision)
i++;

if (known_revisions[i] == 0xffff) {
printk("SONIC ethernet controller not found (0x%4x)\n",
silicon_revision);
pr_info("SONIC ethernet controller not found (0x%4x)\n",
silicon_revision);
goto out;
}

if (sonic_debug && version_printed++ == 0)
printk(version);

printk(KERN_INFO "%s: Sonic ethernet found at 0x%08lx, ",
dev_name(lp->device), dev->base_addr);

/*
* Put the sonic into software reset, then
* retrieve and print the ethernet address.
Expand Down Expand Up @@ -245,12 +227,16 @@ static int jazz_sonic_probe(struct platform_device *pdev)
err = sonic_probe1(dev);
if (err)
goto out;

pr_info("SONIC ethernet @%08lx, MAC %pM, IRQ %d\n",
dev->base_addr, dev->dev_addr, dev->irq);

sonic_msg_init(dev);

err = register_netdev(dev);
if (err)
goto out1;

printk("%s: MAC %pM IRQ %d\n", dev->name, dev->dev_addr, dev->irq);

return 0;

out1:
Expand All @@ -262,8 +248,6 @@ static int jazz_sonic_probe(struct platform_device *pdev)
}

MODULE_DESCRIPTION("Jazz SONIC ethernet driver");
module_param(sonic_debug, int, 0);
MODULE_PARM_DESC(sonic_debug, "jazzsonic debug level (1-4)");
MODULE_ALIAS("platform:jazzsonic");

#include "sonic.c"
Expand Down
Loading

0 comments on commit cb31232

Please sign in to comment.