Commit 4e95347b authored by David Kershner's avatar David Kershner Committed by Greg Kroah-Hartman

staging: unisys: visorbus: visorbus_main.c: remove blank lines

Removes several extraneous blank lines in visorbus_main.c.
Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
Reviewed-by: default avatarTim Sell <timothy.sell@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9116ae7a
...@@ -122,7 +122,6 @@ static int visorbus_uevent(struct device *xdev, struct kobj_uevent_env *env) ...@@ -122,7 +122,6 @@ static int visorbus_uevent(struct device *xdev, struct kobj_uevent_env *env)
dev = to_visor_device(xdev); dev = to_visor_device(xdev);
guid = visorchannel_get_guid(dev->visorchannel); guid = visorchannel_get_guid(dev->visorchannel);
return add_uevent_var(env, "MODALIAS=visorbus:%pUl", guid); return add_uevent_var(env, "MODALIAS=visorbus:%pUl", guid);
} }
...@@ -147,11 +146,9 @@ static int visorbus_match(struct device *xdev, struct device_driver *xdrv) ...@@ -147,11 +146,9 @@ static int visorbus_match(struct device *xdev, struct device_driver *xdrv)
drv = to_visor_driver(xdrv); drv = to_visor_driver(xdrv);
if (!drv->channel_types) if (!drv->channel_types)
return 0; return 0;
for (i = 0; !guid_is_null(&drv->channel_types[i].guid); i++) for (i = 0; !guid_is_null(&drv->channel_types[i].guid); i++)
if (guid_equal(&drv->channel_types[i].guid, channel_type)) if (guid_equal(&drv->channel_types[i].guid, channel_type))
return i + 1; return i + 1;
return 0; return 0;
} }
...@@ -288,7 +285,6 @@ ATTRIBUTE_GROUPS(channel); ...@@ -288,7 +285,6 @@ ATTRIBUTE_GROUPS(channel);
* define & implement display of bus attributes under * define & implement display of bus attributes under
* /sys/bus/visorbus/devices/visorbus<n>. * /sys/bus/visorbus/devices/visorbus<n>.
*/ */
static ssize_t partition_handle_show(struct device *dev, static ssize_t partition_handle_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
...@@ -346,7 +342,6 @@ static ssize_t channel_id_show(struct device *dev, ...@@ -346,7 +342,6 @@ static ssize_t channel_id_show(struct device *dev,
visorchannel_id(vdev->visorchannel, buf); visorchannel_id(vdev->visorchannel, buf);
len = strlen(buf); len = strlen(buf);
buf[len++] = '\n'; buf[len++] = '\n';
return len; return len;
} }
static DEVICE_ATTR_RO(channel_id); static DEVICE_ATTR_RO(channel_id);
...@@ -386,13 +381,11 @@ static void vbuschannel_print_devinfo(struct visor_vbus_deviceinfo *devinfo, ...@@ -386,13 +381,11 @@ static void vbuschannel_print_devinfo(struct visor_vbus_deviceinfo *devinfo,
/* uninitialized vbus device entry */ /* uninitialized vbus device entry */
if (!isprint(devinfo->devtype[0])) if (!isprint(devinfo->devtype[0]))
return; return;
if (devix >= 0) if (devix >= 0)
seq_printf(seq, "[%d]", devix); seq_printf(seq, "[%d]", devix);
else else
/* vbus device entry is for bus or chipset */ /* vbus device entry is for bus or chipset */
seq_puts(seq, " "); seq_puts(seq, " ");
/* /*
* Note: because the s-Par back-end is free to scribble in this area, * Note: because the s-Par back-end is free to scribble in this area,
* we never assume '\0'-termination. * we never assume '\0'-termination.
...@@ -420,7 +413,6 @@ static int bus_info_debugfs_show(struct seq_file *seq, void *v) ...@@ -420,7 +413,6 @@ static int bus_info_debugfs_show(struct seq_file *seq, void *v)
"Client device/driver info for %s partition (vbus #%u):\n", "Client device/driver info for %s partition (vbus #%u):\n",
((vdev->name) ? (char *)(vdev->name) : ""), ((vdev->name) ? (char *)(vdev->name) : ""),
vdev->chipset_bus_no); vdev->chipset_bus_no);
if (visorchannel_read(channel, if (visorchannel_read(channel,
offsetof(struct visor_vbus_channel, chp_info), offsetof(struct visor_vbus_channel, chp_info),
&dev_info, sizeof(dev_info)) >= 0) &dev_info, sizeof(dev_info)) >= 0)
...@@ -438,7 +430,6 @@ static int bus_info_debugfs_show(struct seq_file *seq, void *v) ...@@ -438,7 +430,6 @@ static int bus_info_debugfs_show(struct seq_file *seq, void *v)
off += sizeof(dev_info); off += sizeof(dev_info);
i++; i++;
} }
return 0; return 0;
} }
...@@ -468,6 +459,7 @@ static int dev_start_periodic_work(struct visor_device *dev) ...@@ -468,6 +459,7 @@ static int dev_start_periodic_work(struct visor_device *dev)
{ {
if (dev->being_removed || dev->timer_active) if (dev->being_removed || dev->timer_active)
return -EINVAL; return -EINVAL;
/* now up by at least 2 */ /* now up by at least 2 */
get_device(&dev->device); get_device(&dev->device);
dev->timer.expires = jiffies + POLLJIFFIES_NORMALCHANNEL; dev->timer.expires = jiffies + POLLJIFFIES_NORMALCHANNEL;
...@@ -480,6 +472,7 @@ static void dev_stop_periodic_work(struct visor_device *dev) ...@@ -480,6 +472,7 @@ static void dev_stop_periodic_work(struct visor_device *dev)
{ {
if (!dev->timer_active) if (!dev->timer_active)
return; return;
del_timer_sync(&dev->timer); del_timer_sync(&dev->timer);
dev->timer_active = false; dev->timer_active = false;
put_device(&dev->device); put_device(&dev->device);
...@@ -507,10 +500,8 @@ static int visordriver_remove_device(struct device *xdev) ...@@ -507,10 +500,8 @@ static int visordriver_remove_device(struct device *xdev)
dev->being_removed = true; dev->being_removed = true;
drv->remove(dev); drv->remove(dev);
mutex_unlock(&dev->visordriver_callback_lock); mutex_unlock(&dev->visordriver_callback_lock);
dev_stop_periodic_work(dev); dev_stop_periodic_work(dev);
put_device(&dev->device); put_device(&dev->device);
return 0; return 0;
} }
...@@ -633,7 +624,6 @@ int create_visor_device(struct visor_device *dev) ...@@ -633,7 +624,6 @@ int create_visor_device(struct visor_device *dev)
/* keep a reference just for us (now 2) */ /* keep a reference just for us (now 2) */
get_device(&dev->device); get_device(&dev->device);
setup_timer(&dev->timer, dev_periodic_work, (unsigned long)dev); setup_timer(&dev->timer, dev_periodic_work, (unsigned long)dev);
/* /*
* bus_id must be a unique name with respect to this bus TYPE (NOT bus * bus_id must be a unique name with respect to this bus TYPE (NOT bus
* instance). That's why we need to include the bus number within the * instance). That's why we need to include the bus number within the
...@@ -643,7 +633,6 @@ int create_visor_device(struct visor_device *dev) ...@@ -643,7 +633,6 @@ int create_visor_device(struct visor_device *dev)
chipset_bus_no, chipset_dev_no); chipset_bus_no, chipset_dev_no);
if (err) if (err)
goto err_put; goto err_put;
/* /*
* device_add does this: * device_add does this:
* bus_add_device(dev) * bus_add_device(dev)
...@@ -664,7 +653,6 @@ int create_visor_device(struct visor_device *dev) ...@@ -664,7 +653,6 @@ int create_visor_device(struct visor_device *dev)
err = device_add(&dev->device); err = device_add(&dev->device);
if (err < 0) if (err < 0)
goto err_put; goto err_put;
list_add_tail(&dev->list_all, &list_all_device_instances); list_add_tail(&dev->list_all, &list_all_device_instances);
dev->state.created = 1; dev->state.created = 1;
visorbus_response(dev, err, CONTROLVM_DEVICE_CREATE); visorbus_response(dev, err, CONTROLVM_DEVICE_CREATE);
...@@ -705,14 +693,11 @@ static int get_vbus_header_info(struct visorchannel *chan, ...@@ -705,14 +693,11 @@ static int get_vbus_header_info(struct visorchannel *chan,
sizeof(*hdr_info)); sizeof(*hdr_info));
if (err < 0) if (err < 0)
return err; return err;
if (hdr_info->struct_bytes < sizeof(struct visor_vbus_headerinfo)) if (hdr_info->struct_bytes < sizeof(struct visor_vbus_headerinfo))
return -EINVAL; return -EINVAL;
if (hdr_info->device_info_struct_bytes < if (hdr_info->device_info_struct_bytes <
sizeof(struct visor_vbus_deviceinfo)) sizeof(struct visor_vbus_deviceinfo))
return -EINVAL; return -EINVAL;
return 0; return 0;
} }
...@@ -763,6 +748,7 @@ static void write_vbus_bus_info(struct visorchannel *chan, ...@@ -763,6 +748,7 @@ static void write_vbus_bus_info(struct visorchannel *chan,
if (hdr_info->bus_info_offset == 0) if (hdr_info->bus_info_offset == 0)
return; return;
off = sizeof(struct channel_header) + hdr_info->bus_info_offset; off = sizeof(struct channel_header) + hdr_info->bus_info_offset;
visorchannel_write(chan, off, info, sizeof(*info)); visorchannel_write(chan, off, info, sizeof(*info));
} }
...@@ -831,7 +817,6 @@ static void publish_vbus_dev_info(struct visor_device *visordev) ...@@ -831,7 +817,6 @@ static void publish_vbus_dev_info(struct visor_device *visordev)
if (!visordev->device.driver) if (!visordev->device.driver)
return; return;
bdev = visorbus_get_device_by_id(bus_no, BUS_ROOT_DEVICE, NULL); bdev = visorbus_get_device_by_id(bus_no, BUS_ROOT_DEVICE, NULL);
if (!bdev) if (!bdev)
return; return;
...@@ -853,7 +838,6 @@ static void publish_vbus_dev_info(struct visor_device *visordev) ...@@ -853,7 +838,6 @@ static void publish_vbus_dev_info(struct visor_device *visordev)
break; break;
} }
} }
bus_device_info_init(&dev_info, chan_type_name, visordrv->name); bus_device_info_init(&dev_info, chan_type_name, visordrv->name);
write_vbus_dev_info(bdev->visorchannel, hdr_info, &dev_info, dev_no); write_vbus_dev_info(bdev->visorchannel, hdr_info, &dev_info, dev_no);
write_vbus_chp_info(bdev->visorchannel, hdr_info, &chipset_driverinfo); write_vbus_chp_info(bdev->visorchannel, hdr_info, &chipset_driverinfo);
...@@ -887,13 +871,11 @@ static int visordriver_probe_device(struct device *xdev) ...@@ -887,13 +871,11 @@ static int visordriver_probe_device(struct device *xdev)
mutex_lock(&dev->visordriver_callback_lock); mutex_lock(&dev->visordriver_callback_lock);
dev->being_removed = false; dev->being_removed = false;
err = drv->probe(dev); err = drv->probe(dev);
if (err) { if (err) {
mutex_unlock(&dev->visordriver_callback_lock); mutex_unlock(&dev->visordriver_callback_lock);
return err; return err;
} }
/* success: reference kept via unmatched get_device() */ /* success: reference kept via unmatched get_device() */
get_device(&dev->device); get_device(&dev->device);
publish_vbus_dev_info(dev); publish_vbus_dev_info(dev);
...@@ -954,16 +936,12 @@ int visorbus_register_visor_driver(struct visor_driver *drv) ...@@ -954,16 +936,12 @@ int visorbus_register_visor_driver(struct visor_driver *drv)
/* can't register on a nonexistent bus */ /* can't register on a nonexistent bus */
if (!initialized) if (!initialized)
return -ENODEV; return -ENODEV;
if (!drv->probe) if (!drv->probe)
return -EINVAL; return -EINVAL;
if (!drv->remove) if (!drv->remove)
return -EINVAL; return -EINVAL;
if (!drv->pause) if (!drv->pause)
return -EINVAL; return -EINVAL;
if (!drv->resume) if (!drv->resume)
return -EINVAL; return -EINVAL;
...@@ -972,7 +950,6 @@ int visorbus_register_visor_driver(struct visor_driver *drv) ...@@ -972,7 +950,6 @@ int visorbus_register_visor_driver(struct visor_driver *drv)
drv->driver.probe = visordriver_probe_device; drv->driver.probe = visordriver_probe_device;
drv->driver.remove = visordriver_remove_device; drv->driver.remove = visordriver_remove_device;
drv->driver.owner = drv->owner; drv->driver.owner = drv->owner;
/* /*
* driver_register does this: * driver_register does this:
* bus_add_driver(drv) * bus_add_driver(drv)
...@@ -985,7 +962,6 @@ int visorbus_register_visor_driver(struct visor_driver *drv) ...@@ -985,7 +962,6 @@ int visorbus_register_visor_driver(struct visor_driver *drv)
* if (!drv.probe(dev)) [visordriver_probe_device] * if (!drv.probe(dev)) [visordriver_probe_device]
* dev.drv = NULL * dev.drv = NULL
*/ */
return driver_register(&drv->driver); return driver_register(&drv->driver);
} }
EXPORT_SYMBOL_GPL(visorbus_register_visor_driver); EXPORT_SYMBOL_GPL(visorbus_register_visor_driver);
...@@ -1006,12 +982,10 @@ int visorbus_create_instance(struct visor_device *dev) ...@@ -1006,12 +982,10 @@ int visorbus_create_instance(struct visor_device *dev)
hdr_info = kzalloc(sizeof(*hdr_info), GFP_KERNEL); hdr_info = kzalloc(sizeof(*hdr_info), GFP_KERNEL);
if (!hdr_info) if (!hdr_info)
return -ENOMEM; return -ENOMEM;
dev_set_name(&dev->device, "visorbus%d", id); dev_set_name(&dev->device, "visorbus%d", id);
dev->device.bus = &visorbus_type; dev->device.bus = &visorbus_type;
dev->device.groups = visorbus_groups; dev->device.groups = visorbus_groups;
dev->device.release = visorbus_release_busdevice; dev->device.release = visorbus_release_busdevice;
dev->debugfs_dir = debugfs_create_dir(dev_name(&dev->device), dev->debugfs_dir = debugfs_create_dir(dev_name(&dev->device),
visorbus_debugfs_dir); visorbus_debugfs_dir);
dev->debugfs_bus_info = debugfs_create_file("client_bus_info", 0440, dev->debugfs_bus_info = debugfs_create_file("client_bus_info", 0440,
...@@ -1021,20 +995,15 @@ int visorbus_create_instance(struct visor_device *dev) ...@@ -1021,20 +995,15 @@ int visorbus_create_instance(struct visor_device *dev)
err = get_vbus_header_info(dev->visorchannel, &dev->device, hdr_info); err = get_vbus_header_info(dev->visorchannel, &dev->device, hdr_info);
if (err < 0) if (err < 0)
goto err_debugfs_dir; goto err_debugfs_dir;
err = device_register(&dev->device); err = device_register(&dev->device);
if (err < 0) if (err < 0)
goto err_debugfs_dir; goto err_debugfs_dir;
list_add_tail(&dev->list_all, &list_all_bus_instances); list_add_tail(&dev->list_all, &list_all_bus_instances);
dev->state.created = 1; dev->state.created = 1;
dev->vbus_hdr_info = (void *)hdr_info; dev->vbus_hdr_info = (void *)hdr_info;
write_vbus_chp_info(dev->visorchannel, hdr_info, &chipset_driverinfo); write_vbus_chp_info(dev->visorchannel, hdr_info, &chipset_driverinfo);
write_vbus_bus_info(dev->visorchannel, hdr_info, &clientbus_driverinfo); write_vbus_bus_info(dev->visorchannel, hdr_info, &clientbus_driverinfo);
visorbus_response(dev, err, CONTROLVM_BUS_CREATE); visorbus_response(dev, err, CONTROLVM_BUS_CREATE);
return 0; return 0;
err_debugfs_dir: err_debugfs_dir:
...@@ -1199,7 +1168,6 @@ int visorchipset_device_resume(struct visor_device *dev_info) ...@@ -1199,7 +1168,6 @@ int visorchipset_device_resume(struct visor_device *dev_info)
dev_info->resuming = false; dev_info->resuming = false;
return err; return err;
} }
return 0; return 0;
} }
...@@ -1210,16 +1178,12 @@ int visorbus_init(void) ...@@ -1210,16 +1178,12 @@ int visorbus_init(void)
visorbus_debugfs_dir = debugfs_create_dir("visorbus", NULL); visorbus_debugfs_dir = debugfs_create_dir("visorbus", NULL);
if (!visorbus_debugfs_dir) if (!visorbus_debugfs_dir)
return -ENOMEM; return -ENOMEM;
bus_device_info_init(&clientbus_driverinfo, "clientbus", "visorbus"); bus_device_info_init(&clientbus_driverinfo, "clientbus", "visorbus");
err = bus_register(&visorbus_type); err = bus_register(&visorbus_type);
if (err < 0) if (err < 0)
return err; return err;
initialized = true; initialized = true;
bus_device_info_init(&chipset_driverinfo, "chipset", "visorchipset"); bus_device_info_init(&chipset_driverinfo, "chipset", "visorchipset");
return 0; return 0;
} }
...@@ -1228,14 +1192,12 @@ void visorbus_exit(void) ...@@ -1228,14 +1192,12 @@ void visorbus_exit(void)
struct list_head *listentry, *listtmp; struct list_head *listentry, *listtmp;
remove_all_visor_devices(); remove_all_visor_devices();
list_for_each_safe(listentry, listtmp, &list_all_bus_instances) { list_for_each_safe(listentry, listtmp, &list_all_bus_instances) {
struct visor_device *dev; struct visor_device *dev;
dev = list_entry(listentry, struct visor_device, list_all); dev = list_entry(listentry, struct visor_device, list_all);
visorbus_remove_instance(dev); visorbus_remove_instance(dev);
} }
bus_unregister(&visorbus_type); bus_unregister(&visorbus_type);
initialized = false; initialized = false;
debugfs_remove_recursive(visorbus_debugfs_dir); debugfs_remove_recursive(visorbus_debugfs_dir);
......
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