Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319913
b: refs/heads/master
c: f1b60d4
h: refs/heads/master
i:
  319911: 679613b
v: v3
  • Loading branch information
Jingoo Han authored and Linus Torvalds committed Jul 31, 2012
1 parent 9e2eaa4 commit 5a4a138
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 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: a4be29ac6df4f7c7a0225f7f72c78f4fb10114c0
refs/heads/master: f1b60d46b6f1274f1eacfc89ddbf7f6b63348196
12 changes: 4 additions & 8 deletions trunk/drivers/video/backlight/ot200_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ static int ot200_backlight_probe(struct platform_device *pdev)
goto error_mfgpt_alloc;
}

data = kzalloc(sizeof(*data), GFP_KERNEL);
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
if (!data) {
retval = -ENOMEM;
goto error_kzalloc;
goto error_devm_kzalloc;
}

/* setup gpio */
Expand All @@ -122,16 +122,14 @@ static int ot200_backlight_probe(struct platform_device *pdev)
if (IS_ERR(bl)) {
dev_err(&pdev->dev, "failed to register backlight\n");
retval = PTR_ERR(bl);
goto error_backlight_device_register;
goto error_devm_kzalloc;
}

platform_set_drvdata(pdev, bl);

return 0;

error_backlight_device_register:
kfree(data);
error_kzalloc:
error_devm_kzalloc:
cs5535_mfgpt_free_timer(pwm_timer);
error_mfgpt_alloc:
gpio_free(GPIO_DIMM);
Expand All @@ -141,7 +139,6 @@ static int ot200_backlight_probe(struct platform_device *pdev)
static int ot200_backlight_remove(struct platform_device *pdev)
{
struct backlight_device *bl = platform_get_drvdata(pdev);
struct ot200_backlight_data *data = bl_get_data(bl);

backlight_device_unregister(bl);

Expand All @@ -154,7 +151,6 @@ static int ot200_backlight_remove(struct platform_device *pdev)
cs5535_mfgpt_free_timer(pwm_timer);
gpio_free(GPIO_DIMM);

kfree(data);
return 0;
}

Expand Down

0 comments on commit 5a4a138

Please sign in to comment.