From 3ee81b7aefcc4d5c031dcac5df8683cadc7b6ee2 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sun, 29 Sep 2013 10:51:02 +0200 Subject: drm: encoder_slave: 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. To get direct access to the i2c_driver struct use 'to_i2c_driver(client->dev.driver)'. Signed-off-by: Lars-Peter Clausen Signed-off-by: Wolfram Sang --- drivers/gpu/drm/drm_encoder_slave.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/gpu') diff --git a/drivers/gpu/drm/drm_encoder_slave.c b/drivers/gpu/drm/drm_encoder_slave.c index 0cfb60f54766..d18b88b755c3 100644 --- a/drivers/gpu/drm/drm_encoder_slave.c +++ b/drivers/gpu/drm/drm_encoder_slave.c @@ -67,12 +67,12 @@ int drm_i2c_encoder_init(struct drm_device *dev, goto fail; } - if (!client->driver) { + if (!client->dev.driver) { err = -ENODEV; goto fail_unregister; } - module = client->driver->driver.owner; + module = client->dev.driver->owner; if (!try_module_get(module)) { err = -ENODEV; goto fail_unregister; @@ -80,7 +80,7 @@ int drm_i2c_encoder_init(struct drm_device *dev, encoder->bus_priv = client; - encoder_drv = to_drm_i2c_encoder_driver(client->driver); + encoder_drv = to_drm_i2c_encoder_driver(to_i2c_driver(client->dev.driver)); err = encoder_drv->encoder_init(client, dev, encoder); if (err) @@ -111,7 +111,7 @@ void drm_i2c_encoder_destroy(struct drm_encoder *drm_encoder) { struct drm_encoder_slave *encoder = to_encoder_slave(drm_encoder); struct i2c_client *client = drm_i2c_encoder_get_client(drm_encoder); - struct module *module = client->driver->driver.owner; + struct module *module = client->dev.driver->owner; i2c_unregister_device(client); encoder->bus_priv = NULL; -- cgit v1.2.3 From 395c994264bba13b5de73d0a8da6842df8ac47bf Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sun, 29 Sep 2013 10:51:03 +0200 Subject: drm: nouveau: Don't use i2c_client->driver The 'driver' field of the i2c_client struct is redundant and is going to be removed. Use 'to_i2c_driver(client->dev.driver)' instead to get direct access to the i2c_driver struct. Signed-off-by: Lars-Peter Clausen Cc: Martin Peres Signed-off-by: Wolfram Sang --- drivers/gpu/drm/nouveau/core/subdev/therm/ic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/gpu') diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/ic.c b/drivers/gpu/drm/nouveau/core/subdev/therm/ic.c index 8b3adec5fbb1..eae939d3fc1a 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/therm/ic.c +++ b/drivers/gpu/drm/nouveau/core/subdev/therm/ic.c @@ -41,7 +41,8 @@ probe_monitoring_device(struct nouveau_i2c_port *i2c, if (!client) return false; - if (!client->driver || client->driver->detect(client, info)) { + if (!client->dev.driver || + to_i2c_driver(client->dev.driver)->detect(client, info)) { i2c_unregister_device(client); return false; } -- cgit v1.2.3