From: Don Zickus <dzickus@xxxxxxxxxx> Another conversion of the init/exit routines with various other functions used during init thrown in here. Most of the conversion is mechanical. Signed-off-by: Don Zickus <dzickus@xxxxxxxxxx> Signed-off-by: Benjamin Romer <benjamin.romer@xxxxxxxxxx> --- drivers/staging/unisys/visorbus/visorbus_main.c | 36 ++++++++----------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 7b585d8..cc2ed58 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -197,11 +197,10 @@ away: static void visorbus_release_busdevice(struct device *xdev) { - struct visorbus_devdata *devdata = dev_get_drvdata(xdev); + struct visor_device *dev = dev_get_drvdata(xdev); dev_set_drvdata(xdev, NULL); - kfree(devdata); - kfree(xdev); + kfree(dev); } /** This is called when device_unregister() is called for each child @@ -1237,11 +1236,9 @@ static void fix_vbus_dev_info(struct visor_device *visordev) { int i; - struct visorchipset_bus_info bus_info; - struct visorbus_devdata *devdata = NULL; struct visor_driver *visordrv; - int bus_no = visordev->chipset_bus_no; int dev_no = visordev->chipset_dev_no; + struct visorchannel *channel = visordev->visorchannel; struct ultra_vbus_deviceinfo dev_info; const char *chan_type_name = NULL; @@ -1249,15 +1246,6 @@ fix_vbus_dev_info(struct visor_device *visordev) return; visordrv = to_visor_driver(visordev->device.driver); - if (!visorchipset_get_bus_info(bus_no, &bus_info)) - return; - - devdata = (struct visorbus_devdata *)(bus_info.bus_driver_context); - if (!devdata) - return; - - if (!devdata->vbus_valid) - return; /* Within the list of device types (by GUID) that the driver * says it supports, find out which one of those types matches @@ -1276,15 +1264,15 @@ fix_vbus_dev_info(struct visor_device *visordev) bus_device_info_init(&dev_info, chan_type_name, visordrv->name, visordrv->version, visordrv->vertag); - write_vbus_dev_info(devdata->chan, - &devdata->vbus_hdr_info, &dev_info, dev_no); + write_vbus_dev_info(channel, + &visordev->vbus_hdr_info, &dev_info, dev_no); /* Re-write bus+chipset info, because it is possible that this * was previously written by our evil counterpart, virtpci. */ - write_vbus_chp_info(devdata->chan, &devdata->vbus_hdr_info, + write_vbus_chp_info(channel, &visordev->vbus_hdr_info, &chipset_driverinfo); - write_vbus_bus_info(devdata->chan, &devdata->vbus_hdr_info, + write_vbus_bus_info(channel, &visordev->vbus_hdr_info, &clientbus_driverinfo); } @@ -1353,7 +1341,6 @@ create_bus_type(void) { int rc = 0; - visorbus_type.dev_attrs = visor_device_attrs; rc = bus_register(&visorbus_type); return rc; } @@ -1624,11 +1611,10 @@ visorbus_exit(void) } list_for_each_safe(listentry, listtmp, &list_all_bus_instances) { - struct visorbus_devdata *devdata = list_entry(listentry, - struct - visorbus_devdata, - list_all); - remove_bus_instance(devdata); + struct visor_device *dev = list_entry(listentry, + struct visor_device, + list_all); + remove_bus_instance(dev); } remove_bus_type(); } -- 2.1.4 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel