[PATCH] Formatting changes to vio.c

Formatting changes to vio.c to bring it closer to the
kernel coding standard.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

Stephen Rothwell and committed by
Paul Mackerras
5c0b4b87 1e4a79e0

+17 -22
+17 -22
arch/ppc64/kernel/vio.c
··· 37 static void (*unregister_device_callback)(struct vio_dev *dev); 38 static void (*release_device_callback)(struct device *dev); 39 40 - /* convert from struct device to struct vio_dev and pass to driver. 41 * dev->driver has already been set by generic code because vio_bus_match 42 - * succeeded. */ 43 static int vio_bus_probe(struct device *dev) 44 { 45 struct vio_dev *viodev = to_vio_dev(dev); ··· 53 return error; 54 55 id = vio_match_device(viodrv->id_table, viodev); 56 - if (id) { 57 error = viodrv->probe(viodev, id); 58 - } 59 60 return error; 61 } ··· 65 struct vio_dev *viodev = to_vio_dev(dev); 66 struct vio_driver *viodrv = to_vio_driver(dev->driver); 67 68 - if (viodrv->remove) { 69 return viodrv->remove(viodev); 70 - } 71 72 /* driver can't remove */ 73 return 1; ··· 102 EXPORT_SYMBOL(vio_unregister_driver); 103 104 /** 105 - * vio_match_device: - Tell if a VIO device has a matching VIO device id structure. 106 - * @ids: array of VIO device id structures to search in 107 - * @dev: the VIO device structure to match against 108 * 109 * Used by a driver to check whether a VIO device present in the 110 * system is in its list of supported devices. Returns the matching 111 * vio_device_id structure or NULL if there is no match. 112 */ 113 - static const struct vio_device_id * vio_match_device(const struct vio_device_id *ids, 114 - const struct vio_dev *dev) 115 { 116 while (ids->type) { 117 if (is_match(ids, dev)) ··· 142 return err; 143 } 144 145 - /* the fake parent of all vio devices, just to give us 146 * a nice directory 147 */ 148 err = device_register(&vio_bus_device.dev); ··· 164 kfree(to_vio_dev(dev)); 165 } 166 167 - static ssize_t viodev_show_name(struct device *dev, struct device_attribute *attr, char *buf) 168 { 169 return sprintf(buf, "%s\n", to_vio_dev(dev)->name); 170 } ··· 265 const struct vio_dev *vio_dev = to_vio_dev(dev); 266 struct vio_driver *vio_drv = to_vio_driver(drv); 267 const struct vio_device_id *ids = vio_drv->id_table; 268 - const struct vio_device_id *found_id; 269 270 - if (!ids) 271 - return 0; 272 - 273 - found_id = vio_match_device(ids, vio_dev); 274 - if (found_id) 275 - return 1; 276 - 277 - return 0; 278 } 279 280 struct bus_type vio_bus_type = {
··· 37 static void (*unregister_device_callback)(struct vio_dev *dev); 38 static void (*release_device_callback)(struct device *dev); 39 40 + /* 41 + * Convert from struct device to struct vio_dev and pass to driver. 42 * dev->driver has already been set by generic code because vio_bus_match 43 + * succeeded. 44 + */ 45 static int vio_bus_probe(struct device *dev) 46 { 47 struct vio_dev *viodev = to_vio_dev(dev); ··· 51 return error; 52 53 id = vio_match_device(viodrv->id_table, viodev); 54 + if (id) 55 error = viodrv->probe(viodev, id); 56 57 return error; 58 } ··· 64 struct vio_dev *viodev = to_vio_dev(dev); 65 struct vio_driver *viodrv = to_vio_driver(dev->driver); 66 67 + if (viodrv->remove) 68 return viodrv->remove(viodev); 69 70 /* driver can't remove */ 71 return 1; ··· 102 EXPORT_SYMBOL(vio_unregister_driver); 103 104 /** 105 + * vio_match_device: - Tell if a VIO device has a matching 106 + * VIO device id structure. 107 + * @ids: array of VIO device id structures to search in 108 + * @dev: the VIO device structure to match against 109 * 110 * Used by a driver to check whether a VIO device present in the 111 * system is in its list of supported devices. Returns the matching 112 * vio_device_id structure or NULL if there is no match. 113 */ 114 + static const struct vio_device_id *vio_match_device( 115 + const struct vio_device_id *ids, const struct vio_dev *dev) 116 { 117 while (ids->type) { 118 if (is_match(ids, dev)) ··· 141 return err; 142 } 143 144 + /* 145 + * The fake parent of all vio devices, just to give us 146 * a nice directory 147 */ 148 err = device_register(&vio_bus_device.dev); ··· 162 kfree(to_vio_dev(dev)); 163 } 164 165 + static ssize_t viodev_show_name(struct device *dev, 166 + struct device_attribute *attr, char *buf) 167 { 168 return sprintf(buf, "%s\n", to_vio_dev(dev)->name); 169 } ··· 262 const struct vio_dev *vio_dev = to_vio_dev(dev); 263 struct vio_driver *vio_drv = to_vio_driver(drv); 264 const struct vio_device_id *ids = vio_drv->id_table; 265 266 + return (ids != NULL) && (vio_match_device(ids, vio_dev) != NULL); 267 } 268 269 struct bus_type vio_bus_type = {