aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-07-10 18:28:54 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-07-13 04:50:01 -0400
commit6cc8b6f51eb1af72882c279f691c5de7d5a43bf2 (patch)
treea7806a7c0e9016508806a80ca4ef0ff59225f5d2
parente47f31787dee5bf57453e18edefff56e17fa44f9 (diff)
[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>
-rw-r--r--arch/sparc/kernel/of_device.c6
-rw-r--r--arch/sparc64/kernel/of_device.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/arch/sparc/kernel/of_device.c b/arch/sparc/kernel/of_device.c
index bc956c530376..bbd3203b86af 100644
--- a/arch/sparc/kernel/of_device.c
+++ b/arch/sparc/kernel/of_device.c
@@ -695,9 +695,11 @@ int of_device_register(struct of_device *ofdev)
695 if (rc) 695 if (rc)
696 return rc; 696 return rc;
697 697
698 device_create_file(&ofdev->dev, &dev_attr_devspec); 698 rc = device_create_file(&ofdev->dev, &dev_attr_devspec);
699 if (rc)
700 device_unregister(&ofdev->dev);
699 701
700 return 0; 702 return rc;
701} 703}
702 704
703void of_device_unregister(struct of_device *ofdev) 705void of_device_unregister(struct of_device *ofdev)
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c
index 169b017eec0b..8e177a0abc1c 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)
922 if (rc) 922 if (rc)
923 return rc; 923 return rc;
924 924
925 device_create_file(&ofdev->dev, &dev_attr_devspec); 925 rc = device_create_file(&ofdev->dev, &dev_attr_devspec);
926 if (rc)
927 device_unregister(&ofdev->dev);
926 928
927 return 0; 929 return rc;
928} 930}
929 931
930void of_device_unregister(struct of_device *ofdev) 932void of_device_unregister(struct of_device *ofdev)