Commit e5ef909c authored by Dariusz Marcinkiewicz's avatar Dariusz Marcinkiewicz Committed by Hans Verkuil

tda9950: use cec_notifier_cec_adap_(un)register

Use the new cec_notifier_cec_adap_(un)register() functions to
(un)register the notifier for the CEC adapter.
Signed-off-by: default avatarDariusz Marcinkiewicz <darekm@google.com>
Tested-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Link: https://patchwork.freedesktop.org/patch/msgid/20190814104520.6001-5-darekm@google.com
parent 71137bfd
...@@ -420,7 +420,8 @@ static int tda9950_probe(struct i2c_client *client, ...@@ -420,7 +420,8 @@ static int tda9950_probe(struct i2c_client *client,
priv->hdmi = glue->parent; priv->hdmi = glue->parent;
priv->adap = cec_allocate_adapter(&tda9950_cec_ops, priv, "tda9950", priv->adap = cec_allocate_adapter(&tda9950_cec_ops, priv, "tda9950",
CEC_CAP_DEFAULTS, CEC_CAP_DEFAULTS |
CEC_CAP_CONNECTOR_INFO,
CEC_MAX_LOG_ADDRS); CEC_MAX_LOG_ADDRS);
if (IS_ERR(priv->adap)) if (IS_ERR(priv->adap))
return PTR_ERR(priv->adap); return PTR_ERR(priv->adap);
...@@ -457,13 +458,14 @@ static int tda9950_probe(struct i2c_client *client, ...@@ -457,13 +458,14 @@ static int tda9950_probe(struct i2c_client *client,
if (ret < 0) if (ret < 0)
return ret; return ret;
priv->notify = cec_notifier_get(priv->hdmi); priv->notify = cec_notifier_cec_adap_register(priv->hdmi, NULL,
priv->adap);
if (!priv->notify) if (!priv->notify)
return -ENOMEM; return -ENOMEM;
ret = cec_register_adapter(priv->adap, priv->hdmi); ret = cec_register_adapter(priv->adap, priv->hdmi);
if (ret < 0) { if (ret < 0) {
cec_notifier_put(priv->notify); cec_notifier_cec_adap_unregister(priv->notify);
return ret; return ret;
} }
...@@ -473,8 +475,6 @@ static int tda9950_probe(struct i2c_client *client, ...@@ -473,8 +475,6 @@ static int tda9950_probe(struct i2c_client *client,
*/ */
devm_remove_action(dev, tda9950_cec_del, priv); devm_remove_action(dev, tda9950_cec_del, priv);
cec_register_cec_notifier(priv->adap, priv->notify);
return 0; return 0;
} }
...@@ -482,8 +482,8 @@ static int tda9950_remove(struct i2c_client *client) ...@@ -482,8 +482,8 @@ static int tda9950_remove(struct i2c_client *client)
{ {
struct tda9950_priv *priv = i2c_get_clientdata(client); struct tda9950_priv *priv = i2c_get_clientdata(client);
cec_notifier_cec_adap_unregister(priv->notify);
cec_unregister_adapter(priv->adap); cec_unregister_adapter(priv->adap);
cec_notifier_put(priv->notify);
return 0; return 0;
} }
......
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