Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 447c5dd7 authored by Michal Schmidt's avatar Michal Schmidt Committed by Jesse Barnes
Browse files

PCI: return correct value when writing to the "reset" attribute



A successful write() to the "reset" sysfs attribute should return the
number of bytes written, not 0. Otherwise userspace (bash) retries the
write over and over again.

Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: default avatarMichal Schmidt <mschmidt@redhat.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 3196180a
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -960,7 +960,12 @@ static ssize_t reset_store(struct device *dev,

	if (val != 1)
		return -EINVAL;
	return pci_reset_function(pdev);

	result = pci_reset_function(pdev);
	if (result < 0)
		return result;

	return count;
}

static struct device_attribute reset_attr = __ATTR(reset, 0200, NULL, reset_store);