aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dm9000.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-11-11 12:24:26 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-11 12:24:26 -0500
commit5643f000c1e10ab991182478b76550e1364c3570 (patch)
tree950b2f61a5dd742de1c668ba968a9c8a99f1eab6 /drivers/net/dm9000.c
parent177294d19174cf92de22434bb1fc9a8ecdbbe658 (diff)
parent3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (diff)
Merge master.kernel.org:/home/rmk/linux-2.6-drvmodel
Diffstat (limited to 'drivers/net/dm9000.c')
-rw-r--r--drivers/net/dm9000.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index f8c9bcdab68b..24996da4c1c4 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -148,7 +148,7 @@ typedef struct board_info {
148} board_info_t; 148} board_info_t;
149 149
150/* function declaration ------------------------------------- */ 150/* function declaration ------------------------------------- */
151static int dm9000_probe(struct device *); 151static int dm9000_probe(struct platform_device *);
152static int dm9000_open(struct net_device *); 152static int dm9000_open(struct net_device *);
153static int dm9000_start_xmit(struct sk_buff *, struct net_device *); 153static int dm9000_start_xmit(struct sk_buff *, struct net_device *);
154static int dm9000_stop(struct net_device *); 154static int dm9000_stop(struct net_device *);
@@ -378,9 +378,8 @@ dm9000_release_board(struct platform_device *pdev, struct board_info *db)
378 * Search DM9000 board, allocate space and register it 378 * Search DM9000 board, allocate space and register it
379 */ 379 */
380static int 380static int
381dm9000_probe(struct device *dev) 381dm9000_probe(struct platform_device *pdev)
382{ 382{
383 struct platform_device *pdev = to_platform_device(dev);
384 struct dm9000_plat_data *pdata = pdev->dev.platform_data; 383 struct dm9000_plat_data *pdata = pdev->dev.platform_data;
385 struct board_info *db; /* Point a board information structure */ 384 struct board_info *db; /* Point a board information structure */
386 struct net_device *ndev; 385 struct net_device *ndev;
@@ -398,7 +397,7 @@ dm9000_probe(struct device *dev)
398 } 397 }
399 398
400 SET_MODULE_OWNER(ndev); 399 SET_MODULE_OWNER(ndev);
401 SET_NETDEV_DEV(ndev, dev); 400 SET_NETDEV_DEV(ndev, &pdev->dev);
402 401
403 PRINTK2("dm9000_probe()"); 402 PRINTK2("dm9000_probe()");
404 403
@@ -569,7 +568,7 @@ dm9000_probe(struct device *dev)
569 printk("%s: Invalid ethernet MAC address. Please " 568 printk("%s: Invalid ethernet MAC address. Please "
570 "set using ifconfig\n", ndev->name); 569 "set using ifconfig\n", ndev->name);
571 570
572 dev_set_drvdata(dev, ndev); 571 platform_set_drvdata(pdev, ndev);
573 ret = register_netdev(ndev); 572 ret = register_netdev(ndev);
574 573
575 if (ret == 0) { 574 if (ret == 0) {
@@ -1140,9 +1139,9 @@ dm9000_phy_write(struct net_device *dev, int phyaddr_unused, int reg, int value)
1140} 1139}
1141 1140
1142static int 1141static int
1143dm9000_drv_suspend(struct device *dev, pm_message_t state) 1142dm9000_drv_suspend(struct platform_device *dev, pm_message_t state)
1144{ 1143{
1145 struct net_device *ndev = dev_get_drvdata(dev); 1144 struct net_device *ndev = platform_get_drvdata(dev);
1146 1145
1147 if (ndev) { 1146 if (ndev) {
1148 if (netif_running(ndev)) { 1147 if (netif_running(ndev)) {
@@ -1154,9 +1153,9 @@ dm9000_drv_suspend(struct device *dev, pm_message_t state)
1154} 1153}
1155 1154
1156static int 1155static int
1157dm9000_drv_resume(struct device *dev) 1156dm9000_drv_resume(struct platform_device *dev)
1158{ 1157{
1159 struct net_device *ndev = dev_get_drvdata(dev); 1158 struct net_device *ndev = platform_get_drvdata(dev);
1160 board_info_t *db = (board_info_t *) ndev->priv; 1159 board_info_t *db = (board_info_t *) ndev->priv;
1161 1160
1162 if (ndev) { 1161 if (ndev) {
@@ -1172,12 +1171,11 @@ dm9000_drv_resume(struct device *dev)
1172} 1171}
1173 1172
1174static int 1173static int
1175dm9000_drv_remove(struct device *dev) 1174dm9000_drv_remove(struct platform_device *pdev)
1176{ 1175{
1177 struct platform_device *pdev = to_platform_device(dev); 1176 struct net_device *ndev = platform_get_drvdata(pdev);
1178 struct net_device *ndev = dev_get_drvdata(dev);
1179 1177
1180 dev_set_drvdata(dev, NULL); 1178 platform_set_drvdata(pdev, NULL);
1181 1179
1182 unregister_netdev(ndev); 1180 unregister_netdev(ndev);
1183 dm9000_release_board(pdev, (board_info_t *) ndev->priv); 1181 dm9000_release_board(pdev, (board_info_t *) ndev->priv);
@@ -1188,13 +1186,14 @@ dm9000_drv_remove(struct device *dev)
1188 return 0; 1186 return 0;
1189} 1187}
1190 1188
1191static struct device_driver dm9000_driver = { 1189static struct platform_driver dm9000_driver = {
1192 .name = "dm9000",
1193 .bus = &platform_bus_type,
1194 .probe = dm9000_probe, 1190 .probe = dm9000_probe,
1195 .remove = dm9000_drv_remove, 1191 .remove = dm9000_drv_remove,
1196 .suspend = dm9000_drv_suspend, 1192 .suspend = dm9000_drv_suspend,
1197 .resume = dm9000_drv_resume, 1193 .resume = dm9000_drv_resume,
1194 .driver = {
1195 .name = "dm9000",
1196 },
1198}; 1197};
1199 1198
1200static int __init 1199static int __init
@@ -1202,13 +1201,13 @@ dm9000_init(void)
1202{ 1201{
1203 printk(KERN_INFO "%s Ethernet Driver\n", CARDNAME); 1202 printk(KERN_INFO "%s Ethernet Driver\n", CARDNAME);
1204 1203
1205 return driver_register(&dm9000_driver); /* search board and register */ 1204 return platform_driver_register(&dm9000_driver); /* search board and register */
1206} 1205}
1207 1206
1208static void __exit 1207static void __exit
1209dm9000_cleanup(void) 1208dm9000_cleanup(void)
1210{ 1209{
1211 driver_unregister(&dm9000_driver); 1210 platform_driver_unregister(&dm9000_driver);
1212} 1211}
1213 1212
1214module_init(dm9000_init); 1213module_init(dm9000_init);