aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tokenring/tms380tr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/tokenring/tms380tr.c')
-rw-r--r--drivers/net/tokenring/tms380tr.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c
index 9a543fe2d0e6..2e39bf1f7462 100644
--- a/drivers/net/tokenring/tms380tr.c
+++ b/drivers/net/tokenring/tms380tr.c
@@ -2333,19 +2333,22 @@ void tmsdev_term(struct net_device *dev)
2333 DMA_BIDIRECTIONAL); 2333 DMA_BIDIRECTIONAL);
2334} 2334}
2335 2335
2336int tmsdev_init(struct net_device *dev, unsigned long dmalimit, 2336int tmsdev_init(struct net_device *dev, struct device *pdev)
2337 struct device *pdev)
2338{ 2337{
2339 struct net_local *tms_local; 2338 struct net_local *tms_local;
2340 2339
2341 memset(dev->priv, 0, sizeof(struct net_local)); 2340 memset(dev->priv, 0, sizeof(struct net_local));
2342 tms_local = netdev_priv(dev); 2341 tms_local = netdev_priv(dev);
2343 init_waitqueue_head(&tms_local->wait_for_tok_int); 2342 init_waitqueue_head(&tms_local->wait_for_tok_int);
2344 tms_local->dmalimit = dmalimit; 2343 if (pdev->dma_mask)
2344 tms_local->dmalimit = *pdev->dma_mask;
2345 else
2346 return -ENOMEM;
2345 tms_local->pdev = pdev; 2347 tms_local->pdev = pdev;
2346 tms_local->dmabuffer = dma_map_single(pdev, (void *)tms_local, 2348 tms_local->dmabuffer = dma_map_single(pdev, (void *)tms_local,
2347 sizeof(struct net_local), DMA_BIDIRECTIONAL); 2349 sizeof(struct net_local), DMA_BIDIRECTIONAL);
2348 if (tms_local->dmabuffer + sizeof(struct net_local) > dmalimit) 2350 if (tms_local->dmabuffer + sizeof(struct net_local) >
2351 tms_local->dmalimit)
2349 { 2352 {
2350 printk(KERN_INFO "%s: Memory not accessible for DMA\n", 2353 printk(KERN_INFO "%s: Memory not accessible for DMA\n",
2351 dev->name); 2354 dev->name);