Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308956
b: refs/heads/master
c: 06c96f1
h: refs/heads/master
v: v3
  • Loading branch information
Jingoo Han authored and Linus Torvalds committed May 29, 2012
1 parent a95a1d0 commit afc0dad
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: 80629efcae09c5d80a9fdeea5226cd81b4fec7f3
refs/heads/master: 06c96f189bf94448779db66944836a827517d6c9
12 changes: 4 additions & 8 deletions trunk/drivers/video/backlight/corgi_lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ static int __devinit corgi_lcd_probe(struct spi_device *spi)
return -EINVAL;
}

lcd = kzalloc(sizeof(struct corgi_lcd), GFP_KERNEL);
lcd = devm_kzalloc(&spi->dev, sizeof(struct corgi_lcd), GFP_KERNEL);
if (!lcd) {
dev_err(&spi->dev, "failed to allocate memory\n");
return -ENOMEM;
Expand All @@ -554,10 +554,9 @@ static int __devinit corgi_lcd_probe(struct spi_device *spi)

lcd->lcd_dev = lcd_device_register("corgi_lcd", &spi->dev,
lcd, &corgi_lcd_ops);
if (IS_ERR(lcd->lcd_dev)) {
ret = PTR_ERR(lcd->lcd_dev);
goto err_free_lcd;
}
if (IS_ERR(lcd->lcd_dev))
return PTR_ERR(lcd->lcd_dev);

lcd->power = FB_BLANK_POWERDOWN;
lcd->mode = (pdata) ? pdata->init_mode : CORGI_LCD_MODE_VGA;

Expand Down Expand Up @@ -591,8 +590,6 @@ static int __devinit corgi_lcd_probe(struct spi_device *spi)
backlight_device_unregister(lcd->bl_dev);
err_unregister_lcd:
lcd_device_unregister(lcd->lcd_dev);
err_free_lcd:
kfree(lcd);
return ret;
}

Expand All @@ -613,7 +610,6 @@ static int __devexit corgi_lcd_remove(struct spi_device *spi)

corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_POWERDOWN);
lcd_device_unregister(lcd->lcd_dev);
kfree(lcd);

return 0;
}
Expand Down

0 comments on commit afc0dad

Please sign in to comment.