aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/pci/pci_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/pci/pci_sysfs.c')
-rw-r--r--arch/s390/pci/pci_sysfs.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/arch/s390/pci/pci_sysfs.c b/arch/s390/pci/pci_sysfs.c
index cf8a12ff733b..ab4a91393005 100644
--- a/arch/s390/pci/pci_sysfs.c
+++ b/arch/s390/pci/pci_sysfs.c
@@ -48,29 +48,27 @@ static ssize_t show_pfgid(struct device *dev, struct device_attribute *attr,
48} 48}
49static DEVICE_ATTR(pfgid, S_IRUGO, show_pfgid, NULL); 49static DEVICE_ATTR(pfgid, S_IRUGO, show_pfgid, NULL);
50 50
51static void recover_callback(struct device *dev) 51static ssize_t store_recover(struct device *dev, struct device_attribute *attr,
52 const char *buf, size_t count)
52{ 53{
53 struct pci_dev *pdev = to_pci_dev(dev); 54 struct pci_dev *pdev = to_pci_dev(dev);
54 struct zpci_dev *zdev = get_zdev(pdev); 55 struct zpci_dev *zdev = get_zdev(pdev);
55 int ret; 56 int ret;
56 57
58 if (!device_remove_file_self(dev, attr))
59 return count;
60
57 pci_stop_and_remove_bus_device(pdev); 61 pci_stop_and_remove_bus_device(pdev);
58 ret = zpci_disable_device(zdev); 62 ret = zpci_disable_device(zdev);
59 if (ret) 63 if (ret)
60 return; 64 return ret;
61 65
62 ret = zpci_enable_device(zdev); 66 ret = zpci_enable_device(zdev);
63 if (ret) 67 if (ret)
64 return; 68 return ret;
65 69
66 pci_rescan_bus(zdev->bus); 70 pci_rescan_bus(zdev->bus);
67} 71 return count;
68
69static ssize_t store_recover(struct device *dev, struct device_attribute *attr,
70 const char *buf, size_t count)
71{
72 int rc = device_schedule_callback(dev, recover_callback);
73 return rc ? rc : count;
74} 72}
75static DEVICE_ATTR(recover, S_IWUSR, NULL, store_recover); 73static DEVICE_ATTR(recover, S_IWUSR, NULL, store_recover);
76 74