Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235838
b: refs/heads/master
c: a90dcd4
h: refs/heads/master
v: v3
  • Loading branch information
Marek Belisko authored and Greg Kroah-Hartman committed Feb 4, 2011
1 parent 4b5e8f5 commit eb1720a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3ad4e219606fa317f778b26553889520aed7925c
refs/heads/master: a90dcd4f7dfc3e664e7d08790a8b39d052e21a2e
15 changes: 12 additions & 3 deletions trunk/drivers/staging/olpc_dcon/olpc_dcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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 */

Expand All @@ -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;
Expand Down

0 comments on commit eb1720a

Please sign in to comment.