Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308962
b: refs/heads/master
c: 541f936
h: refs/heads/master
v: v3
  • Loading branch information
Jingoo Han authored and Linus Torvalds committed May 29, 2012
1 parent 9fcde95 commit 25578d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 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: ab03e04741fc7a5747daabc57d15cb1a3e2fd289
refs/heads/master: 541f936f5d3993c5bbed33bdb53acd6de2403b04
15 changes: 5 additions & 10 deletions trunk/drivers/video/backlight/s6e63m0.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ static int __devinit s6e63m0_probe(struct spi_device *spi)
struct backlight_device *bd = NULL;
struct backlight_properties props;

lcd = kzalloc(sizeof(struct s6e63m0), GFP_KERNEL);
lcd = devm_kzalloc(&spi->dev, sizeof(struct s6e63m0), GFP_KERNEL);
if (!lcd)
return -ENOMEM;

Expand All @@ -751,7 +751,7 @@ static int __devinit s6e63m0_probe(struct spi_device *spi)
ret = spi_setup(spi);
if (ret < 0) {
dev_err(&spi->dev, "spi setup failed.\n");
goto out_free_lcd;
return ret;
}

lcd->spi = spi;
Expand All @@ -760,14 +760,12 @@ static int __devinit s6e63m0_probe(struct spi_device *spi)
lcd->lcd_pd = (struct lcd_platform_data *)spi->dev.platform_data;
if (!lcd->lcd_pd) {
dev_err(&spi->dev, "platform data is NULL.\n");
goto out_free_lcd;
return -EFAULT;
}

ld = lcd_device_register("s6e63m0", &spi->dev, lcd, &s6e63m0_lcd_ops);
if (IS_ERR(ld)) {
ret = PTR_ERR(ld);
goto out_free_lcd;
}
if (IS_ERR(ld))
return PTR_ERR(ld);

lcd->ld = ld;

Expand Down Expand Up @@ -824,8 +822,6 @@ static int __devinit s6e63m0_probe(struct spi_device *spi)

out_lcd_unregister:
lcd_device_unregister(ld);
out_free_lcd:
kfree(lcd);
return ret;
}

Expand All @@ -838,7 +834,6 @@ static int __devexit s6e63m0_remove(struct spi_device *spi)
device_remove_file(&spi->dev, &dev_attr_gamma_mode);
backlight_device_unregister(lcd->bd);
lcd_device_unregister(lcd->ld);
kfree(lcd);

return 0;
}
Expand Down

0 comments on commit 25578d7

Please sign in to comment.