Commit 2866949e authored by Paulo Miguel Almeida's avatar Paulo Miguel Almeida Committed by Michael Ellerman
Browse files

powerpc/ps3: replace open-coded sysfs_emit function

sysfs_emit() helper function should be used when formatting the value
to be returned to user space.

This patch replaces open-coded sysfs_emit() in sysfs .show() callbacks

Link: https://github.com/KSPP/linux/issues/105


Signed-off-by: default avatarPaulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Acked-by: default avatarGeoff Levand <geoff@infradead.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://patch.msgid.link/ZxMV3YvSulJFZ8rk@mail.google.com
parent d677ce52
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -453,10 +453,9 @@ static ssize_t modalias_show(struct device *_dev, struct device_attribute *a,
	char *buf)
{
	struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
	int len = snprintf(buf, PAGE_SIZE, "ps3:%d:%d\n", dev->match_id,
			   dev->match_sub_id);

	return (len >= PAGE_SIZE) ? (PAGE_SIZE - 1) : len;
	return sysfs_emit(buf, "ps3:%d:%d\n", dev->match_id,
			  dev->match_sub_id);
}
static DEVICE_ATTR_RO(modalias);