Commit 2f9b0b5e authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

Amiga zorro bus: Add missing zorro_device_remove()

Amiga zorro bus: Add missing zorro_device_remove(). Without this ifconfig and
/proc/net/dev oops after unloading a Zorro network device driver module.
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9e893bb8
...@@ -60,6 +60,20 @@ static int zorro_device_probe(struct device *dev) ...@@ -60,6 +60,20 @@ static int zorro_device_probe(struct device *dev)
} }
static int zorro_device_remove(struct device *dev)
{
struct zorro_dev *z = to_zorro_dev(dev);
struct zorro_driver *drv = to_zorro_driver(dev->driver);
if (drv) {
if (drv->remove)
drv->remove(z);
z->driver = NULL;
}
return 0;
}
/** /**
* zorro_register_driver - register a new Zorro driver * zorro_register_driver - register a new Zorro driver
* @drv: the driver structure to register * @drv: the driver structure to register
...@@ -128,6 +142,7 @@ struct bus_type zorro_bus_type = { ...@@ -128,6 +142,7 @@ struct bus_type zorro_bus_type = {
.name = "zorro", .name = "zorro",
.match = zorro_bus_match, .match = zorro_bus_match,
.probe = zorro_device_probe, .probe = zorro_device_probe,
.remove = zorro_device_remove,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment