[CFT 4/29] Add ecard_bus_type probe/remove/shutdown methods

From: Russell King
Date: Thu Jan 05 2006 - 09:30:47 EST


Signed-off-by: Russell King <rmk+kernel@xxxxxxxxxxxxxxxx>

---
arch/arm26/kernel/ecard.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)

diff -up -x BitKeeper -x ChangeSet -x SCCS -x _xlk -x *.orig -x *.rej -x .git linus/arch/arm26/kernel/ecard.c linux/arch/arm26/kernel/ecard.c
--- linus/arch/arm26/kernel/ecard.c Sun Nov 6 22:14:20 2005
+++ linux/arch/arm26/kernel/ecard.c Sun Nov 13 15:52:04 2005
@@ -793,9 +793,11 @@ static void ecard_drv_shutdown(struct de
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);
+ }
req.req = req_reset;
req.ec = ec;
ecard_call(&req);
@@ -804,9 +806,6 @@ static void ecard_drv_shutdown(struct de
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);
}
@@ -832,8 +831,11 @@ static int ecard_match(struct device *_d
}

struct bus_type ecard_bus_type = {
- .name = "ecard",
- .match = ecard_match,
+ .name = "ecard",
+ .match = ecard_match,
+ .probe = ecard_drv_probe,
+ .remove = ecard_drv_remove,
+ .shutdown = ecard_drv_shutdown,
};

static int ecard_bus_init(void)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/