From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>, linux-media@vger.kernel.org
Cc: Dariusz Marcinkiewicz <darekm@google.com>,
Sylwester Nawrocki <snawrocki@kernel.org>
Subject: Re: [PATCH 4/6] s5p-cec: use cec_notifier_cec_adap_(un)register
Date: Mon, 15 Jul 2019 14:37:47 +0200 [thread overview]
Message-ID: <88cfae9b-3722-f795-7882-e23b4447ba9b@samsung.com> (raw)
In-Reply-To: <20190715103054.84849-5-hverkuil-cisco@xs4all.nl>
Hi Hans,
On 2019-07-15 12:30, Hans Verkuil wrote:
> 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: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> Cc: Marek Szyprowski <m.szyprowski@samsung.com>
> Cc: Sylwester Nawrocki <snawrocki@kernel.org>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> drivers/media/platform/s5p-cec/s5p_cec.c | 23 ++++++++++++++---------
> 1 file changed, 14 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/media/platform/s5p-cec/s5p_cec.c b/drivers/media/platform/s5p-cec/s5p_cec.c
> index ea6231b387ed..6ddcc35b0bbd 100644
> --- a/drivers/media/platform/s5p-cec/s5p_cec.c
> +++ b/drivers/media/platform/s5p-cec/s5p_cec.c
> @@ -214,21 +214,23 @@ static int s5p_cec_probe(struct platform_device *pdev)
> if (IS_ERR(cec->reg))
> return PTR_ERR(cec->reg);
>
> - cec->notifier = cec_notifier_get(hdmi_dev);
> - if (cec->notifier == NULL)
> - return -ENOMEM;
> -
> cec->adap = cec_allocate_adapter(&s5p_cec_adap_ops, cec, CEC_NAME,
> - CEC_CAP_DEFAULTS | (needs_hpd ? CEC_CAP_NEEDS_HPD : 0), 1);
> + CEC_CAP_DEFAULTS | (needs_hpd ? CEC_CAP_NEEDS_HPD : 0) |
> + CEC_CAP_CONNECTOR_INFO, 1);
> ret = PTR_ERR_OR_ZERO(cec->adap);
> if (ret)
> return ret;
>
> - ret = cec_register_adapter(cec->adap, &pdev->dev);
> - if (ret)
> + cec->notifier = cec_notifier_cec_adap_register(hdmi_dev, NULL,
> + cec->adap);
> + if (!cec->notifier) {
> + ret = -ENOMEM;
> goto err_delete_adapter;
> + }
>
> - cec_register_cec_notifier(cec->adap, cec->notifier);
> + ret = cec_register_adapter(cec->adap, &pdev->dev);
> + if (ret)
> + goto err_notifier;
>
> platform_set_drvdata(pdev, cec);
> pm_runtime_enable(dev);
> @@ -236,6 +238,9 @@ static int s5p_cec_probe(struct platform_device *pdev)
> dev_dbg(dev, "successfully probed\n");
> return 0;
>
> +err_notifier:
> + cec_notifier_cec_adap_unregister(cec->notifier);
> +
> err_delete_adapter:
> cec_delete_adapter(cec->adap);
> return ret;
> @@ -245,8 +250,8 @@ static int s5p_cec_remove(struct platform_device *pdev)
> {
> struct s5p_cec_dev *cec = platform_get_drvdata(pdev);
>
> + cec_notifier_cec_adap_unregister(cec->notifier);
> cec_unregister_adapter(cec->adap);
> - cec_notifier_put(cec->notifier);
> pm_runtime_disable(&pdev->dev);
> return 0;
> }
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
next prev parent reply other threads:[~2019-07-15 12:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-15 10:30 [PATCH 0/6] media: use cec_notifier_cec_adap_(un)register Hans Verkuil
2019-07-15 10:30 ` [PATCH 1/6] meson/ao-cec: " Hans Verkuil
2019-07-15 10:30 ` [PATCH 2/6] cros-ec-cec: " Hans Verkuil
2019-07-20 9:25 ` [PATCHv2 " Hans Verkuil
2019-07-15 10:30 ` [PATCH 3/6] seco-cec: " Hans Verkuil
2019-07-15 10:30 ` [PATCH 4/6] s5p-cec: " Hans Verkuil
2019-07-15 12:37 ` Marek Szyprowski [this message]
2019-07-15 10:30 ` [PATCH 5/6] stih-cec: " Hans Verkuil
2019-07-15 10:30 ` [PATCH 6/6] tegra-cec: " Hans Verkuil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=88cfae9b-3722-f795-7882-e23b4447ba9b@samsung.com \
--to=m.szyprowski@samsung.com \
--cc=darekm@google.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=snawrocki@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).