Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+12
+11
arch/powerpc/kernel/vio.c
··· 69 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 83 * vio_register_driver: - Register a new vio driver 74 84 * @drv: The vio_driver structure to be registered. ··· 92 82 viodrv->driver.bus = &vio_bus_type; 93 83 viodrv->driver.probe = vio_bus_probe; 94 84 viodrv->driver.remove = vio_bus_remove; 85 + viodrv->driver.shutdown = vio_bus_shutdown; 95 86 96 87 return driver_register(&viodrv->driver); 97 88 }
+1
include/asm-powerpc/vio.h
··· 58 58 const struct vio_device_id *id_table; 59 59 int (*probe)(struct vio_dev *dev, const struct vio_device_id *id); 60 60 int (*remove)(struct vio_dev *dev); 61 + void (*shutdown)(struct vio_dev *dev); 61 62 unsigned long driver_data; 62 63 struct device_driver driver; 63 64 };