net: convert print_mac to %pM
[deliverable/linux.git] / drivers / net / tokenring / proteon.c
index d04c918ebef811ad60af0bdede6d5d1047ccb446..cd2d62f76079b6710d479e7ab5bbb93c25303072 100644 (file)
@@ -12,7 +12,7 @@
  *     - Proteon 1392, 1392+
  *
  *  Maintainer(s):
- *    AF        Adam Fritzler           mid@auk.cx
+ *    AF        Adam Fritzler
  *    JF       Jochen Friedrich        jochen@scram.de
  *
  *  Modification History:
@@ -126,7 +126,6 @@ static int __init setup_card(struct net_device *dev, struct device *pdev)
        if (!dev)
                return -ENOMEM;
 
-       SET_MODULE_OWNER(dev);
        if (dev->base_addr)     /* probe specific location */
                err = proteon_probe1(dev, dev->base_addr);
        else {
@@ -153,11 +152,8 @@ static int __init setup_card(struct net_device *dev, struct device *pdev)
                
        proteon_read_eeprom(dev);
 
-       printk(KERN_DEBUG "proteon.c:    Ring Station Address: ");
-       printk("%2.2x", dev->dev_addr[0]);
-       for (j = 1; j < 6; j++)
-               printk(":%2.2x", dev->dev_addr[j]);
-       printk("\n");
+       printk(KERN_DEBUG "proteon.c:    Ring Station Address: %pM\n",
+              dev->dev_addr);
                
        tp = netdev_priv(dev);
        tp->setnselout = proteon_setnselout_pins;
@@ -344,9 +340,10 @@ module_param_array(dma, int, NULL, 0);
 
 static struct platform_device *proteon_dev[ISATR_MAX_ADAPTERS];
 
-static struct device_driver proteon_driver = {
-       .name           = "proteon",
-       .bus            = &platform_bus_type,
+static struct platform_driver proteon_driver = {
+       .driver         = {
+               .name   = "proteon",
+       },
 };
 
 static int __init proteon_init(void)
@@ -355,7 +352,7 @@ static int __init proteon_init(void)
        struct platform_device *pdev;
        int i, num = 0, err = 0;
 
-       err = driver_register(&proteon_driver);
+       err = platform_driver_register(&proteon_driver);
        if (err)
                return err;
 
@@ -369,10 +366,14 @@ static int __init proteon_init(void)
                dev->dma = dma[i];
                pdev = platform_device_register_simple("proteon",
                        i, NULL, 0);
+               if (IS_ERR(pdev)) {
+                       free_netdev(dev);
+                       continue;
+               }
                err = setup_card(dev, &pdev->dev);
                if (!err) {
                        proteon_dev[i] = pdev;
-                       dev_set_drvdata(&pdev->dev, dev);
+                       platform_set_drvdata(pdev, dev);
                        ++num;
                } else {
                        platform_device_unregister(pdev);
@@ -384,9 +385,10 @@ static int __init proteon_init(void)
        /* Probe for cards. */
        if (num == 0) {
                printk(KERN_NOTICE "proteon.c: No cards found.\n");
-               return (-ENODEV);
+               platform_driver_unregister(&proteon_driver);
+               return -ENODEV;
        }
-       return (0);
+       return 0;
 }
 
 static void __exit proteon_cleanup(void)
@@ -399,17 +401,17 @@ static void __exit proteon_cleanup(void)
                
                if (!pdev)
                        continue;
-               dev = dev_get_drvdata(&pdev->dev);
+               dev = platform_get_drvdata(pdev);
                unregister_netdev(dev);
                release_region(dev->base_addr, PROTEON_IO_EXTENT);
                free_irq(dev->irq, dev);
                free_dma(dev->dma);
                tmsdev_term(dev);
                free_netdev(dev);
-               dev_set_drvdata(&pdev->dev, NULL);
+               platform_set_drvdata(pdev, NULL);
                platform_device_unregister(pdev);
        }
-       driver_unregister(&proteon_driver);
+       platform_driver_unregister(&proteon_driver);
 }
 
 module_init(proteon_init);
This page took 0.027411 seconds and 5 git commands to generate.