]> err.no Git - linux-2.6/commitdiff
[PATCH] Add ecard_bus_type probe/remove/shutdown methods
authorRussell King <rmk@arm.linux.org.uk>
Thu, 5 Jan 2006 14:30:57 +0000 (14:30 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 13 Jan 2006 19:26:05 +0000 (11:26 -0800)
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/arm/kernel/ecard.c

index 96fd91926c9bde875173dab2b95f50dbfe13b69c..74ea29c3205eb6b476a2c725858bf70895f9288f 100644 (file)
@@ -1147,9 +1147,11 @@ static void ecard_drv_shutdown(struct device *dev)
        struct ecard_driver *drv = ECARD_DRV(dev->driver);
        struct ecard_request req;
 
-       if (drv->shutdown)
-               drv->shutdown(ec);
-       ecard_release(ec);
+       if (dev->driver) {
+               if (drv->shutdown)
+                       drv->shutdown(ec);
+               ecard_release(ec);
+       }
 
        /*
         * If this card has a loader, call the reset handler.
@@ -1164,9 +1166,6 @@ static void ecard_drv_shutdown(struct device *dev)
 int ecard_register_driver(struct ecard_driver *drv)
 {
        drv->drv.bus = &ecard_bus_type;
-       drv->drv.probe = ecard_drv_probe;
-       drv->drv.remove = ecard_drv_remove;
-       drv->drv.shutdown = ecard_drv_shutdown;
 
        return driver_register(&drv->drv);
 }
@@ -1195,6 +1194,9 @@ struct bus_type ecard_bus_type = {
        .name           = "ecard",
        .dev_attrs      = ecard_dev_attrs,
        .match          = ecard_match,
+       .probe          = ecard_drv_probe,
+       .remove         = ecard_drv_remove,
+       .shutdown       = ecard_drv_shutdown,
 };
 
 static int ecard_bus_init(void)