Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318973
b: refs/heads/master
c: b523cfe
h: refs/heads/master
i:
  318971: bcdc894
v: v3
  • Loading branch information
Devendra Naga authored and Bryan Wu committed Jul 23, 2012
1 parent 3cd968e commit b7c590a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 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: 5391dd0a9d084633e20e6583cfed233581c452f9
refs/heads/master: b523cfe61b097a45f4e919e8c3b6da239962b3e9
9 changes: 2 additions & 7 deletions trunk/drivers/leds/leds-88pm860x.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ static int pm860x_led_probe(struct platform_device *pdev)
return -EINVAL;
}

data = kzalloc(sizeof(struct pm860x_led), GFP_KERNEL);
data = devm_kzalloc(&pdev->dev, sizeof(struct pm860x_led), GFP_KERNEL);
if (data == NULL)
return -ENOMEM;
strncpy(data->name, res->name, MFD_NAME_SIZE - 1);
Expand All @@ -220,7 +220,6 @@ static int pm860x_led_probe(struct platform_device *pdev)
data->port = pdata->flags;
if (data->port < 0) {
dev_err(&pdev->dev, "check device failed\n");
kfree(data);
return -EINVAL;
}

Expand All @@ -233,21 +232,17 @@ static int pm860x_led_probe(struct platform_device *pdev)
ret = led_classdev_register(chip->dev, &data->cdev);
if (ret < 0) {
dev_err(&pdev->dev, "Failed to register LED: %d\n", ret);
goto out;
return ret;
}
pm860x_led_set(&data->cdev, 0);
return 0;
out:
kfree(data);
return ret;
}

static int pm860x_led_remove(struct platform_device *pdev)
{
struct pm860x_led *data = platform_get_drvdata(pdev);

led_classdev_unregister(&data->cdev);
kfree(data);

return 0;
}
Expand Down

0 comments on commit b7c590a

Please sign in to comment.