aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/ibm/emac/tah.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/ibm/emac/tah.c')
-rw-r--r--drivers/net/ethernet/ibm/emac/tah.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/net/ethernet/ibm/emac/tah.c b/drivers/net/ethernet/ibm/emac/tah.c
index 795f1393e2b6..c231a4a32c4d 100644
--- a/drivers/net/ethernet/ibm/emac/tah.c
+++ b/drivers/net/ethernet/ibm/emac/tah.c
@@ -25,7 +25,7 @@
25 25
26int tah_attach(struct platform_device *ofdev, int channel) 26int tah_attach(struct platform_device *ofdev, int channel)
27{ 27{
28 struct tah_instance *dev = dev_get_drvdata(&ofdev->dev); 28 struct tah_instance *dev = platform_get_drvdata(ofdev);
29 29
30 mutex_lock(&dev->lock); 30 mutex_lock(&dev->lock);
31 /* Reset has been done at probe() time... nothing else to do for now */ 31 /* Reset has been done at probe() time... nothing else to do for now */
@@ -37,7 +37,7 @@ int tah_attach(struct platform_device *ofdev, int channel)
37 37
38void tah_detach(struct platform_device *ofdev, int channel) 38void tah_detach(struct platform_device *ofdev, int channel)
39{ 39{
40 struct tah_instance *dev = dev_get_drvdata(&ofdev->dev); 40 struct tah_instance *dev = platform_get_drvdata(ofdev);
41 41
42 mutex_lock(&dev->lock); 42 mutex_lock(&dev->lock);
43 --dev->users; 43 --dev->users;
@@ -46,7 +46,7 @@ void tah_detach(struct platform_device *ofdev, int channel)
46 46
47void tah_reset(struct platform_device *ofdev) 47void tah_reset(struct platform_device *ofdev)
48{ 48{
49 struct tah_instance *dev = dev_get_drvdata(&ofdev->dev); 49 struct tah_instance *dev = platform_get_drvdata(ofdev);
50 struct tah_regs __iomem *p = dev->base; 50 struct tah_regs __iomem *p = dev->base;
51 int n; 51 int n;
52 52
@@ -74,7 +74,7 @@ int tah_get_regs_len(struct platform_device *ofdev)
74 74
75void *tah_dump_regs(struct platform_device *ofdev, void *buf) 75void *tah_dump_regs(struct platform_device *ofdev, void *buf)
76{ 76{
77 struct tah_instance *dev = dev_get_drvdata(&ofdev->dev); 77 struct tah_instance *dev = platform_get_drvdata(ofdev);
78 struct emac_ethtool_regs_subhdr *hdr = buf; 78 struct emac_ethtool_regs_subhdr *hdr = buf;
79 struct tah_regs *regs = (struct tah_regs *)(hdr + 1); 79 struct tah_regs *regs = (struct tah_regs *)(hdr + 1);
80 80
@@ -118,7 +118,7 @@ static int tah_probe(struct platform_device *ofdev)
118 goto err_free; 118 goto err_free;
119 } 119 }
120 120
121 dev_set_drvdata(&ofdev->dev, dev); 121 platform_set_drvdata(ofdev, dev);
122 122
123 /* Initialize TAH and enable IPv4 checksum verification, no TSO yet */ 123 /* Initialize TAH and enable IPv4 checksum verification, no TSO yet */
124 tah_reset(ofdev); 124 tah_reset(ofdev);
@@ -137,9 +137,7 @@ static int tah_probe(struct platform_device *ofdev)
137 137
138static int tah_remove(struct platform_device *ofdev) 138static int tah_remove(struct platform_device *ofdev)
139{ 139{
140 struct tah_instance *dev = dev_get_drvdata(&ofdev->dev); 140 struct tah_instance *dev = platform_get_drvdata(ofdev);
141
142 dev_set_drvdata(&ofdev->dev, NULL);
143 141
144 WARN_ON(dev->users != 0); 142 WARN_ON(dev->users != 0);
145 143