aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/css.c
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2008-01-26 08:10:40 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-01-26 08:10:57 -0500
commit98c13c283a4e8b7f844f1f470abd7c756248fcc4 (patch)
treed48ed417849c6dbe938c7e18d93066ec66fb129a /drivers/s390/cio/css.c
parent602b20f2bf335d0d5fce11cb2ade22aa74e7ba25 (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>
Diffstat (limited to 'drivers/s390/cio/css.c')
-rw-r--r--drivers/s390/cio/css.c22
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
799static int 799static int css_probe(struct device *dev)
800css_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
809static int 812static int css_remove(struct device *dev)
810css_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
818static void 823static void css_shutdown(struct device *dev)
819css_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