Skip to content

Commit

Permalink
[NET] smc91x: add SMC91X_NOWAIT flag to platform data
Browse files Browse the repository at this point in the history
And also favors the usage of SMC91X_NOWAIT over the hardcoded SMC_NOWAIT
by converting "nowait" (module parameter overridable) to platform flag.

There are several possibilities:

  1. platform data present - preferred and use as is
  2. platform data absent  - use "nowait", it can be:
       a. SMC_NOWAIT if defined
       b. default to 0 if SMC_NOWAIT isn't defined
       c. overriden by module parameter

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Acked-by: Nicolas Pitre <nico@cam.org>
Acked-by: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Eric Miao authored and Russell King committed Jul 12, 2008
1 parent fa6d3be commit c4f0e76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/smc91x.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ static void smc_reset(struct net_device *dev)
* can't handle it then there will be no recovery except for
* a hard reset or power cycle
*/
if (nowait)
if (lp->cfg.flags & SMC91X_NOWAIT)
cfg |= CONFIG_NO_WAIT;

/*
Expand Down Expand Up @@ -2160,6 +2160,7 @@ static int smc_drv_probe(struct platform_device *pdev)
lp->cfg.flags |= (SMC_CAN_USE_8BIT) ? SMC91X_USE_8BIT : 0;
lp->cfg.flags |= (SMC_CAN_USE_16BIT) ? SMC91X_USE_16BIT : 0;
lp->cfg.flags |= (SMC_CAN_USE_32BIT) ? SMC91X_USE_32BIT : 0;
lp->cfg.flags |= (nowait) ? SMC91X_NOWAIT : 0;
}

ndev->dma = (unsigned char)-1;
Expand Down
2 changes: 2 additions & 0 deletions include/linux/smc91x.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#define SMC91X_USE_16BIT (1 << 1)
#define SMC91X_USE_32BIT (1 << 2)

#define SMC91X_NOWAIT (1 << 3)

struct smc91x_platdata {
unsigned long flags;
};
Expand Down

0 comments on commit c4f0e76

Please sign in to comment.