linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] Add cec_get_drvdata()
@ 2017-03-24 16:47 Jose Abreu
  2017-03-24 16:47 ` [PATCH 1/8] [media] cec: " Jose Abreu
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Jose Abreu @ 2017-03-24 16:47 UTC (permalink / raw)
  To: linux-media; +Cc: hans.verkuil, mchehab, linux-kernel, Jose Abreu

Hi,

This series introduces a new helper function called cec_get_drvdata() which
returns the adapter private data and can be used by drivers that use CEC.

Best regards,
Jose Miguel Abreu

Jose Abreu (8):
  [media] cec: Add cec_get_drvdata()
  [media] staging: st-cec: Use cec_get_drvdata()
  [media] staging: s5p-cec: Use cec_get_drvdata()
  [media] i2c: adv7511: Use cec_get_drvdata()
  [media] i2c: adv7604: Use cec_get_drvdata()
  [media] i2c: adv7842: Use cec_get_drvdata()
  [media] usb: pulse8-cec: Use cec_get_drvdata()
  [media] platform: vivid: Use cec_get_drvdata()

 drivers/media/i2c/adv7511.c               | 6 +++---
 drivers/media/i2c/adv7604.c               | 6 +++---
 drivers/media/i2c/adv7842.c               | 6 +++---
 drivers/media/platform/vivid/vivid-cec.c  | 4 ++--
 drivers/media/usb/pulse8-cec/pulse8-cec.c | 6 +++---
 drivers/staging/media/s5p-cec/s5p_cec.c   | 6 +++---
 drivers/staging/media/st-cec/stih-cec.c   | 6 +++---
 include/media/cec.h                       | 5 +++++
 8 files changed, 25 insertions(+), 20 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/8] [media] cec: Add cec_get_drvdata()
  2017-03-24 16:47 [PATCH 0/8] Add cec_get_drvdata() Jose Abreu
@ 2017-03-24 16:47 ` Jose Abreu
  2017-03-24 16:47 ` [PATCH 2/8] [media] staging: st-cec: Use cec_get_drvdata() Jose Abreu
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Jose Abreu @ 2017-03-24 16:47 UTC (permalink / raw)
  To: linux-media; +Cc: hans.verkuil, mchehab, linux-kernel, Jose Abreu

Add a helper function to get driver private data from CEC
adapter. This helps the readability a little bit and allows
to change the 'priv' field name to something else without
needing to touch all drivers.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
---
 include/media/cec.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/media/cec.h b/include/media/cec.h
index 96a0aa7..0daff8c 100644
--- a/include/media/cec.h
+++ b/include/media/cec.h
@@ -184,6 +184,11 @@ struct cec_adapter {
 	char input_drv[32];
 };
 
+static inline void *cec_get_drvdata(const struct cec_adapter *adap)
+{
+	return adap->priv;
+}
+
 static inline bool cec_has_log_addr(const struct cec_adapter *adap, u8 log_addr)
 {
 	return adap->log_addrs.log_addr_mask & (1 << log_addr);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/8] [media] staging: st-cec: Use cec_get_drvdata()
  2017-03-24 16:47 [PATCH 0/8] Add cec_get_drvdata() Jose Abreu
  2017-03-24 16:47 ` [PATCH 1/8] [media] cec: " Jose Abreu
@ 2017-03-24 16:47 ` Jose Abreu
  2017-03-28  9:17   ` Benjamin Gaignard
  2017-03-24 16:47 ` [PATCH 3/8] [media] staging: s5p-cec: " Jose Abreu
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 11+ messages in thread
From: Jose Abreu @ 2017-03-24 16:47 UTC (permalink / raw)
  To: linux-media
  Cc: hans.verkuil, mchehab, linux-kernel, Jose Abreu, Benjamin Gaignard

Use helper function to get driver private data from CEC
adapter.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
---
 drivers/staging/media/st-cec/stih-cec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/st-cec/stih-cec.c b/drivers/staging/media/st-cec/stih-cec.c
index 3c25638..521206d 100644
--- a/drivers/staging/media/st-cec/stih-cec.c
+++ b/drivers/staging/media/st-cec/stih-cec.c
@@ -133,7 +133,7 @@ struct stih_cec {
 
 static int stih_cec_adap_enable(struct cec_adapter *adap, bool enable)
 {
-	struct stih_cec *cec = adap->priv;
+	struct stih_cec *cec = cec_get_drvdata(adap);
 
 	if (enable) {
 		/* The doc says (input TCLK_PERIOD * CEC_CLK_DIV) = 0.1ms */
@@ -189,7 +189,7 @@ static int stih_cec_adap_enable(struct cec_adapter *adap, bool enable)
 
 static int stih_cec_adap_log_addr(struct cec_adapter *adap, u8 logical_addr)
 {
-	struct stih_cec *cec = adap->priv;
+	struct stih_cec *cec = cec_get_drvdata(adap);
 	u32 reg = readl(cec->regs + CEC_ADDR_TABLE);
 
 	reg |= 1 << logical_addr;
@@ -205,7 +205,7 @@ static int stih_cec_adap_log_addr(struct cec_adapter *adap, u8 logical_addr)
 static int stih_cec_adap_transmit(struct cec_adapter *adap, u8 attempts,
 				  u32 signal_free_time, struct cec_msg *msg)
 {
-	struct stih_cec *cec = adap->priv;
+	struct stih_cec *cec = cec_get_drvdata(adap);
 	int i;
 
 	/* Copy message into registers */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/8] [media] staging: s5p-cec: Use cec_get_drvdata()
  2017-03-24 16:47 [PATCH 0/8] Add cec_get_drvdata() Jose Abreu
  2017-03-24 16:47 ` [PATCH 1/8] [media] cec: " Jose Abreu
  2017-03-24 16:47 ` [PATCH 2/8] [media] staging: st-cec: Use cec_get_drvdata() Jose Abreu
@ 2017-03-24 16:47 ` Jose Abreu
  2017-03-24 16:47 ` [PATCH 4/8] [media] i2c: adv7511: " Jose Abreu
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Jose Abreu @ 2017-03-24 16:47 UTC (permalink / raw)
  To: linux-media; +Cc: hans.verkuil, mchehab, linux-kernel, Jose Abreu, Kamil Debski

Use helper function to get driver private data from CEC
adapter.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Kamil Debski <kamil@wypas.org>
---
 drivers/staging/media/s5p-cec/s5p_cec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/s5p-cec/s5p_cec.c b/drivers/staging/media/s5p-cec/s5p_cec.c
index 2a07968..a30b80a 100644
--- a/drivers/staging/media/s5p-cec/s5p_cec.c
+++ b/drivers/staging/media/s5p-cec/s5p_cec.c
@@ -37,7 +37,7 @@
 
 static int s5p_cec_adap_enable(struct cec_adapter *adap, bool enable)
 {
-	struct s5p_cec_dev *cec = adap->priv;
+	struct s5p_cec_dev *cec = cec_get_drvdata(adap);
 
 	if (enable) {
 		pm_runtime_get_sync(cec->dev);
@@ -61,7 +61,7 @@ static int s5p_cec_adap_enable(struct cec_adapter *adap, bool enable)
 
 static int s5p_cec_adap_log_addr(struct cec_adapter *adap, u8 addr)
 {
-	struct s5p_cec_dev *cec = adap->priv;
+	struct s5p_cec_dev *cec = cec_get_drvdata(adap);
 
 	s5p_cec_set_addr(cec, addr);
 	return 0;
@@ -70,7 +70,7 @@ static int s5p_cec_adap_log_addr(struct cec_adapter *adap, u8 addr)
 static int s5p_cec_adap_transmit(struct cec_adapter *adap, u8 attempts,
 				 u32 signal_free_time, struct cec_msg *msg)
 {
-	struct s5p_cec_dev *cec = adap->priv;
+	struct s5p_cec_dev *cec = cec_get_drvdata(adap);
 
 	/*
 	 * Unclear if 0 retries are allowed by the hardware, so have 1 as
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/8] [media] i2c: adv7511: Use cec_get_drvdata()
  2017-03-24 16:47 [PATCH 0/8] Add cec_get_drvdata() Jose Abreu
                   ` (2 preceding siblings ...)
  2017-03-24 16:47 ` [PATCH 3/8] [media] staging: s5p-cec: " Jose Abreu
@ 2017-03-24 16:47 ` Jose Abreu
  2017-03-24 16:47 ` [PATCH 5/8] [media] i2c: adv7604: " Jose Abreu
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Jose Abreu @ 2017-03-24 16:47 UTC (permalink / raw)
  To: linux-media; +Cc: hans.verkuil, mchehab, linux-kernel, Jose Abreu

Use helper function to get driver private data from CEC
adapter.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/i2c/adv7511.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/i2c/adv7511.c b/drivers/media/i2c/adv7511.c
index 8c9e289..ccc4786 100644
--- a/drivers/media/i2c/adv7511.c
+++ b/drivers/media/i2c/adv7511.c
@@ -734,7 +734,7 @@ static int adv7511_s_power(struct v4l2_subdev *sd, int on)
 #if IS_ENABLED(CONFIG_VIDEO_ADV7511_CEC)
 static int adv7511_cec_adap_enable(struct cec_adapter *adap, bool enable)
 {
-	struct adv7511_state *state = adap->priv;
+	struct adv7511_state *state = cec_get_drvdata(adap);
 	struct v4l2_subdev *sd = &state->sd;
 
 	if (state->i2c_cec == NULL)
@@ -769,7 +769,7 @@ static int adv7511_cec_adap_enable(struct cec_adapter *adap, bool enable)
 
 static int adv7511_cec_adap_log_addr(struct cec_adapter *adap, u8 addr)
 {
-	struct adv7511_state *state = adap->priv;
+	struct adv7511_state *state = cec_get_drvdata(adap);
 	struct v4l2_subdev *sd = &state->sd;
 	unsigned int i, free_idx = ADV7511_MAX_ADDRS;
 
@@ -824,7 +824,7 @@ static int adv7511_cec_adap_log_addr(struct cec_adapter *adap, u8 addr)
 static int adv7511_cec_adap_transmit(struct cec_adapter *adap, u8 attempts,
 				     u32 signal_free_time, struct cec_msg *msg)
 {
-	struct adv7511_state *state = adap->priv;
+	struct adv7511_state *state = cec_get_drvdata(adap);
 	struct v4l2_subdev *sd = &state->sd;
 	u8 len = msg->len;
 	unsigned int i;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 5/8] [media] i2c: adv7604: Use cec_get_drvdata()
  2017-03-24 16:47 [PATCH 0/8] Add cec_get_drvdata() Jose Abreu
                   ` (3 preceding siblings ...)
  2017-03-24 16:47 ` [PATCH 4/8] [media] i2c: adv7511: " Jose Abreu
@ 2017-03-24 16:47 ` Jose Abreu
  2017-03-24 16:47 ` [PATCH 6/8] [media] i2c: adv7842: " Jose Abreu
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Jose Abreu @ 2017-03-24 16:47 UTC (permalink / raw)
  To: linux-media; +Cc: hans.verkuil, mchehab, linux-kernel, Jose Abreu

Use helper function to get driver private data from CEC
adapter.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/i2c/adv7604.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index d8bf435..f1fa9ce 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -2050,7 +2050,7 @@ static void adv76xx_cec_isr(struct v4l2_subdev *sd, bool *handled)
 
 static int adv76xx_cec_adap_enable(struct cec_adapter *adap, bool enable)
 {
-	struct adv76xx_state *state = adap->priv;
+	struct adv76xx_state *state = cec_get_drvdata(adap);
 	struct v4l2_subdev *sd = &state->sd;
 
 	if (!state->cec_enabled_adap && enable) {
@@ -2080,7 +2080,7 @@ static int adv76xx_cec_adap_enable(struct cec_adapter *adap, bool enable)
 
 static int adv76xx_cec_adap_log_addr(struct cec_adapter *adap, u8 addr)
 {
-	struct adv76xx_state *state = adap->priv;
+	struct adv76xx_state *state = cec_get_drvdata(adap);
 	struct v4l2_subdev *sd = &state->sd;
 	unsigned int i, free_idx = ADV76XX_MAX_ADDRS;
 
@@ -2135,7 +2135,7 @@ static int adv76xx_cec_adap_log_addr(struct cec_adapter *adap, u8 addr)
 static int adv76xx_cec_adap_transmit(struct cec_adapter *adap, u8 attempts,
 				     u32 signal_free_time, struct cec_msg *msg)
 {
-	struct adv76xx_state *state = adap->priv;
+	struct adv76xx_state *state = cec_get_drvdata(adap);
 	struct v4l2_subdev *sd = &state->sd;
 	u8 len = msg->len;
 	unsigned int i;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 6/8] [media] i2c: adv7842: Use cec_get_drvdata()
  2017-03-24 16:47 [PATCH 0/8] Add cec_get_drvdata() Jose Abreu
                   ` (4 preceding siblings ...)
  2017-03-24 16:47 ` [PATCH 5/8] [media] i2c: adv7604: " Jose Abreu
@ 2017-03-24 16:47 ` Jose Abreu
  2017-03-24 16:47 ` [PATCH 7/8] [media] usb: pulse8-cec: " Jose Abreu
  2017-03-24 16:47 ` [PATCH 8/8] [media] platform: vivid: " Jose Abreu
  7 siblings, 0 replies; 11+ messages in thread
From: Jose Abreu @ 2017-03-24 16:47 UTC (permalink / raw)
  To: linux-media; +Cc: hans.verkuil, mchehab, linux-kernel, Jose Abreu

Use helper function to get driver private data from CEC
adapter.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/i2c/adv7842.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c
index 2d61f0c..303effd 100644
--- a/drivers/media/i2c/adv7842.c
+++ b/drivers/media/i2c/adv7842.c
@@ -2250,7 +2250,7 @@ static void adv7842_cec_isr(struct v4l2_subdev *sd, bool *handled)
 
 static int adv7842_cec_adap_enable(struct cec_adapter *adap, bool enable)
 {
-	struct adv7842_state *state = adap->priv;
+	struct adv7842_state *state = cec_get_drvdata(adap);
 	struct v4l2_subdev *sd = &state->sd;
 
 	if (!state->cec_enabled_adap && enable) {
@@ -2279,7 +2279,7 @@ static int adv7842_cec_adap_enable(struct cec_adapter *adap, bool enable)
 
 static int adv7842_cec_adap_log_addr(struct cec_adapter *adap, u8 addr)
 {
-	struct adv7842_state *state = adap->priv;
+	struct adv7842_state *state = cec_get_drvdata(adap);
 	struct v4l2_subdev *sd = &state->sd;
 	unsigned int i, free_idx = ADV7842_MAX_ADDRS;
 
@@ -2334,7 +2334,7 @@ static int adv7842_cec_adap_log_addr(struct cec_adapter *adap, u8 addr)
 static int adv7842_cec_adap_transmit(struct cec_adapter *adap, u8 attempts,
 				     u32 signal_free_time, struct cec_msg *msg)
 {
-	struct adv7842_state *state = adap->priv;
+	struct adv7842_state *state = cec_get_drvdata(adap);
 	struct v4l2_subdev *sd = &state->sd;
 	u8 len = msg->len;
 	unsigned int i;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 7/8] [media] usb: pulse8-cec: Use cec_get_drvdata()
  2017-03-24 16:47 [PATCH 0/8] Add cec_get_drvdata() Jose Abreu
                   ` (5 preceding siblings ...)
  2017-03-24 16:47 ` [PATCH 6/8] [media] i2c: adv7842: " Jose Abreu
@ 2017-03-24 16:47 ` Jose Abreu
  2017-03-24 16:47 ` [PATCH 8/8] [media] platform: vivid: " Jose Abreu
  7 siblings, 0 replies; 11+ messages in thread
From: Jose Abreu @ 2017-03-24 16:47 UTC (permalink / raw)
  To: linux-media; +Cc: hans.verkuil, mchehab, linux-kernel, Jose Abreu

Use helper function to get driver private data from CEC
adapter.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/usb/pulse8-cec/pulse8-cec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/usb/pulse8-cec/pulse8-cec.c b/drivers/media/usb/pulse8-cec/pulse8-cec.c
index 7c18dae..1dfc2de 100644
--- a/drivers/media/usb/pulse8-cec/pulse8-cec.c
+++ b/drivers/media/usb/pulse8-cec/pulse8-cec.c
@@ -461,7 +461,7 @@ static int pulse8_apply_persistent_config(struct pulse8 *pulse8,
 
 static int pulse8_cec_adap_enable(struct cec_adapter *adap, bool enable)
 {
-	struct pulse8 *pulse8 = adap->priv;
+	struct pulse8 *pulse8 = cec_get_drvdata(adap);
 	u8 cmd[16];
 	int err;
 
@@ -474,7 +474,7 @@ static int pulse8_cec_adap_enable(struct cec_adapter *adap, bool enable)
 
 static int pulse8_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr)
 {
-	struct pulse8 *pulse8 = adap->priv;
+	struct pulse8 *pulse8 = cec_get_drvdata(adap);
 	u16 mask = 0;
 	u16 pa = adap->phys_addr;
 	u8 cmd[16];
@@ -594,7 +594,7 @@ static int pulse8_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr)
 static int pulse8_cec_adap_transmit(struct cec_adapter *adap, u8 attempts,
 				    u32 signal_free_time, struct cec_msg *msg)
 {
-	struct pulse8 *pulse8 = adap->priv;
+	struct pulse8 *pulse8 = cec_get_drvdata(adap);
 	u8 cmd[2];
 	unsigned int i;
 	int err;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 8/8] [media] platform: vivid: Use cec_get_drvdata()
  2017-03-24 16:47 [PATCH 0/8] Add cec_get_drvdata() Jose Abreu
                   ` (6 preceding siblings ...)
  2017-03-24 16:47 ` [PATCH 7/8] [media] usb: pulse8-cec: " Jose Abreu
@ 2017-03-24 16:47 ` Jose Abreu
  7 siblings, 0 replies; 11+ messages in thread
From: Jose Abreu @ 2017-03-24 16:47 UTC (permalink / raw)
  To: linux-media; +Cc: hans.verkuil, mchehab, linux-kernel, Jose Abreu

Use helper function to get driver private data from CEC
adapter.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
---
 drivers/media/platform/vivid/vivid-cec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/vivid/vivid-cec.c b/drivers/media/platform/vivid/vivid-cec.c
index cb49335..653f409 100644
--- a/drivers/media/platform/vivid/vivid-cec.c
+++ b/drivers/media/platform/vivid/vivid-cec.c
@@ -135,7 +135,7 @@ static int vivid_cec_adap_log_addr(struct cec_adapter *adap, u8 log_addr)
 static int vivid_cec_adap_transmit(struct cec_adapter *adap, u8 attempts,
 				   u32 signal_free_time, struct cec_msg *msg)
 {
-	struct vivid_dev *dev = adap->priv;
+	struct vivid_dev *dev = cec_get_drvdata(adap);
 	struct vivid_cec_work *cw = kzalloc(sizeof(*cw), GFP_KERNEL);
 	long delta_jiffies = 0;
 
@@ -166,7 +166,7 @@ static int vivid_cec_adap_transmit(struct cec_adapter *adap, u8 attempts,
 
 static int vivid_received(struct cec_adapter *adap, struct cec_msg *msg)
 {
-	struct vivid_dev *dev = adap->priv;
+	struct vivid_dev *dev = cec_get_drvdata(adap);
 	struct cec_msg reply;
 	u8 dest = cec_msg_destination(msg);
 	u8 disp_ctl;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/8] [media] staging: st-cec: Use cec_get_drvdata()
  2017-03-24 16:47 ` [PATCH 2/8] [media] staging: st-cec: Use cec_get_drvdata() Jose Abreu
@ 2017-03-28  9:17   ` Benjamin Gaignard
  2017-03-28  9:41     ` Hans Verkuil
  0 siblings, 1 reply; 11+ messages in thread
From: Benjamin Gaignard @ 2017-03-28  9:17 UTC (permalink / raw)
  To: Jose Abreu
  Cc: linux-media, hans.verkuil, Mauro Carvalho Chehab,
	Linux Kernel Mailing List

2017-03-24 17:47 GMT+01:00 Jose Abreu <Jose.Abreu@synopsys.com>:
> Use helper function to get driver private data from CEC
> adapter.

That looks good for me but does it make sense to merge that now ? or
should we wait until
cec drivers as move out of staging ?
Hans what is your view on that ?

>
> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
> Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
> ---
>  drivers/staging/media/st-cec/stih-cec.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/media/st-cec/stih-cec.c b/drivers/staging/media/st-cec/stih-cec.c
> index 3c25638..521206d 100644
> --- a/drivers/staging/media/st-cec/stih-cec.c
> +++ b/drivers/staging/media/st-cec/stih-cec.c
> @@ -133,7 +133,7 @@ struct stih_cec {
>
>  static int stih_cec_adap_enable(struct cec_adapter *adap, bool enable)
>  {
> -       struct stih_cec *cec = adap->priv;
> +       struct stih_cec *cec = cec_get_drvdata(adap);
>
>         if (enable) {
>                 /* The doc says (input TCLK_PERIOD * CEC_CLK_DIV) = 0.1ms */
> @@ -189,7 +189,7 @@ static int stih_cec_adap_enable(struct cec_adapter *adap, bool enable)
>
>  static int stih_cec_adap_log_addr(struct cec_adapter *adap, u8 logical_addr)
>  {
> -       struct stih_cec *cec = adap->priv;
> +       struct stih_cec *cec = cec_get_drvdata(adap);
>         u32 reg = readl(cec->regs + CEC_ADDR_TABLE);
>
>         reg |= 1 << logical_addr;
> @@ -205,7 +205,7 @@ static int stih_cec_adap_log_addr(struct cec_adapter *adap, u8 logical_addr)
>  static int stih_cec_adap_transmit(struct cec_adapter *adap, u8 attempts,
>                                   u32 signal_free_time, struct cec_msg *msg)
>  {
> -       struct stih_cec *cec = adap->priv;
> +       struct stih_cec *cec = cec_get_drvdata(adap);
>         int i;
>
>         /* Copy message into registers */
> --
> 1.9.1
>
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/8] [media] staging: st-cec: Use cec_get_drvdata()
  2017-03-28  9:17   ` Benjamin Gaignard
@ 2017-03-28  9:41     ` Hans Verkuil
  0 siblings, 0 replies; 11+ messages in thread
From: Hans Verkuil @ 2017-03-28  9:41 UTC (permalink / raw)
  To: Benjamin Gaignard, Jose Abreu
  Cc: linux-media, hans.verkuil, Mauro Carvalho Chehab,
	Linux Kernel Mailing List

On 28/03/17 11:17, Benjamin Gaignard wrote:
> 2017-03-24 17:47 GMT+01:00 Jose Abreu <Jose.Abreu@synopsys.com>:
>> Use helper function to get driver private data from CEC
>> adapter.
> 
> That looks good for me but does it make sense to merge that now ? or
> should we wait until
> cec drivers as move out of staging ?
> Hans what is your view on that ?

Why not merge this? It makes no sense not to update staging drivers.
Just because they are in staging doesn't mean you can't improve them :-)

Regards,

	Hans

> 
>>
>> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
>> Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
>> ---
>>  drivers/staging/media/st-cec/stih-cec.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/staging/media/st-cec/stih-cec.c b/drivers/staging/media/st-cec/stih-cec.c
>> index 3c25638..521206d 100644
>> --- a/drivers/staging/media/st-cec/stih-cec.c
>> +++ b/drivers/staging/media/st-cec/stih-cec.c
>> @@ -133,7 +133,7 @@ struct stih_cec {
>>
>>  static int stih_cec_adap_enable(struct cec_adapter *adap, bool enable)
>>  {
>> -       struct stih_cec *cec = adap->priv;
>> +       struct stih_cec *cec = cec_get_drvdata(adap);
>>
>>         if (enable) {
>>                 /* The doc says (input TCLK_PERIOD * CEC_CLK_DIV) = 0.1ms */
>> @@ -189,7 +189,7 @@ static int stih_cec_adap_enable(struct cec_adapter *adap, bool enable)
>>
>>  static int stih_cec_adap_log_addr(struct cec_adapter *adap, u8 logical_addr)
>>  {
>> -       struct stih_cec *cec = adap->priv;
>> +       struct stih_cec *cec = cec_get_drvdata(adap);
>>         u32 reg = readl(cec->regs + CEC_ADDR_TABLE);
>>
>>         reg |= 1 << logical_addr;
>> @@ -205,7 +205,7 @@ static int stih_cec_adap_log_addr(struct cec_adapter *adap, u8 logical_addr)
>>  static int stih_cec_adap_transmit(struct cec_adapter *adap, u8 attempts,
>>                                   u32 signal_free_time, struct cec_msg *msg)
>>  {
>> -       struct stih_cec *cec = adap->priv;
>> +       struct stih_cec *cec = cec_get_drvdata(adap);
>>         int i;
>>
>>         /* Copy message into registers */
>> --
>> 1.9.1
>>
>>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-03-28  9:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-24 16:47 [PATCH 0/8] Add cec_get_drvdata() Jose Abreu
2017-03-24 16:47 ` [PATCH 1/8] [media] cec: " Jose Abreu
2017-03-24 16:47 ` [PATCH 2/8] [media] staging: st-cec: Use cec_get_drvdata() Jose Abreu
2017-03-28  9:17   ` Benjamin Gaignard
2017-03-28  9:41     ` Hans Verkuil
2017-03-24 16:47 ` [PATCH 3/8] [media] staging: s5p-cec: " Jose Abreu
2017-03-24 16:47 ` [PATCH 4/8] [media] i2c: adv7511: " Jose Abreu
2017-03-24 16:47 ` [PATCH 5/8] [media] i2c: adv7604: " Jose Abreu
2017-03-24 16:47 ` [PATCH 6/8] [media] i2c: adv7842: " Jose Abreu
2017-03-24 16:47 ` [PATCH 7/8] [media] usb: pulse8-cec: " Jose Abreu
2017-03-24 16:47 ` [PATCH 8/8] [media] platform: vivid: " Jose Abreu

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).