From 14c19b2a40b61b609f68d1d6a5518ebb1c30706f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Krzysztof=20Wilczy=C5=84ski?= Date: Thu, 3 Jun 2021 00:01:10 +0000 Subject: [PATCH] PCI/sysfs: Add 'devspec' newline MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Previously, when the value of the "devspec" sysfs attribute was read from the user space there was no newline present, and utilities such as "cat" wouldn't display the result of the read correctly. Append a newline character in the show() function to match other "devspec" attributes. Link: https://lore.kernel.org/r/20210603000112.703037-5-kw@linux.com Signed-off-by: Krzysztof Wilczyński Signed-off-by: Bjorn Helgaas Reviewed-by: Logan Gunthorpe --- drivers/pci/pci-sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index beb8d1f..5d63df7 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@ -537,7 +537,7 @@ static ssize_t devspec_show(struct device *dev, if (np == NULL) return 0; - return sysfs_emit(buf, "%pOF", np); + return sysfs_emit(buf, "%pOF\n", np); } static DEVICE_ATTR_RO(devspec); #endif -- 2.7.4