Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 259013
b: refs/heads/master
c: e179840
h: refs/heads/master
i:
  259011: c8f5f1b
v: v3
  • Loading branch information
Axel Lin authored and Linus Torvalds committed Jul 26, 2011
1 parent d541059 commit f693864
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 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: 19ab5cb8fb14a44a4eb0b532ddc3658b055d84f9
refs/heads/master: e179840ba88c342d215631356cbfe4e62c9f175b
12 changes: 7 additions & 5 deletions trunk/drivers/leds/leds-sunfire.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,19 @@ static int __devinit sunfire_led_generic_probe(struct platform_device *pdev,
struct led_type *types)
{
struct sunfire_drvdata *p;
int i, err = -EINVAL;
int i, err;

if (pdev->num_resources != 1) {
printk(KERN_ERR PFX "Wrong number of resources %d, should be 1\n",
pdev->num_resources);
err = -EINVAL;
goto out;
}

p = kzalloc(sizeof(*p), GFP_KERNEL);
if (!p) {
printk(KERN_ERR PFX "Could not allocate struct sunfire_drvdata\n");
err = -ENOMEM;
goto out;
}

Expand All @@ -160,14 +162,14 @@ static int __devinit sunfire_led_generic_probe(struct platform_device *pdev,

dev_set_drvdata(&pdev->dev, p);

err = 0;
out:
return err;
return 0;

out_unregister_led_cdevs:
for (i--; i >= 0; i--)
led_classdev_unregister(&p->leds[i].led_cdev);
goto out;
kfree(p);
out:
return err;
}

static int __devexit sunfire_led_generic_remove(struct platform_device *pdev)
Expand Down

0 comments on commit f693864

Please sign in to comment.