Commit 3ee81b7a authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Wolfram Sang

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: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent f9d32f25
...@@ -67,12 +67,12 @@ int drm_i2c_encoder_init(struct drm_device *dev, ...@@ -67,12 +67,12 @@ int drm_i2c_encoder_init(struct drm_device *dev,
goto fail; goto fail;
} }
if (!client->driver) { if (!client->dev.driver) {
err = -ENODEV; err = -ENODEV;
goto fail_unregister; goto fail_unregister;
} }
module = client->driver->driver.owner; module = client->dev.driver->owner;
if (!try_module_get(module)) { if (!try_module_get(module)) {
err = -ENODEV; err = -ENODEV;
goto fail_unregister; goto fail_unregister;
...@@ -80,7 +80,7 @@ int drm_i2c_encoder_init(struct drm_device *dev, ...@@ -80,7 +80,7 @@ int drm_i2c_encoder_init(struct drm_device *dev,
encoder->bus_priv = client; 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); err = encoder_drv->encoder_init(client, dev, encoder);
if (err) if (err)
...@@ -111,7 +111,7 @@ void drm_i2c_encoder_destroy(struct drm_encoder *drm_encoder) ...@@ -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 drm_encoder_slave *encoder = to_encoder_slave(drm_encoder);
struct i2c_client *client = drm_i2c_encoder_get_client(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); i2c_unregister_device(client);
encoder->bus_priv = NULL; encoder->bus_priv = NULL;
......
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