diff options
author | Prarit Bhargava <prarit@redhat.com> | 2013-09-23 09:33:36 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-13 19:08:31 -0400 |
commit | 470d4d6fe7349299ed565948e539260c4d0d041c (patch) | |
tree | bcb86820e58b082ca71869a05c9bafb9f377fc57 /arch/powerpc | |
parent | 72daf965bb8fe1447069db3ea511047f20eca947 (diff) |
powerpc/vio: Fix modalias_show return values
commit e82b89a6f19bae73fb064d1b3dd91fcefbb478f4 upstream.
modalias_show() should return an empty string on error, not -ENODEV.
This causes the following false and annoying error:
> find /sys/devices -name modalias -print0 | xargs -0 cat >/dev/null
cat: /sys/devices/vio/4000/modalias: No such device
cat: /sys/devices/vio/4001/modalias: No such device
cat: /sys/devices/vio/4002/modalias: No such device
cat: /sys/devices/vio/4004/modalias: No such device
cat: /sys/devices/vio/modalias: No such device
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/vio.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index 536016d792ba..2d845d8199fc 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c | |||
@@ -1529,11 +1529,15 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, | |||
1529 | const char *cp; | 1529 | const char *cp; |
1530 | 1530 | ||
1531 | dn = dev->of_node; | 1531 | dn = dev->of_node; |
1532 | if (!dn) | 1532 | if (!dn) { |
1533 | return -ENODEV; | 1533 | strcat(buf, "\n"); |
1534 | return strlen(buf); | ||
1535 | } | ||
1534 | cp = of_get_property(dn, "compatible", NULL); | 1536 | cp = of_get_property(dn, "compatible", NULL); |
1535 | if (!cp) | 1537 | if (!cp) { |
1536 | return -ENODEV; | 1538 | strcat(buf, "\n"); |
1539 | return strlen(buf); | ||
1540 | } | ||
1537 | 1541 | ||
1538 | return sprintf(buf, "vio:T%sS%s\n", vio_dev->type, cp); | 1542 | return sprintf(buf, "vio:T%sS%s\n", vio_dev->type, cp); |
1539 | } | 1543 | } |