Commit 2f9b0b5e46f0381fd41af8cb9ed4daffee59d4f3
Committed by
Linus Torvalds
1 parent
9e893bb853
Exists in
master
and in
4 other branches
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: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 1 changed file with 15 additions and 0 deletions Side-by-side Diff
drivers/zorro/zorro-driver.c
... | ... | @@ -60,6 +60,20 @@ |
60 | 60 | } |
61 | 61 | |
62 | 62 | |
63 | +static int zorro_device_remove(struct device *dev) | |
64 | +{ | |
65 | + struct zorro_dev *z = to_zorro_dev(dev); | |
66 | + struct zorro_driver *drv = to_zorro_driver(dev->driver); | |
67 | + | |
68 | + if (drv) { | |
69 | + if (drv->remove) | |
70 | + drv->remove(z); | |
71 | + z->driver = NULL; | |
72 | + } | |
73 | + return 0; | |
74 | +} | |
75 | + | |
76 | + | |
63 | 77 | /** |
64 | 78 | * zorro_register_driver - register a new Zorro driver |
65 | 79 | * @drv: the driver structure to register |
... | ... | @@ -128,6 +142,7 @@ |
128 | 142 | .name = "zorro", |
129 | 143 | .match = zorro_bus_match, |
130 | 144 | .probe = zorro_device_probe, |
145 | + .remove = zorro_device_remove, | |
131 | 146 | }; |
132 | 147 | |
133 | 148 |