Commit ebe15c76 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

media: tegra-cec: use cec_notifier_cec_adap_(un)register

Use cec_notifier_cec_adap_(un)register instead of
cec_notifier_get, cec_notifier_put and cec_register_cec_notifier.

Also enable the CEC_CAP_CONNECTOR_INFO capability.
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 72a171d7
...@@ -380,38 +380,39 @@ static int tegra_cec_probe(struct platform_device *pdev) ...@@ -380,38 +380,39 @@ static int tegra_cec_probe(struct platform_device *pdev)
if (ret) { if (ret) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"Unable to request interrupt for device\n"); "Unable to request interrupt for device\n");
goto clk_error; goto err_clk;
}
cec->notifier = cec_notifier_get(hdmi_dev);
if (!cec->notifier) {
ret = -ENOMEM;
goto clk_error;
} }
cec->adap = cec_allocate_adapter(&tegra_cec_ops, cec, TEGRA_CEC_NAME, cec->adap = cec_allocate_adapter(&tegra_cec_ops, cec, TEGRA_CEC_NAME,
CEC_CAP_DEFAULTS | CEC_CAP_MONITOR_ALL, CEC_CAP_DEFAULTS | CEC_CAP_MONITOR_ALL |
CEC_CAP_CONNECTOR_INFO,
CEC_MAX_LOG_ADDRS); CEC_MAX_LOG_ADDRS);
if (IS_ERR(cec->adap)) { if (IS_ERR(cec->adap)) {
ret = -ENOMEM; ret = -ENOMEM;
dev_err(&pdev->dev, "Couldn't create cec adapter\n"); dev_err(&pdev->dev, "Couldn't create cec adapter\n");
goto cec_error; goto err_clk;
}
cec->notifier = cec_notifier_cec_adap_register(hdmi_dev, NULL,
cec->adap);
if (!cec->notifier) {
ret = -ENOMEM;
goto err_adapter;
} }
ret = cec_register_adapter(cec->adap, &pdev->dev); ret = cec_register_adapter(cec->adap, &pdev->dev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Couldn't register device\n"); dev_err(&pdev->dev, "Couldn't register device\n");
goto cec_error; goto err_notifier;
} }
cec_register_cec_notifier(cec->adap, cec->notifier);
return 0; return 0;
cec_error: err_notifier:
if (cec->notifier) cec_notifier_cec_adap_unregister(cec->notifier);
cec_notifier_put(cec->notifier); err_adapter:
cec_delete_adapter(cec->adap); cec_delete_adapter(cec->adap);
clk_error: err_clk:
clk_disable_unprepare(cec->clk); clk_disable_unprepare(cec->clk);
return ret; return ret;
} }
...@@ -422,8 +423,8 @@ static int tegra_cec_remove(struct platform_device *pdev) ...@@ -422,8 +423,8 @@ static int tegra_cec_remove(struct platform_device *pdev)
clk_disable_unprepare(cec->clk); clk_disable_unprepare(cec->clk);
cec_notifier_cec_adap_unregister(cec->notifier);
cec_unregister_adapter(cec->adap); cec_unregister_adapter(cec->adap);
cec_notifier_put(cec->notifier);
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