Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=98c13c283a4e8b7f844f1f470abd7c756248fcc4
Commit:     98c13c283a4e8b7f844f1f470abd7c756248fcc4
Parent:     602b20f2bf335d0d5fce11cb2ade22aa74e7ba25
Author:     Cornelia Huck <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 14:10:40 2008 +0100
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 14:10:57 2008 +0100

    [S390] cio: Reset sch->driver.
    
    sch->driver needs to be reset to NULL on failed probe and after
    remove. We also need to check for sch->driver on shutdown.
    
    Signed-off-by: Cornelia Huck <[EMAIL PROTECTED]>
    Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/cio/css.c |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index 614cc69..f558686 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -796,32 +796,36 @@ css_bus_match (struct device *dev, struct device_driver 
*drv)
        return 0;
 }
 
-static int
-css_probe (struct device *dev)
+static int css_probe(struct device *dev)
 {
        struct subchannel *sch;
+       int ret;
 
        sch = to_subchannel(dev);
        sch->driver = to_cssdriver(dev->driver);
-       return (sch->driver->probe ? sch->driver->probe(sch) : 0);
+       ret = sch->driver->probe ? sch->driver->probe(sch) : 0;
+       if (ret)
+               sch->driver = NULL;
+       return ret;
 }
 
-static int
-css_remove (struct device *dev)
+static int css_remove(struct device *dev)
 {
        struct subchannel *sch;
+       int ret;
 
        sch = to_subchannel(dev);
-       return (sch->driver->remove ? sch->driver->remove(sch) : 0);
+       ret = sch->driver->remove ? sch->driver->remove(sch) : 0;
+       sch->driver = NULL;
+       return ret;
 }
 
-static void
-css_shutdown (struct device *dev)
+static void css_shutdown(struct device *dev)
 {
        struct subchannel *sch;
 
        sch = to_subchannel(dev);
-       if (sch->driver->shutdown)
+       if (sch->driver && sch->driver->shutdown)
                sch->driver->shutdown(sch);
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to