diff options
Diffstat (limited to 'drivers/staging/unisys/virtpci/virtpci.c')
-rw-r--r-- | drivers/staging/unisys/virtpci/virtpci.c | 61 |
1 files changed, 17 insertions, 44 deletions
diff --git a/drivers/staging/unisys/virtpci/virtpci.c b/drivers/staging/unisys/virtpci/virtpci.c index 39b828dce503..8fdfd6f3605f 100644 --- a/drivers/staging/unisys/virtpci/virtpci.c +++ b/drivers/staging/unisys/virtpci/virtpci.c @@ -104,8 +104,6 @@ static ssize_t virtpci_driver_attr_store(struct kobject *kobj, const char *buf, size_t count); static int virtpci_bus_match(struct device *dev, struct device_driver *drv); static int virtpci_uevent(struct device *dev, struct kobj_uevent_env *env); -static int virtpci_device_suspend(struct device *dev, pm_message_t state); -static int virtpci_device_resume(struct device *dev); static int virtpci_device_probe(struct device *dev); static int virtpci_device_remove(struct device *dev); @@ -128,8 +126,6 @@ static struct bus_type virtpci_bus_type = { .name = "uisvirtpci", .match = virtpci_bus_match, .uevent = virtpci_uevent, - .suspend = virtpci_device_suspend, - .resume = virtpci_device_resume, }; static struct device virtpci_rootbus_device = { @@ -279,9 +275,9 @@ static int add_vbus(struct add_vbus_guestpart *addparams) POSTCODE_LINUX_2(VPCI_CREATE_FAILURE_PC, POSTCODE_SEVERITY_ERR); return 0; } - write_vbus_chp_info(vbus->platform_data /* chanptr */ , + write_vbus_chp_info(vbus->platform_data /* chanptr */, &chipset_driver_info); - write_vbus_bus_info(vbus->platform_data /* chanptr */ , + write_vbus_bus_info(vbus->platform_data /* chanptr */, &bus_driver_info); LOGINF("Added vbus %d; device %s created successfully\n", addparams->bus_no, BUS_ID(vbus)); @@ -466,7 +462,7 @@ static int pause_vhba(struct pause_virt_guestpart *pauseparams) GET_SCSIADAPINFO_FROM_CHANPTR(pauseparams->chanptr); LOGINF("Pausing vhba wwnn:%x:%x\n", scsi.wwnn.wwnn1, scsi.wwnn.wwnn2); - i = virtpci_device_serverdown(NULL /*no parent bus */ , VIRTHBA_TYPE, + i = virtpci_device_serverdown(NULL /*no parent bus */, VIRTHBA_TYPE, &scsi.wwnn, NULL); if (i) LOGINF("Paused vhba wwnn:%x:%x\n", scsi.wwnn.wwnn1, @@ -487,7 +483,7 @@ static int pause_vnic(struct pause_virt_guestpart *pauseparams) LOGINF("Pausing vnic macaddr:%02x:%02x:%02x:%02x:%02x:%02x\n", net.mac_addr[0], net.mac_addr[1], net.mac_addr[2], net.mac_addr[3], net.mac_addr[4], net.mac_addr[5]); - i = virtpci_device_serverdown(NULL /*no parent bus */ , VIRTNIC_TYPE, + i = virtpci_device_serverdown(NULL /*no parent bus */, VIRTNIC_TYPE, NULL, net.mac_addr); if (i) { LOGINF(" Paused vnic macaddr:%02x:%02x:%02x:%02x:%02x:%02x\n", @@ -508,7 +504,7 @@ static int resume_vhba(struct resume_virt_guestpart *resumeparams) GET_SCSIADAPINFO_FROM_CHANPTR(resumeparams->chanptr); LOGINF("Resuming vhba wwnn:%x:%x\n", scsi.wwnn.wwnn1, scsi.wwnn.wwnn2); - i = virtpci_device_serverup(NULL /*no parent bus */ , VIRTHBA_TYPE, + i = virtpci_device_serverup(NULL /*no parent bus */, VIRTHBA_TYPE, &scsi.wwnn, NULL); if (i) LOGINF("Resumed vhba wwnn:%x:%x\n", scsi.wwnn.wwnn1, @@ -530,7 +526,7 @@ resume_vnic(struct resume_virt_guestpart *resumeparams) LOGINF("Resuming vnic macaddr:%02x:%02x:%02x:%02x:%02x:%02x\n", net.mac_addr[0], net.mac_addr[1], net.mac_addr[2], net.mac_addr[3], net.mac_addr[4], net.mac_addr[5]); - i = virtpci_device_serverup(NULL /*no parent bus */ , VIRTNIC_TYPE, + i = virtpci_device_serverup(NULL /*no parent bus */, VIRTNIC_TYPE, NULL, net.mac_addr); if (i) { LOGINF(" Resumed vnic macaddr:%02x:%02x:%02x:%02x:%02x:%02x\n", @@ -551,7 +547,7 @@ static int delete_vhba(struct del_virt_guestpart *delparams) GET_SCSIADAPINFO_FROM_CHANPTR(delparams->chanptr); LOGINF("Deleting vhba wwnn:%x:%x\n", scsi.wwnn.wwnn1, scsi.wwnn.wwnn2); - i = virtpci_device_del(NULL /*no parent bus */ , VIRTHBA_TYPE, + i = virtpci_device_del(NULL /*no parent bus */, VIRTHBA_TYPE, &scsi.wwnn, NULL); if (i) { LOGINF("Deleted vhba wwnn:%x:%x\n", scsi.wwnn.wwnn1, @@ -574,7 +570,7 @@ static int delete_vnic(struct del_virt_guestpart *delparams) LOGINF("Deleting vnic macaddr:%02x:%02x:%02x:%02x:%02x:%02x\n", net.mac_addr[0], net.mac_addr[1], net.mac_addr[2], net.mac_addr[3], net.mac_addr[4], net.mac_addr[5]); - i = virtpci_device_del(NULL /*no parent bus */ , VIRTNIC_TYPE, NULL, + i = virtpci_device_del(NULL /*no parent bus */, VIRTNIC_TYPE, NULL, net.mac_addr); if (i) { LOGINF("Deleted vnic macaddr:%02x:%02x:%02x:%02x:%02x:%02x\n", @@ -757,18 +753,6 @@ static int virtpci_uevent(struct device *dev, struct kobj_uevent_env *env) return 0; } -static int virtpci_device_suspend(struct device *dev, pm_message_t state) -{ - DBGINF("In virtpci_device_suspend -NYI ****\n"); - return 0; -} - -static int virtpci_device_resume(struct device *dev) -{ - DBGINF("In virtpci_device_resume -NYI ****\n"); - return 0; -} - /* For a child device just created on a client bus, fill in * information about the driver that is controlling this device into * the appropriate slot within the vbus channel of the bus @@ -1338,18 +1322,13 @@ static ssize_t virtpci_driver_attr_show(struct kobject *kobj, ssize_t ret = 0; struct driver_private *dprivate = to_driver(kobj); - struct device_driver *driver; + struct device_driver *driver = dprivate->driver; - if (dprivate != NULL) - driver = dprivate->driver; - else - driver = NULL; + DBGINF("In virtpci_driver_attr_show driver->name:%s\n", driver->name); + + if (dattr->show) + ret = dattr->show(driver, buf); - DBGINF("In virtpci_driver_attr_show driver->name:%s\n", driver->name); - if (driver) { - if (dattr->show) - ret = dattr->show(driver, buf); - } return ret; } @@ -1361,19 +1340,13 @@ static ssize_t virtpci_driver_attr_store(struct kobject *kobj, ssize_t ret = 0; struct driver_private *dprivate = to_driver(kobj); - struct device_driver *driver; - - if (dprivate != NULL) - driver = dprivate->driver; - else - driver = NULL; + struct device_driver *driver = dprivate->driver; DBGINF("In virtpci_driver_attr_store driver->name:%s\n", driver->name); - if (driver) { - if (dattr->store) - ret = dattr->store(driver, buf, count); - } + if (dattr->store) + ret = dattr->store(driver, buf, count); + return ret; } |