aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2013-09-29 04:51:01 -0400
committerWolfram Sang <wsa@the-dreams.de>2013-10-03 16:28:23 -0400
commitf9d32f25084ce7a27f966a0e71eae6ee0fe2f5ab (patch)
tree22836c5809b5c05b8fae96f41ba1d76f9a8cb720
parentc7110f375be6609e9130c684aeda75bcfb771289 (diff)
media: core: Don't use i2c_client->driver
The 'driver' field of the i2c_client struct is redundant and is going to be removed. The results of the expressions 'client->driver.driver->field' and 'client->dev.driver->field' are identical, so replace all occurrences of the former with the later. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
-rw-r--r--drivers/media/v4l2-core/tuner-core.c6
-rw-r--r--drivers/media/v4l2-core/v4l2-common.c10
-rw-r--r--include/media/v4l2-common.h2
3 files changed, 9 insertions, 9 deletions
diff --git a/drivers/media/v4l2-core/tuner-core.c b/drivers/media/v4l2-core/tuner-core.c
index ddc9379eb276..4133af01774a 100644
--- a/drivers/media/v4l2-core/tuner-core.c
+++ b/drivers/media/v4l2-core/tuner-core.c
@@ -43,7 +43,7 @@
43 43
44#define UNSET (-1U) 44#define UNSET (-1U)
45 45
46#define PREFIX (t->i2c->driver->driver.name) 46#define PREFIX (t->i2c->dev.driver->name)
47 47
48/* 48/*
49 * Driver modprobe parameters 49 * Driver modprobe parameters
@@ -452,7 +452,7 @@ static void set_type(struct i2c_client *c, unsigned int type,
452 } 452 }
453 453
454 tuner_dbg("%s %s I2C addr 0x%02x with type %d used for 0x%02x\n", 454 tuner_dbg("%s %s I2C addr 0x%02x with type %d used for 0x%02x\n",
455 c->adapter->name, c->driver->driver.name, c->addr << 1, type, 455 c->adapter->name, c->dev.driver->name, c->addr << 1, type,
456 t->mode_mask); 456 t->mode_mask);
457 return; 457 return;
458 458
@@ -556,7 +556,7 @@ static void tuner_lookup(struct i2c_adapter *adap,
556 int mode_mask; 556 int mode_mask;
557 557
558 if (pos->i2c->adapter != adap || 558 if (pos->i2c->adapter != adap ||
559 strcmp(pos->i2c->driver->driver.name, "tuner")) 559 strcmp(pos->i2c->dev.driver->name, "tuner"))
560 continue; 560 continue;
561 561
562 mode_mask = pos->mode_mask; 562 mode_mask = pos->mode_mask;
diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c
index 037d7a55aa8c..433d6d77942e 100644
--- a/drivers/media/v4l2-core/v4l2-common.c
+++ b/drivers/media/v4l2-core/v4l2-common.c
@@ -236,14 +236,14 @@ void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client,
236 v4l2_subdev_init(sd, ops); 236 v4l2_subdev_init(sd, ops);
237 sd->flags |= V4L2_SUBDEV_FL_IS_I2C; 237 sd->flags |= V4L2_SUBDEV_FL_IS_I2C;
238 /* the owner is the same as the i2c_client's driver owner */ 238 /* the owner is the same as the i2c_client's driver owner */
239 sd->owner = client->driver->driver.owner; 239 sd->owner = client->dev.driver->owner;
240 sd->dev = &client->dev; 240 sd->dev = &client->dev;
241 /* i2c_client and v4l2_subdev point to one another */ 241 /* i2c_client and v4l2_subdev point to one another */
242 v4l2_set_subdevdata(sd, client); 242 v4l2_set_subdevdata(sd, client);
243 i2c_set_clientdata(client, sd); 243 i2c_set_clientdata(client, sd);
244 /* initialize name */ 244 /* initialize name */
245 snprintf(sd->name, sizeof(sd->name), "%s %d-%04x", 245 snprintf(sd->name, sizeof(sd->name), "%s %d-%04x",
246 client->driver->driver.name, i2c_adapter_id(client->adapter), 246 client->dev.driver->name, i2c_adapter_id(client->adapter),
247 client->addr); 247 client->addr);
248} 248}
249EXPORT_SYMBOL_GPL(v4l2_i2c_subdev_init); 249EXPORT_SYMBOL_GPL(v4l2_i2c_subdev_init);
@@ -274,11 +274,11 @@ struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
274 loaded. This delay-load mechanism doesn't work if other drivers 274 loaded. This delay-load mechanism doesn't work if other drivers
275 want to use the i2c device, so explicitly loading the module 275 want to use the i2c device, so explicitly loading the module
276 is the best alternative. */ 276 is the best alternative. */
277 if (client == NULL || client->driver == NULL) 277 if (client == NULL || client->dev.driver == NULL)
278 goto error; 278 goto error;
279 279
280 /* Lock the module so we can safely get the v4l2_subdev pointer */ 280 /* Lock the module so we can safely get the v4l2_subdev pointer */
281 if (!try_module_get(client->driver->driver.owner)) 281 if (!try_module_get(client->dev.driver->owner))
282 goto error; 282 goto error;
283 sd = i2c_get_clientdata(client); 283 sd = i2c_get_clientdata(client);
284 284
@@ -287,7 +287,7 @@ struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
287 if (v4l2_device_register_subdev(v4l2_dev, sd)) 287 if (v4l2_device_register_subdev(v4l2_dev, sd))
288 sd = NULL; 288 sd = NULL;
289 /* Decrease the module use count to match the first try_module_get. */ 289 /* Decrease the module use count to match the first try_module_get. */
290 module_put(client->driver->driver.owner); 290 module_put(client->dev.driver->owner);
291 291
292error: 292error:
293 /* If we have a client but no subdev, then something went wrong and 293 /* If we have a client but no subdev, then something went wrong and
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 16550c439008..a707529841e2 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -35,7 +35,7 @@
35 printk(level "%s %d-%04x: " fmt, name, i2c_adapter_id(adapter), addr , ## arg) 35 printk(level "%s %d-%04x: " fmt, name, i2c_adapter_id(adapter), addr , ## arg)
36 36
37#define v4l_client_printk(level, client, fmt, arg...) \ 37#define v4l_client_printk(level, client, fmt, arg...) \
38 v4l_printk(level, (client)->driver->driver.name, (client)->adapter, \ 38 v4l_printk(level, (client)->dev.driver->name, (client)->adapter, \
39 (client)->addr, fmt , ## arg) 39 (client)->addr, fmt , ## arg)
40 40
41#define v4l_err(client, fmt, arg...) \ 41#define v4l_err(client, fmt, arg...) \