All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
To: linux-media@vger.kernel.org
Cc: Dariusz Marcinkiewicz <darekm@google.com>,
	dri-devel@lists.freedesktop.org,
	Cheng-yi Chiang <cychiang@chromium.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>
Subject: [PATCHv8 08/13] dw-hdmi-cec: use cec_notifier_cec_adap_(un)register
Date: Mon, 24 Jun 2019 18:03:25 +0200	[thread overview]
Message-ID: <20190624160330.38048-9-hverkuil-cisco@xs4all.nl> (raw)
In-Reply-To: <20190624160330.38048-1-hverkuil-cisco@xs4all.nl>

From: Dariusz Marcinkiewicz <darekm@google.com>

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@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
index 6c323510f128..6f7ecacb7d1f 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
@@ -281,13 +281,14 @@ static int dw_hdmi_cec_probe(struct platform_device *pdev)
 	if (ret < 0)
 		return ret;
 
-	cec->notify = cec_notifier_get(pdev->dev.parent);
+	cec->notify = cec_notifier_cec_adap_register(pdev->dev.parent,
+						     NULL, cec->adap);
 	if (!cec->notify)
 		return -ENOMEM;
 
 	ret = cec_register_adapter(cec->adap, pdev->dev.parent);
 	if (ret < 0) {
-		cec_notifier_put(cec->notify);
+		cec_notifier_cec_adap_unregister(cec->notify);
 		return ret;
 	}
 
@@ -297,8 +298,6 @@ static int dw_hdmi_cec_probe(struct platform_device *pdev)
 	 */
 	devm_remove_action(&pdev->dev, dw_hdmi_cec_del, cec);
 
-	cec_register_cec_notifier(cec->adap, cec->notify);
-
 	return 0;
 }
 
@@ -306,8 +305,8 @@ static int dw_hdmi_cec_remove(struct platform_device *pdev)
 {
 	struct dw_hdmi_cec *cec = platform_get_drvdata(pdev);
 
+	cec_notifier_cec_adap_unregister(cec->notify);
 	cec_unregister_adapter(cec->adap);
-	cec_notifier_put(cec->notify);
 
 	return 0;
 }
-- 
2.20.1


WARNING: multiple messages have this Message-ID (diff)
From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
To: linux-media@vger.kernel.org
Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Dariusz Marcinkiewicz <darekm@google.com>,
	dri-devel@lists.freedesktop.org,
	Cheng-yi Chiang <cychiang@chromium.org>
Subject: [PATCHv8 08/13] dw-hdmi-cec: use cec_notifier_cec_adap_(un)register
Date: Mon, 24 Jun 2019 18:03:25 +0200	[thread overview]
Message-ID: <20190624160330.38048-9-hverkuil-cisco@xs4all.nl> (raw)
In-Reply-To: <20190624160330.38048-1-hverkuil-cisco@xs4all.nl>

From: Dariusz Marcinkiewicz <darekm@google.com>

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@google.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
index 6c323510f128..6f7ecacb7d1f 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c
@@ -281,13 +281,14 @@ static int dw_hdmi_cec_probe(struct platform_device *pdev)
 	if (ret < 0)
 		return ret;
 
-	cec->notify = cec_notifier_get(pdev->dev.parent);
+	cec->notify = cec_notifier_cec_adap_register(pdev->dev.parent,
+						     NULL, cec->adap);
 	if (!cec->notify)
 		return -ENOMEM;
 
 	ret = cec_register_adapter(cec->adap, pdev->dev.parent);
 	if (ret < 0) {
-		cec_notifier_put(cec->notify);
+		cec_notifier_cec_adap_unregister(cec->notify);
 		return ret;
 	}
 
@@ -297,8 +298,6 @@ static int dw_hdmi_cec_probe(struct platform_device *pdev)
 	 */
 	devm_remove_action(&pdev->dev, dw_hdmi_cec_del, cec);
 
-	cec_register_cec_notifier(cec->adap, cec->notify);
-
 	return 0;
 }
 
