From: Tony Breeds Date: Thu, 24 Jul 2008 04:31:16 +0000 (-0700) Subject: drivers/video/aty/radeon_base.c: notify user if sysfs_create_bin_file() failed X-Git-Tag: firefly_0821_release~19165 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fcea8030b3c2e71ad89f080901c63a04f07881c8;p=firefly-linux-kernel-4.4.55.git drivers/video/aty/radeon_base.c: notify user if sysfs_create_bin_file() failed Current kernel builds warn about: drivers/video/aty/radeon_base.c: In function 'radeonfb_pci_register': drivers/video/aty/radeon_base.c:2334: warning: ignoring return value of 'sysfs_create_bin_file', declared with attribute warn_unused_result drivers/video/aty/radeon_base.c:2336: warning: ignoring return value of 'sysfs_create_bin_file', declared with attribute warn_unused_result Do minimal checking of these functions and issue a warning if either fails. They don't seem to be critical.. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Tony Breeds Cc: "Antonino A. Daplas" Cc: Benjamin Herrenschmidt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c index 400e9264e456..3c0a03f69d83 100644 --- a/drivers/video/aty/radeon_base.c +++ b/drivers/video/aty/radeon_base.c @@ -2161,6 +2161,7 @@ static int __devinit radeonfb_pci_register (struct pci_dev *pdev, struct radeonfb_info *rinfo; int ret; unsigned char c1, c2; + int err = 0; pr_debug("radeonfb_pci_register BEGIN\n"); @@ -2340,9 +2341,14 @@ static int __devinit radeonfb_pci_register (struct pci_dev *pdev, /* Register some sysfs stuff (should be done better) */ if (rinfo->mon1_EDID) - sysfs_create_bin_file(&rinfo->pdev->dev.kobj, &edid1_attr); + err |= sysfs_create_bin_file(&rinfo->pdev->dev.kobj, + &edid1_attr); if (rinfo->mon2_EDID) - sysfs_create_bin_file(&rinfo->pdev->dev.kobj, &edid2_attr); + err |= sysfs_create_bin_file(&rinfo->pdev->dev.kobj, + &edid2_attr); + if (err) + pr_warning("%s() Creating sysfs files failed, continuing\n", + __func__); /* save current mode regs before we switch into the new one * so we can restore this upon __exit