[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>
This commit is contained in:

committed by
Mauro Carvalho Chehab

parent
cf2113ca56
commit
f51e80804f
@@ -2631,9 +2631,10 @@ static int adv76xx_subscribe_event(struct v4l2_subdev *sd,
|
||||
static int adv76xx_registered(struct v4l2_subdev *sd)
|
||||
{
|
||||
struct adv76xx_state *state = to_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;
|
||||
@@ -3511,8 +3512,7 @@ static int adv76xx_probe(struct i2c_client *client,
|
||||
state->cec_adap = cec_allocate_adapter(&adv76xx_cec_adap_ops,
|
||||
state, dev_name(&client->dev),
|
||||
CEC_CAP_TRANSMIT | CEC_CAP_LOG_ADDRS |
|
||||
CEC_CAP_PASSTHROUGH | CEC_CAP_RC, ADV76XX_MAX_ADDRS,
|
||||
&client->dev);
|
||||
CEC_CAP_PASSTHROUGH | CEC_CAP_RC, ADV76XX_MAX_ADDRS);
|
||||
err = PTR_ERR_OR_ZERO(state->cec_adap);
|
||||
if (err)
|
||||
goto err_entity;
|
||||
|
Reference in New Issue
Block a user