diff options
author | Magnus Damm <magnus.damm@gmail.com> | 2008-06-09 19:33:55 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-06-11 21:58:11 -0400 |
commit | 12c03f59c3909159010b87a926f5626d4380d441 (patch) | |
tree | 3b1b210b33f55697833ef44dec10b8d73912a99b /drivers/net/smc911x.c | |
parent | 699559f84bee8b630c1d16fe1bc8e9667d170d65 (diff) |
smc911x: introduce platform data flags
This patch adds a new header file for platform data information
together with code that adds run time bus width and irq flag support.
Signed-off-by: Magnus Damm <damm@igel.co.jp>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/smc911x.c')
-rw-r--r-- | drivers/net/smc911x.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index 2ca4db85f938..fc605f276c00 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c | |||
@@ -1819,6 +1819,7 @@ static int __init smc911x_probe(struct net_device *dev) | |||
1819 | int i, retval; | 1819 | int i, retval; |
1820 | unsigned int val, chip_id, revision; | 1820 | unsigned int val, chip_id, revision; |
1821 | const char *version_string; | 1821 | const char *version_string; |
1822 | unsigned long irq_flags; | ||
1822 | 1823 | ||
1823 | DBG(SMC_DEBUG_FUNC, "%s: --> %s\n", dev->name, __FUNCTION__); | 1824 | DBG(SMC_DEBUG_FUNC, "%s: --> %s\n", dev->name, __FUNCTION__); |
1824 | 1825 | ||
@@ -1985,9 +1986,15 @@ static int __init smc911x_probe(struct net_device *dev) | |||
1985 | lp->ctl_rfduplx = 1; | 1986 | lp->ctl_rfduplx = 1; |
1986 | lp->ctl_rspeed = 100; | 1987 | lp->ctl_rspeed = 100; |
1987 | 1988 | ||
1989 | #ifdef SMC_DYNAMIC_BUS_CONFIG | ||
1990 | irq_flags = lp->cfg.irq_flags; | ||
1991 | #else | ||
1992 | irq_flags = IRQF_SHARED | SMC_IRQ_SENSE; | ||
1993 | #endif | ||
1994 | |||
1988 | /* Grab the IRQ */ | 1995 | /* Grab the IRQ */ |
1989 | retval = request_irq(dev->irq, &smc911x_interrupt, | 1996 | retval = request_irq(dev->irq, &smc911x_interrupt, |
1990 | IRQF_SHARED | SMC_IRQ_SENSE, dev->name, dev); | 1997 | irq_flags, dev->name, dev); |
1991 | if (retval) | 1998 | if (retval) |
1992 | goto err_out; | 1999 | goto err_out; |
1993 | 2000 | ||
@@ -2057,6 +2064,7 @@ err_out: | |||
2057 | */ | 2064 | */ |
2058 | static int smc911x_drv_probe(struct platform_device *pdev) | 2065 | static int smc911x_drv_probe(struct platform_device *pdev) |
2059 | { | 2066 | { |
2067 | struct smc91x_platdata *pd = pdev->dev.platform_data; | ||
2060 | struct net_device *ndev; | 2068 | struct net_device *ndev; |
2061 | struct resource *res; | 2069 | struct resource *res; |
2062 | struct smc911x_local *lp; | 2070 | struct smc911x_local *lp; |
@@ -2090,6 +2098,13 @@ static int smc911x_drv_probe(struct platform_device *pdev) | |||
2090 | ndev->irq = platform_get_irq(pdev, 0); | 2098 | ndev->irq = platform_get_irq(pdev, 0); |
2091 | lp = netdev_priv(ndev); | 2099 | lp = netdev_priv(ndev); |
2092 | lp->netdev = ndev; | 2100 | lp->netdev = ndev; |
2101 | #ifdef SMC_DYNAMIC_BUS_CONFIG | ||
2102 | if (!pd) { | ||
2103 | ret = -EINVAL; | ||
2104 | goto release_both; | ||
2105 | } | ||
2106 | memcpy(&lp->cfg, pd, sizeof(lp->cfg)); | ||
2107 | #endif | ||
2093 | 2108 | ||
2094 | addr = ioremap(res->start, SMC911X_IO_EXTENT); | 2109 | addr = ioremap(res->start, SMC911X_IO_EXTENT); |
2095 | if (!addr) { | 2110 | if (!addr) { |