Commit 59d961c5 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Bartlomiej Zolnierkiewicz

video: ssd1307fb: Convert driver to use ->probe_new()

Use the ->probe_new() callback.

The driver does not use const struct i2c_device_id * argument,
so convert it to utilise the simplified I²C driver registration.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200324170532.44384-1-andriy.shevchenko@linux.intel.com
parent 94856546
...@@ -586,8 +586,7 @@ static const struct of_device_id ssd1307fb_of_match[] = { ...@@ -586,8 +586,7 @@ static const struct of_device_id ssd1307fb_of_match[] = {
}; };
MODULE_DEVICE_TABLE(of, ssd1307fb_of_match); MODULE_DEVICE_TABLE(of, ssd1307fb_of_match);
static int ssd1307fb_probe(struct i2c_client *client, static int ssd1307fb_probe(struct i2c_client *client)
const struct i2c_device_id *id)
{ {
struct backlight_device *bl; struct backlight_device *bl;
char bl_name[12]; char bl_name[12];
...@@ -599,11 +598,6 @@ static int ssd1307fb_probe(struct i2c_client *client, ...@@ -599,11 +598,6 @@ static int ssd1307fb_probe(struct i2c_client *client,
void *vmem; void *vmem;
int ret; int ret;
if (!node) {
dev_err(&client->dev, "No device tree data found!\n");
return -EINVAL;
}
info = framebuffer_alloc(sizeof(struct ssd1307fb_par), &client->dev); info = framebuffer_alloc(sizeof(struct ssd1307fb_par), &client->dev);
if (!info) if (!info)
return -ENOMEM; return -ENOMEM;
...@@ -810,7 +804,7 @@ static const struct i2c_device_id ssd1307fb_i2c_id[] = { ...@@ -810,7 +804,7 @@ static const struct i2c_device_id ssd1307fb_i2c_id[] = {
MODULE_DEVICE_TABLE(i2c, ssd1307fb_i2c_id); MODULE_DEVICE_TABLE(i2c, ssd1307fb_i2c_id);
static struct i2c_driver ssd1307fb_driver = { static struct i2c_driver ssd1307fb_driver = {
.probe = ssd1307fb_probe, .probe_new = ssd1307fb_probe,
.remove = ssd1307fb_remove, .remove = ssd1307fb_remove,
.id_table = ssd1307fb_i2c_id, .id_table = ssd1307fb_i2c_id,
.driver = { .driver = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment