Skip to content

Commit

Permalink
backlight: lms283gf05: use devm_lcd_device_register()
Browse files Browse the repository at this point in the history
Use devm_lcd_device_register() to make cleanup paths simpler, and remove
unnecessary remove().

Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Jingoo Han authored and torvalds committed Nov 13, 2013
1 parent 5690378 commit 0a1c55d
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions drivers/video/backlight/lms283gf05.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ static int lms283gf05_probe(struct spi_device *spi)
return -ENOMEM;
}

ld = lcd_device_register("lms283gf05", &spi->dev, st, &lms_ops);
ld = devm_lcd_device_register(&spi->dev, "lms283gf05", &spi->dev, st,
&lms_ops);
if (IS_ERR(ld))
return PTR_ERR(ld);

Expand All @@ -190,22 +191,12 @@ static int lms283gf05_probe(struct spi_device *spi)
return 0;
}

static int lms283gf05_remove(struct spi_device *spi)
{
struct lms283gf05_state *st = spi_get_drvdata(spi);

lcd_device_unregister(st->ld);

return 0;
}

static struct spi_driver lms283gf05_driver = {
.driver = {
.name = "lms283gf05",
.owner = THIS_MODULE,
},
.probe = lms283gf05_probe,
.remove = lms283gf05_remove,
};

module_spi_driver(lms283gf05_driver);
Expand Down

0 comments on commit 0a1c55d

Please sign in to comment.