Skip to content

Commit

Permalink
[S390] cio: Reset sch->driver.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Cornelia Huck authored and Martin Schwidefsky committed Jan 26, 2008
1 parent 602b20f commit 98c13c2
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions drivers/s390/cio/css.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 98c13c2

Please sign in to comment.