[PATCH 2.6.19-rc1] radeonfb: check return value of sysfs_create_bin_file

From: Luca Tettamanti
Date: Wed Oct 11 2006 - 19:53:51 EST


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@xxxxxxxxx>

---

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?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/