@@ -306,8 +305,8 @@ static int dw_hdmi_cec_remove(struct platform_device *pdev)
 {
 	struct dw_hdmi_cec *cec = platform_get_drvdata(pdev);
 
+	cec_notifier_cec_adap_unregister(cec->notify);
 	cec_unregister_adapter(cec->adap);
-	cec_notifier_put(cec->notify);
 
 	return 0;
 }
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2019-06-24 16:03 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24 16:03 [PATCHv8 00/13] cec: improve notifier support, add connector info Hans Verkuil
2019-06-24 16:03 ` Hans Verkuil
2019-06-24 16:03 ` [PATCHv8 01/13] cec-notifier: rename variable, check kstrdup Hans Verkuil
2019-06-24 16:03   ` Hans Verkuil
2019-06-25  7:07   ` [PATCHv8.1 01/13] cec-notifier: rename variables, check kstrdup and n->conn_name Hans Verkuil
2019-06-25  7:07     ` Hans Verkuil
2019-06-24 16:03 ` [PATCHv8 02/13] cec: add struct cec_connector_info support Hans Verkuil
2019-06-24 16:03   ` Hans Verkuil
2019-06-25  6:28   ` Hans Verkuil
2019-06-25  6:28     ` Hans Verkuil
2019-06-25 13:19   ` Dariusz Marcinkiewicz
2019-06-25 13:19     ` Dariusz Marcinkiewicz
2019-06-24 16:03 ` [PATCHv8 03/13] cec: add new notifier functions Hans Verkuil
2019-06-24 16:03   ` Hans Verkuil
2019-06-25 13:48   ` Dariusz Marcinkiewicz
2019-06-25 13:48     ` Dariusz Marcinkiewicz
2019-06-25 14:26     ` Hans Verkuil
2019-06-25 14:26       ` Hans Verkuil
2019-06-24 16:03 ` [PATCHv8 04/13] cec: expose the new connector info API Hans Verkuil
2019-06-24 16:03   ` Hans Verkuil
2019-06-25 13:59   ` Dariusz Marcinkiewicz
2019-06-25 13:59     ` Dariusz Marcinkiewicz
2019-06-25 14:28     ` Hans Verkuil
2019-06-25 14:28       ` Hans Verkuil
2019-06-24 16:03 ` [PATCHv8 05/13] cec: document CEC_ADAP_G_CONNECTOR_INFO Hans Verkuil
2019-06-24 16:03   ` Hans Verkuil
2019-06-24 16:03 ` [PATCHv8 06/13] drm_dp_cec: add connector info support Hans Verkuil
2019-06-24 16:03   ` Hans Verkuil
2019-06-24 16:03 ` [PATCHv8 07/13] drm/i915/intel_hdmi: use cec_notifier_conn_(un)register Hans Verkuil
2019-06-24 16:03   ` Hans Verkuil
2019-06-24 16:03 ` Hans Verkuil [this message]
2019-06-24 16:03   ` [PATCHv8 08/13] dw-hdmi-cec: use cec_notifier_cec_adap_(un)register Hans Verkuil
2019-06-24 16:03 ` [PATCHv8 09/13] dw-hdmi: use cec_notifier_conn_(un)register Hans Verkuil
2019-06-24 16:03   ` Hans Verkuil
2019-06-25  0:43   ` kbuild test robot
2019-06-25  0:43     ` kbuild test robot
2019-06-24 16:03 ` [PATCHv8 10/13] meson/ao-cec: use cec_notifier_cec_adap_(un)register Hans Verkuil
2019-06-24 16:03   ` Hans Verkuil
2019-06-24 16:03 ` [PATCHv8 11/13] tda9950: " Hans Verkuil
2019-06-24 16:03   ` Hans Verkuil
2019-06-24 16:03 ` [PATCHv8 12/13] tda998x: use cec_notifier_conn_(un)register Hans Verkuil
2019-06-24 16:03   ` Hans Verkuil
2019-06-24 22:37   ` kbuild test robot
2019-06-24 22:37     ` kbuild test robot
2019-06-24 16:03 ` [PATCHv8 13/13] drm/vc4/vc4_hdmi: fill in connector info Hans Verkuil
2019-06-24 16:03   ` 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=20190624160330.38048-9-hverkuil-cisco@xs4all.nl \
    --to=hverkuil-cisco@xs4all.nl \
    --cc=cychiang@chromium.org \
    --cc=darekm@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-media@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.