summaryrefslogtreecommitdiff
path: root/drivers/media/i2c/adv7511.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2016-11-25 06:23:34 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-11-29 12:07:17 -0200
commitf51e80804f084de269954d875c0892b081b7df3c (patch)
treecc8711c8323e5ff7fb69599b7dc2aa88c9fd438e /drivers/media/i2c/adv7511.c
parentcf2113ca563191a9ee5943561827e50ad8cda4e0 (diff)
downloadlwn-f51e80804f084de269954d875c0892b081b7df3c.tar.gz
lwn-f51e80804f084de269954d875c0892b081b7df3c.zip
[media] cec: pass parent device in register(), not allocate()
The cec_allocate_adapter function doesn't need the parent device, only the cec_register_adapter function needs it. Drop the cec_devnode parent field, since devnode.dev.parent can be used instead. This change makes the framework consistent with other frameworks where the parent device is not used until the device is registered. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/i2c/adv7511.c')
-rw-r--r--drivers/media/i2c/adv7511.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/i2c/adv7511.c b/drivers/media/i2c/adv7511.c
index 5ba0f21bcfe4..8c9e28949ab1 100644
--- a/drivers/media/i2c/adv7511.c
+++ b/drivers/media/i2c/adv7511.c
@@ -1732,9 +1732,10 @@ static bool adv7511_check_edid_status(struct v4l2_subdev *sd)
static int adv7511_registered(struct v4l2_subdev *sd)
{
struct adv7511_state *state = get_adv7511_state(sd);
+ struct i2c_client *client = v4l2_get_subdevdata(sd);
int err;
- err = cec_register_adapter(state->cec_adap);
+ err = cec_register_adapter(state->cec_adap, &client->dev);
if (err)
cec_delete_adapter(state->cec_adap);
return err;
@@ -1928,7 +1929,7 @@ static int adv7511_probe(struct i2c_client *client, const struct i2c_device_id *
state->cec_adap = cec_allocate_adapter(&adv7511_cec_adap_ops,
state, dev_name(&client->dev), CEC_CAP_TRANSMIT |
CEC_CAP_LOG_ADDRS | CEC_CAP_PASSTHROUGH | CEC_CAP_RC,
- ADV7511_MAX_ADDRS, &client->dev);
+ ADV7511_MAX_ADDRS);
err = PTR_ERR_OR_ZERO(state->cec_adap);
if (err) {
destroy_workqueue(state->work_queue);