Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1608664 > unrolled thread

[PATCH 2/8] [media] staging: st-cec: Use cec_get_drvdata()

Started byJose Abreu <Jose.Abreu@synopsys.com>
First post2017-03-24 17:50 +0100
Last post2017-03-28 11:50 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/8] [media] staging: st-cec: Use cec_get_drvdata() Jose Abreu <Jose.Abreu@synopsys.com> - 2017-03-24 17:50 +0100
    Re: [PATCH 2/8] [media] staging: st-cec: Use cec_get_drvdata() Benjamin Gaignard <benjamin.gaignard@linaro.org> - 2017-03-28 11:20 +0200
      Re: [PATCH 2/8] [media] staging: st-cec: Use cec_get_drvdata() Hans Verkuil <hverkuil@xs4all.nl> - 2017-03-28 11:50 +0200

#1608664 — [PATCH 2/8] [media] staging: st-cec: Use cec_get_drvdata()

FromJose Abreu <Jose.Abreu@synopsys.com>
Date2017-03-24 17:50 +0100
Subject[PATCH 2/8] [media] staging: st-cec: Use cec_get_drvdata()
Message-ID<toAzw-4jh-13@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1610454

FromBenjamin Gaignard <benjamin.gaignard@linaro.org>
Date2017-03-28 11:20 +0200
Message-ID<tpVsd-5pw-9@gated-at.bofh.it>
In reply to#1608664
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
>
>

[toc] | [prev] | [next] | [standalone]


#1610499

FromHans Verkuil <hverkuil@xs4all.nl>
Date2017-03-28 11:50 +0200
Message-ID<tpVVh-5DA-25@gated-at.bofh.it>
In reply to#1610454
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
>>
>>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web