On 8/7/19 10:52 AM, Dariusz Marcinkiewicz wrote: > Use the new cec_notifier_cec_adap_(un)register() functions to > (un)register the notifier for the CEC adapter. > > Signed-off-by: Dariusz Marcinkiewicz <darekm@xxxxxxxxxx> > Signed-off-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx> Tested-by: Hans Verkuil <hverkuil-cisco@xxxxxxxxx> Tested with a BeagleBone Black board. Regards, Hans > --- > drivers/gpu/drm/i2c/tda9950.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/i2c/tda9950.c b/drivers/gpu/drm/i2c/tda9950.c > index 250b5e02a314a..e9f6171c47792 100644 > --- a/drivers/gpu/drm/i2c/tda9950.c > +++ b/drivers/gpu/drm/i2c/tda9950.c > @@ -423,7 +423,8 @@ static int tda9950_probe(struct i2c_client *client, > priv->hdmi = glue->parent; > > priv->adap = cec_allocate_adapter(&tda9950_cec_ops, priv, "tda9950", > - CEC_CAP_DEFAULTS, > + CEC_CAP_DEFAULTS | > + CEC_CAP_CONNECTOR_INFO, > CEC_MAX_LOG_ADDRS); > if (IS_ERR(priv->adap)) > return PTR_ERR(priv->adap); > @@ -460,13 +461,14 @@ static int tda9950_probe(struct i2c_client *client, > if (ret < 0) > return ret; > > - priv->notify = cec_notifier_get(priv->hdmi); > + priv->notify = cec_notifier_cec_adap_register(priv->hdmi, NULL, > + priv->adap); > if (!priv->notify) > return -ENOMEM; > > ret = cec_register_adapter(priv->adap, priv->hdmi); > if (ret < 0) { > - cec_notifier_put(priv->notify); > + cec_notifier_cec_adap_unregister(priv->notify); > return ret; > } > > @@ -476,8 +478,6 @@ static int tda9950_probe(struct i2c_client *client, > */ > devm_remove_action(dev, tda9950_cec_del, priv); > > - cec_register_cec_notifier(priv->adap, priv->notify); > - > return 0; > } > > @@ -485,8 +485,8 @@ static int tda9950_remove(struct i2c_client *client) > { > struct tda9950_priv *priv = i2c_get_clientdata(client); > > + cec_notifier_cec_adap_unregister(priv->notify); > cec_unregister_adapter(priv->adap); > - cec_notifier_put(priv->notify); > > return 0; > } >