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>
This commit is contained in:
Lars-Peter Clausen
2013-09-29 10:51:01 +02:00
committed by Wolfram Sang
parent c7110f375b
commit f9d32f2508
3 changed files with 9 additions and 9 deletions

View File

@@ -43,7 +43,7 @@
#define UNSET (-1U) #define UNSET (-1U)
#define PREFIX (t->i2c->driver->driver.name) #define PREFIX (t->i2c->dev.driver->name)
/* /*
* Driver modprobe parameters * Driver modprobe parameters
@@ -452,7 +452,7 @@ static void set_type(struct i2c_client *c, unsigned int type,
} }
tuner_dbg("%s %s I2C addr 0x%02x with type %d used for 0x%02x\n", tuner_dbg("%s %s I2C addr 0x%02x with type %d used for 0x%02x\n",
c->adapter->name, c->driver->driver.name, c->addr << 1, type, c->adapter->name, c->dev.driver->name, c->addr << 1, type,
t->mode_mask); t->mode_mask);
return; return;
@@ -556,7 +556,7 @@ static void tuner_lookup(struct i2c_adapter *adap,
int mode_mask; int mode_mask;
if (pos->i2c->adapter != adap || if (pos->i2c->adapter != adap ||
strcmp(pos->i2c->driver->driver.name, "tuner")) strcmp(pos->i2c->dev.driver->name, "tuner"))
continue; continue;
mode_mask = pos->mode_mask; mode_mask = pos->mode_mask;

View File

@@ -236,14 +236,14 @@ void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client,
v4l2_subdev_init(sd, ops); v4l2_subdev_init(sd, ops);
sd->flags |= V4L2_SUBDEV_FL_IS_I2C; sd->flags |= V4L2_SUBDEV_FL_IS_I2C;
/* the owner is the same as the i2c_client's driver owner */ /* the owner is the same as the i2c_client's driver owner */
sd->owner = client->driver->driver.owner; sd->owner = client->dev.driver->owner;
sd->dev = &client->dev; sd->dev = &client->dev;
/* i2c_client and v4l2_subdev point to one another */ /* i2c_client and v4l2_subdev point to one another */
v4l2_set_subdevdata(sd, client); v4l2_set_subdevdata(sd, client);
i2c_set_clientdata(client, sd); i2c_set_clientdata(client, sd);
/* initialize name */ /* initialize name */
snprintf(sd->name, sizeof(sd->name), "%s %d-%04x", snprintf(sd->name, sizeof(sd->name), "%s %d-%04x",
client->driver->driver.name, i2c_adapter_id(client->adapter), client->dev.driver->name, i2c_adapter_id(client->adapter),
client->addr); client->addr);
} }
EXPORT_SYMBOL_GPL(v4l2_i2c_subdev_init); EXPORT_SYMBOL_GPL(v4l2_i2c_subdev_init);
@@ -274,11 +274,11 @@ struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
loaded. This delay-load mechanism doesn't work if other drivers loaded. This delay-load mechanism doesn't work if other drivers
want to use the i2c device, so explicitly loading the module want to use the i2c device, so explicitly loading the module
is the best alternative. */ is the best alternative. */
if (client == NULL || client->driver == NULL) if (client == NULL || client->dev.driver == NULL)
goto error; goto error;
/* Lock the module so we can safely get the v4l2_subdev pointer */ /* Lock the module so we can safely get the v4l2_subdev pointer */
if (!try_module_get(client->driver->driver.owner)) if (!try_module_get(client->dev.driver->owner))
goto error; goto error;
sd = i2c_get_clientdata(client); sd = i2c_get_clientdata(client);
@@ -287,7 +287,7 @@ struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
if (v4l2_device_register_subdev(v4l2_dev, sd)) if (v4l2_device_register_subdev(v4l2_dev, sd))
sd = NULL; sd = NULL;
/* Decrease the module use count to match the first try_module_get. */ /* Decrease the module use count to match the first try_module_get. */
module_put(client->driver->driver.owner); module_put(client->dev.driver->owner);
error: error:
/* If we have a client but no subdev, then something went wrong and /* If we have a client but no subdev, then something went wrong and

View File

@@ -35,7 +35,7 @@
printk(level "%s %d-%04x: " fmt, name, i2c_adapter_id(adapter), addr , ## arg) printk(level "%s %d-%04x: " fmt, name, i2c_adapter_id(adapter), addr , ## arg)
#define v4l_client_printk(level, client, fmt, arg...) \ #define v4l_client_printk(level, client, fmt, arg...) \
v4l_printk(level, (client)->driver->driver.name, (client)->adapter, \ v4l_printk(level, (client)->dev.driver->name, (client)->adapter, \
(client)->addr, fmt , ## arg) (client)->addr, fmt , ## arg)
#define v4l_err(client, fmt, arg...) \ #define v4l_err(client, fmt, arg...) \