public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.19-rc1] radeonfb: check return value of sysfs_create_bin_file
@ 2006-10-11 23:53 Luca Tettamanti
  2006-10-12  0:07 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 5+ messages in thread
From: Luca Tettamanti @ 2006-10-11 23:53 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linux-kernel

sysfs_create_bin_file() is marked as warn_unused_result but we don't
actually check the return value.
Error is not fatal, the driver can operate fine without the files so
just print a notice on failure.

Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>

---

 drivers/video/aty/radeon_base.c |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c
index 0ed577e..bc2aac6 100644
--- a/drivers/video/aty/radeon_base.c
+++ b/drivers/video/aty/radeon_base.c
@@ -2313,10 +2313,17 @@ #endif
 	radeon_check_modes(rinfo, mode_option);
 
 	/* Register some sysfs stuff (should be done better) */
-	if (rinfo->mon1_EDID)
-		sysfs_create_bin_file(&rinfo->pdev->dev.kobj, &edid1_attr);
-	if (rinfo->mon2_EDID)
-		sysfs_create_bin_file(&rinfo->pdev->dev.kobj, &edid2_attr);
+	if (rinfo->mon1_EDID) {
+		if (sysfs_create_bin_file(&rinfo->pdev->dev.kobj, &edid1_attr))
+			printk(KERN_INFO "radeonfb (%s): failed to create edid1 file. "
+				"Continuing anyway.\n", pci_name(rinfo->pdev));
+	}
+
+	if (rinfo->mon2_EDID) {
+		if (sysfs_create_bin_file(&rinfo->pdev->dev.kobj, &edid2_attr))
+			printk(KERN_INFO "radeonfb (%s): failed to create edid2 file. "
+				"Continuing anyway.\n", pci_name(rinfo->pdev));
+	}
 
 	/* save current mode regs before we switch into the new one
 	 * so we can restore this upon __exit


Luca
-- 
Dicono che il cane sia il miglior amico dell'uomo. Secondo me non e`
vero. Quanti dei vostri amici avete fatto castrare, recentemente?

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-10-12 16:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-11 23:53 [PATCH 2.6.19-rc1] radeonfb: check return value of sysfs_create_bin_file Luca Tettamanti
2006-10-12  0:07 ` Benjamin Herrenschmidt
2006-10-12 15:45   ` Luca Tettamanti
2006-10-12 15:54     ` Andreas Schwab
2006-10-12 16:05       ` Luca Tettamanti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox