Skip to content

Commit

Permalink
drivers/video/aty/radeon_base.c: notify user if sysfs_create_bin_file…
Browse files Browse the repository at this point in the history
…() 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 <tony@bakeyournoodle.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Tony Breeds authored and Linus Torvalds committed Jul 24, 2008
1 parent 7951ac9 commit fcea803
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/video/aty/radeon_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fcea803

Please sign in to comment.