aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/olpc_dcon/olpc_dcon.c
diff options
context:
space:
mode:
authorMarek Belisko <marek.belisko@open-nandra.com>2011-02-03 14:22:08 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-04 13:04:53 -0800
commita90dcd4f7dfc3e664e7d08790a8b39d052e21a2e (patch)
treee716f52af7f523be3659fd38a8cf09aff9a0cb0d /drivers/staging/olpc_dcon/olpc_dcon.c
parent3ad4e219606fa317f778b26553889520aed7925c (diff)
downloadkernel_samsung_smdk4412-a90dcd4f7dfc3e664e7d08790a8b39d052e21a2e.zip
kernel_samsung_smdk4412-a90dcd4f7dfc3e664e7d08790a8b39d052e21a2e.tar.gz
kernel_samsung_smdk4412-a90dcd4f7dfc3e664e7d08790a8b39d052e21a2e.tar.bz2
staging: oplc_dcon: Fix compilation warning.
Fix compilation warning: drivers/staging/olpc_dcon/olpc_dcon.c: In function ‘dcon_probe’: drivers/staging/olpc_dcon/olpc_dcon.c:704:21: warning: ignoring return value of ‘device_create_file’, declared with attribute warn_unused_result and add cleaning of created files when creation of one failed. Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/olpc_dcon/olpc_dcon.c')
-rw-r--r--drivers/staging/olpc_dcon/olpc_dcon.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c
index 56a283d..7221bb8 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon.c
@@ -674,7 +674,7 @@ static int dcon_detect(struct i2c_client *client, struct i2c_board_info *info)
static int dcon_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
- int rc, i;
+ int rc, i, j;
if (num_registered_fb >= 1)
fbinfo = registered_fb[0];
@@ -700,8 +700,14 @@ static int dcon_probe(struct i2c_client *client, const struct i2c_device_id *id)
goto edev;
}
- for(i = 0; i < ARRAY_SIZE(dcon_device_files); i++)
- device_create_file(&dcon_device->dev, &dcon_device_files[i]);
+ for(i = 0; i < ARRAY_SIZE(dcon_device_files); i++) {
+ rc = device_create_file(&dcon_device->dev,
+ &dcon_device_files[i]);
+ if (rc) {
+ dev_err(&dcon_device->dev, "Cannot create sysfs file\n");
+ goto ecreate;
+ }
+ }
/* Add the backlight device for the DCON */
@@ -728,6 +734,9 @@ static int dcon_probe(struct i2c_client *client, const struct i2c_device_id *id)
return 0;
+ ecreate:
+ for (j = 0; j < i; j++)
+ device_remove_file(&dcon_device->dev, &dcon_device_files[j]);
edev:
platform_device_unregister(dcon_device);
dcon_device = NULL;