diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2008-01-26 08:10:40 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-01-26 08:10:57 -0500 |
commit | 98c13c283a4e8b7f844f1f470abd7c756248fcc4 (patch) | |
tree | d48ed417849c6dbe938c7e18d93066ec66fb129a | |
parent | 602b20f2bf335d0d5fce11cb2ade22aa74e7ba25 (diff) |
[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 <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | 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 614cc694184e..f558686a66dd 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) | |||
796 | return 0; | 796 | return 0; |
797 | } | 797 | } |
798 | 798 | ||
799 | static int | 799 | static int css_probe(struct device *dev) |
800 | css_probe (struct device *dev) | ||
801 | { | 800 | { |
802 | struct subchannel *sch; | 801 | struct subchannel *sch; |
802 | int ret; | ||
803 | 803 | ||
804 | sch = to_subchannel(dev); | 804 | sch = to_subchannel(dev); |
805 | sch->driver = to_cssdriver(dev->driver); | 805 | sch->driver = to_cssdriver(dev->driver); |
806 | return (sch->driver->probe ? sch->driver->probe(sch) : 0); | 806 | ret = sch->driver->probe ? sch->driver->probe(sch) : 0; |
807 | if (ret) | ||
808 | sch->driver = NULL; | ||
809 | return ret; | ||
807 | } | 810 | } |
808 | 811 | ||
809 | static int | 812 | static int css_remove(struct device *dev) |
810 | css_remove (struct device *dev) | ||
811 | { | 813 | { |
812 | struct subchannel *sch; | 814 | struct subchannel *sch; |
815 | int ret; | ||
813 | 816 | ||
814 | sch = to_subchannel(dev); | 817 | sch = to_subchannel(dev); |
815 | return (sch->driver->remove ? sch->driver->remove(sch) : 0); | 818 | ret = sch->driver->remove ? sch->driver->remove(sch) : 0; |
819 | sch->driver = NULL; | ||
820 | return ret; | ||
816 | } | 821 | } |
817 | 822 | ||
818 | static void | 823 | static void css_shutdown(struct device *dev) |
819 | css_shutdown (struct device *dev) | ||
820 | { | 824 | { |
821 | struct subchannel *sch; | 825 | struct subchannel *sch; |
822 | 826 | ||
823 | sch = to_subchannel(dev); | 827 | sch = to_subchannel(dev); |
824 | if (sch->driver->shutdown) | 828 | if (sch->driver && sch->driver->shutdown) |
825 | sch->driver->shutdown(sch); | 829 | sch->driver->shutdown(sch); |
826 | } | 830 | } |
827 | 831 | ||