summaryrefslogtreecommitdiff
path: root/arch/sparc64
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-07-10 15:28:54 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2006-07-13 01:50:01 -0700
commit6cc8b6f51eb1af72882c279f691c5de7d5a43bf2 (patch)
treea7806a7c0e9016508806a80ca4ef0ff59225f5d2 /arch/sparc64
parente47f31787dee5bf57453e18edefff56e17fa44f9 (diff)
downloadlinux-3.10-6cc8b6f51eb1af72882c279f691c5de7d5a43bf2.tar.gz
linux-3.10-6cc8b6f51eb1af72882c279f691c5de7d5a43bf2.tar.bz2
linux-3.10-6cc8b6f51eb1af72882c279f691c5de7d5a43bf2.zip
[SPARC64]: of_device_register() error checking fix
device_create_file() can fail. This causes the sparc64 compile to fail when my fanatical __must_check patch is applied, due to -Werror. [ Added necessary identical fix for sparc32. -DaveM] Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/kernel/of_device.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c
index 169b017eec0..8e177a0abc1 100644
--- a/arch/sparc64/kernel/of_device.c
+++ b/arch/sparc64/kernel/of_device.c
@@ -922,9 +922,11 @@ int of_device_register(struct of_device *ofdev)
if (rc)
return rc;
- device_create_file(&ofdev->dev, &dev_attr_devspec);
+ rc = device_create_file(&ofdev->dev, &dev_attr_devspec);
+ if (rc)
+ device_unregister(&ofdev->dev);
- return 0;
+ return rc;
}
void of_device_unregister(struct of_device *ofdev)