From: Neil Armstrong <narmstrong@baylibre.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>, linux-media@vger.kernel.org
Cc: Sylwester Nawrocki <snawrocki@kernel.org>,
Benjamin Gaignard <benjamin.gaignard@linaro.org>,
Thierry Reding <treding@nvidia.com>,
Ettore Chimenti <ek5.chimenti@gmail.com>,
Wen Yang <wen.yang99@zte.com.cn>
Subject: Re: [PATCH 2/7] meson: ao-cec: use new cec_notifier_find_hdmi_dev helper
Date: Mon, 8 Apr 2019 14:01:09 +0200 [thread overview]
Message-ID: <8eae3329-4fde-9a24-8b15-b623e5de5cb0@baylibre.com> (raw)
In-Reply-To: <20190408110401.3345-3-hverkuil-cisco@xs4all.nl>
On 08/04/2019 13:03, Hans Verkuil wrote:
> The meson CEC driver increased the HDMI device refcount when
> it shouldn't. Use the new helper function to ensure that that
> doesn't happen and to simplify the driver code.
>
> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> ---
> drivers/media/platform/meson/ao-cec.c | 16 +++++-----------
> 1 file changed, 5 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/media/platform/meson/ao-cec.c b/drivers/media/platform/meson/ao-cec.c
> index cd4be38ab5ac..c8b374741a7c 100644
> --- a/drivers/media/platform/meson/ao-cec.c
> +++ b/drivers/media/platform/meson/ao-cec.c
> @@ -601,20 +601,14 @@ static const struct cec_adap_ops meson_ao_cec_ops = {
> static int meson_ao_cec_probe(struct platform_device *pdev)
> {
> struct meson_ao_cec_device *ao_cec;
> - struct platform_device *hdmi_dev;
> - struct device_node *np;
> + struct device *hdmi_dev;
> struct resource *res;
> int ret, irq;
>
> - np = of_parse_phandle(pdev->dev.of_node, "hdmi-phandle", 0);
> - if (!np) {
> - dev_err(&pdev->dev, "Failed to find hdmi node\n");
> - return -ENODEV;
> - }
> + hdmi_dev = cec_notifier_find_hdmi_dev(&pdev->dev);
>
> - hdmi_dev = of_find_device_by_node(np);
> - if (hdmi_dev == NULL)
> - return -EPROBE_DEFER;
> + if (IS_ERR(hdmi_dev))
> + return PTR_ERR(hdmi_dev);
>
> ao_cec = devm_kzalloc(&pdev->dev, sizeof(*ao_cec), GFP_KERNEL);
> if (!ao_cec)
> @@ -622,7 +616,7 @@ static int meson_ao_cec_probe(struct platform_device *pdev)
>
> spin_lock_init(&ao_cec->cec_reg_lock);
>
> - ao_cec->notify = cec_notifier_get(&hdmi_dev->dev);
> + ao_cec->notify = cec_notifier_get(hdmi_dev);
> if (!ao_cec->notify)
> return -ENOMEM;
>
>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Thanks,
Neil
next prev parent reply other threads:[~2019-04-08 12:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-08 11:03 [PATCH 0/7] cec: introduce cec_notifier_find_hdmi_dev helper Hans Verkuil
2019-04-08 11:03 ` [PATCH 1/7] cec-notifier: add " Hans Verkuil
2019-04-08 13:09 ` Thierry Reding
2019-04-08 13:17 ` Hans Verkuil
2019-04-08 11:03 ` [PATCH 2/7] meson: ao-cec: use new " Hans Verkuil
2019-04-08 12:01 ` Neil Armstrong [this message]
2019-04-08 11:03 ` [PATCH 3/7] s5p_cec: " Hans Verkuil
2019-04-08 11:03 ` [PATCH 4/7] stih_cec: " Hans Verkuil
2019-04-08 12:44 ` Benjamin Gaignard
2019-04-08 11:03 ` [PATCH 5/7] tegra_cec: " Hans Verkuil
2019-04-08 11:04 ` [PATCH 6/7] seco-cec: decrement HDMI device refcount Hans Verkuil
2019-04-08 13:21 ` Ettore Chimenti
2019-04-08 11:04 ` [PATCH 7/7] cros-ec-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=8eae3329-4fde-9a24-8b15-b623e5de5cb0@baylibre.com \
--to=narmstrong@baylibre.com \
--cc=benjamin.gaignard@linaro.org \
--cc=ek5.chimenti@gmail.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=snawrocki@kernel.org \
--cc=treding@nvidia.com \
--cc=wen.yang99@zte.com.cn \
/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