aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ir-kbd-i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/ir-kbd-i2c.c')
-rw-r--r--drivers/media/video/ir-kbd-i2c.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index cb833a63041c..3a8880243b1f 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -298,7 +298,7 @@ static void ir_work(struct work_struct *work)
298static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) 298static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
299{ 299{
300 IR_KEYTAB_TYPE *ir_codes = NULL; 300 IR_KEYTAB_TYPE *ir_codes = NULL;
301 char *name; 301 const char *name;
302 int ir_type; 302 int ir_type;
303 struct IR_i2c *ir; 303 struct IR_i2c *ir;
304 struct input_dev *input_dev; 304 struct input_dev *input_dev;
@@ -386,6 +386,16 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
386 goto err_out_free; 386 goto err_out_free;
387 } 387 }
388 388
389 /* Let the caller override settings */
390 if (client->dev.platform_data) {
391 const struct IR_i2c_init_data *init_data =
392 client->dev.platform_data;
393
394 ir_codes = init_data->ir_codes;
395 name = init_data->name;
396 ir->get_key = init_data->get_key;
397 }
398
389 /* Sets name */ 399 /* Sets name */
390 snprintf(ir->name, sizeof(ir->name), "i2c IR (%s)", name); 400 snprintf(ir->name, sizeof(ir->name), "i2c IR (%s)", name);
391 ir->ir_codes = ir_codes; 401 ir->ir_codes = ir_codes;