diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-10-24 03:40:23 -0400 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-10-24 03:40:23 -0400 |
commit | 340601043df518d6f4f82da285c60c785ac8a716 (patch) | |
tree | 251c935b5ab9a805fecd0ca1bf5870e101cac26e | |
parent | 915124d8114ec8c3825b10a39151bf9e851593bb (diff) |
powerpc: Add a shutdown member to vio_driver
Add a shutdown member to struct vio_driver. We also need vio_bus_shutdown()
which converts from struct device to struct vio_dev and knows how to extract
the struct vio_driver.
Original patch adjusted for different location of vio.c.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
-rw-r--r-- | arch/powerpc/kernel/vio.c | 11 | ||||
-rw-r--r-- | include/asm-powerpc/vio.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index 3aec492ec767..97082a4203ad 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c | |||
@@ -69,6 +69,16 @@ static int vio_bus_remove(struct device *dev) | |||
69 | return 1; | 69 | return 1; |
70 | } | 70 | } |
71 | 71 | ||
72 | /* convert from struct device to struct vio_dev and pass to driver. */ | ||
73 | static void vio_bus_shutdown(struct device *dev) | ||
74 | { | ||
75 | struct vio_dev *viodev = to_vio_dev(dev); | ||
76 | struct vio_driver *viodrv = to_vio_driver(dev->driver); | ||
77 | |||
78 | if (viodrv->shutdown) | ||
79 | viodrv->shutdown(viodev); | ||
80 | } | ||
81 | |||
72 | /** | 82 | /** |
73 | * vio_register_driver: - Register a new vio driver | 83 | * vio_register_driver: - Register a new vio driver |
74 | * @drv: The vio_driver structure to be registered. | 84 | * @drv: The vio_driver structure to be registered. |
@@ -82,6 +92,7 @@ int vio_register_driver(struct vio_driver *viodrv) | |||
82 | viodrv->driver.bus = &vio_bus_type; | 92 | viodrv->driver.bus = &vio_bus_type; |
83 | viodrv->driver.probe = vio_bus_probe; | 93 | viodrv->driver.probe = vio_bus_probe; |
84 | viodrv->driver.remove = vio_bus_remove; | 94 | viodrv->driver.remove = vio_bus_remove; |
95 | viodrv->driver.shutdown = vio_bus_shutdown; | ||
85 | 96 | ||
86 | return driver_register(&viodrv->driver); | 97 | return driver_register(&viodrv->driver); |
87 | } | 98 | } |
diff --git a/include/asm-powerpc/vio.h b/include/asm-powerpc/vio.h index 104c58501d0c..e0ccf108277c 100644 --- a/include/asm-powerpc/vio.h +++ b/include/asm-powerpc/vio.h | |||
@@ -58,6 +58,7 @@ struct vio_driver { | |||
58 | const struct vio_device_id *id_table; | 58 | const struct vio_device_id *id_table; |
59 | int (*probe)(struct vio_dev *dev, const struct vio_device_id *id); | 59 | int (*probe)(struct vio_dev *dev, const struct vio_device_id *id); |
60 | int (*remove)(struct vio_dev *dev); | 60 | int (*remove)(struct vio_dev *dev); |
61 | void (*shutdown)(struct vio_dev *dev); | ||
61 | unsigned long driver_data; | 62 | unsigned long driver_data; |
62 | struct device_driver driver; | 63 | struct device_driver driver; |
63 | }; | 64 | }; |