All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi-imx: Remove duplicate spi_imx_data definition
@ 2012-03-26 18:13 Fabio Estevam
       [not found] ` <1332785632-17799-1-git-send-email-fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Fabio Estevam @ 2012-03-26 18:13 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: Fabio Estevam, kernel-bIcnvbaLZ9MEGnE8C9+IrQ

Structure struct spi_imx_data is defined twice.

Remove one of its definition.

Signed-off-by: Fabio Estevam <fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
---
 drivers/spi/spi-imx.c |   20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 31054e3..f1f6700 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -68,17 +68,6 @@ enum spi_imx_devtype {
 	IMX51_ECSPI,	/* ECSPI on i.mx51 and later */
 };
 
-struct spi_imx_data;
-
-struct spi_imx_devtype_data {
-	void (*intctrl)(struct spi_imx_data *, int);
-	int (*config)(struct spi_imx_data *, struct spi_imx_config *);
-	void (*trigger)(struct spi_imx_data *);
-	int (*rx_available)(struct spi_imx_data *);
-	void (*reset)(struct spi_imx_data *);
-	enum spi_imx_devtype devtype;
-};
-
 struct spi_imx_data {
 	struct spi_bitbang bitbang;
 
@@ -99,6 +88,15 @@ struct spi_imx_data {
 	int chipselect[0];
 };
 
+struct spi_imx_devtype_data {
+	void (*intctrl)(struct spi_imx_data *, int);
+	int (*config)(struct spi_imx_data *, struct spi_imx_config *);
+	void (*trigger)(struct spi_imx_data *);
+	int (*rx_available)(struct spi_imx_data *);
+	void (*reset)(struct spi_imx_data *);
+	enum spi_imx_devtype devtype;
+};
+
 static inline int is_imx27_cspi(struct spi_imx_data *d)
 {
 	return d->devtype_data->devtype == IMX27_CSPI;
-- 
1.7.1



------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure

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

* Re: [PATCH] spi-imx: Remove duplicate spi_imx_data definition
       [not found] ` <1332785632-17799-1-git-send-email-fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
@ 2012-03-26 18:46   ` Shubhrajyoti Datta
       [not found]     ` <CAM=Q2cvL+Dac=Q1XmSUOLZGqK2zVdYd6nzQc-Tgeywois8rrxQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2012-03-26 20:59   ` Uwe Kleine-König
  1 sibling, 1 reply; 8+ messages in thread
From: Shubhrajyoti Datta @ 2012-03-26 18:46 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ

Hi Fabio,

On Mon, Mar 26, 2012 at 11:43 PM, Fabio Estevam
<fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org> wrote:
> Structure struct spi_imx_data is defined twice.
>
> Remove one of its definition.
>
> Signed-off-by: Fabio Estevam <fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> ---
>  drivers/spi/spi-imx.c |   20 +++++++++-----------
>  1 files changed, 9 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
> index 31054e3..f1f6700 100644
> --- a/drivers/spi/spi-imx.c
> +++ b/drivers/spi/spi-imx.c
> @@ -68,17 +68,6 @@ enum spi_imx_devtype {
>        IMX51_ECSPI,    /* ECSPI on i.mx51 and later */
>  };
>
> -struct spi_imx_data;
> -
> -struct spi_imx_devtype_data {
> -       void (*intctrl)(struct spi_imx_data *, int);
> -       int (*config)(struct spi_imx_data *, struct spi_imx_config *);
> -       void (*trigger)(struct spi_imx_data *);
> -       int (*rx_available)(struct spi_imx_data *);
> -       void (*reset)(struct spi_imx_data *);
> -       enum spi_imx_devtype devtype;
> -};

Is this change intentional

> -
>  struct spi_imx_data {
>        struct spi_bitbang bitbang;
>
> @@ -99,6 +88,15 @@ struct spi_imx_data {
>        int chipselect[0];
>  };
>
> +struct spi_imx_devtype_data {
> +       void (*intctrl)(struct spi_imx_data *, int);
> +       int (*config)(struct spi_imx_data *, struct spi_imx_config *);
> +       void (*trigger)(struct spi_imx_data *);
> +       int (*rx_available)(struct spi_imx_data *);
> +       void (*reset)(struct spi_imx_data *);
> +       enum spi_imx_devtype devtype;
> +};
> +
>  static inline int is_imx27_cspi(struct spi_imx_data *d)
>  {
>        return d->devtype_data->devtype == IMX27_CSPI;
> --
> 1.7.1
>
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> spi-devel-general mailing list
> spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/spi-devel-general

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure

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

* Re: [PATCH] spi-imx: Remove duplicate spi_imx_data definition
       [not found]         ` <4F70BDD4.5010003-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
@ 2012-03-26 19:02           ` Shubhrajyoti Datta
  0 siblings, 0 replies; 8+ messages in thread
From: Shubhrajyoti Datta @ 2012-03-26 19:02 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ

Hi Fabio,

On Tue, Mar 27, 2012 at 12:34 AM, Fabio Estevam
<fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org> wrote:
> Shubhrajyoti Datta wrote:
>> Hi Fabio,
>>
>> On Mon, Mar 26, 2012 at 11:43 PM, Fabio Estevam
>> <fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org> wrote:
>>> Structure struct spi_imx_data is defined twice.
>>>
>>> Remove one of its definition.
>>>
>>> Signed-off-by: Fabio Estevam <fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
>>> ---
>>>  drivers/spi/spi-imx.c |   20 +++++++++-----------
>>>  1 files changed, 9 insertions(+), 11 deletions(-)
>>>
>>> diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
>>> index 31054e3..f1f6700 100644
>>> --- a/drivers/spi/spi-imx.c
>>> +++ b/drivers/spi/spi-imx.c
>>> @@ -68,17 +68,6 @@ enum spi_imx_devtype {
>>>        IMX51_ECSPI,    /* ECSPI on i.mx51 and later */
>>>  };
>>>
>>> -struct spi_imx_data;
>>> -
>>> -struct spi_imx_devtype_data {
>>> -       void (*intctrl)(struct spi_imx_data *, int);
>>> -       int (*config)(struct spi_imx_data *, struct spi_imx_config *);
>>> -       void (*trigger)(struct spi_imx_data *);
>>> -       int (*rx_available)(struct spi_imx_data *);
>>> -       void (*reset)(struct spi_imx_data *);
>>> -       enum spi_imx_devtype devtype;
>>> -};
>>
>> Is this change intentional
>
> Yes, struct spi_imx_data must be defined prior to spi_imx_devtype_data.
>
How about specifying in the changelogs.
> Thanks,
>
> Fabio Estevam
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> spi-devel-general mailing list
> spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/spi-devel-general

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure

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

* Re: [PATCH] spi-imx: Remove duplicate spi_imx_data definition
       [not found]     ` <CAM=Q2cvL+Dac=Q1XmSUOLZGqK2zVdYd6nzQc-Tgeywois8rrxQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2012-03-26 19:04       ` Fabio Estevam
       [not found]         ` <4F70BDD4.5010003-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Fabio Estevam @ 2012-03-26 19:04 UTC (permalink / raw)
  To: Shubhrajyoti Datta
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ

Shubhrajyoti Datta wrote:
> Hi Fabio,
> 
> On Mon, Mar 26, 2012 at 11:43 PM, Fabio Estevam
> <fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org> wrote:
>> Structure struct spi_imx_data is defined twice.
>>
>> Remove one of its definition.
>>
>> Signed-off-by: Fabio Estevam <fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
>> ---
>>  drivers/spi/spi-imx.c |   20 +++++++++-----------
>>  1 files changed, 9 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
>> index 31054e3..f1f6700 100644
>> --- a/drivers/spi/spi-imx.c
>> +++ b/drivers/spi/spi-imx.c
>> @@ -68,17 +68,6 @@ enum spi_imx_devtype {
>>        IMX51_ECSPI,    /* ECSPI on i.mx51 and later */
>>  };
>>
>> -struct spi_imx_data;
>> -
>> -struct spi_imx_devtype_data {
>> -       void (*intctrl)(struct spi_imx_data *, int);
>> -       int (*config)(struct spi_imx_data *, struct spi_imx_config *);
>> -       void (*trigger)(struct spi_imx_data *);
>> -       int (*rx_available)(struct spi_imx_data *);
>> -       void (*reset)(struct spi_imx_data *);
>> -       enum spi_imx_devtype devtype;
>> -};
> 
> Is this change intentional

Yes, struct spi_imx_data must be defined prior to spi_imx_devtype_data.

Thanks,

Fabio Estevam


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure

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

* Re: [PATCH] spi-imx: Remove duplicate spi_imx_data definition
       [not found] ` <1332785632-17799-1-git-send-email-fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
  2012-03-26 18:46   ` Shubhrajyoti Datta
@ 2012-03-26 20:59   ` Uwe Kleine-König
       [not found]     ` <20120326205940.GM15647-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  1 sibling, 1 reply; 8+ messages in thread
From: Uwe Kleine-König @ 2012-03-26 20:59 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ

On Mon, Mar 26, 2012 at 03:13:52PM -0300, Fabio Estevam wrote:
> Structure struct spi_imx_data is defined twice.
> 
> Remove one of its definition.
In my version of drivers/spi/spi-imx.c struct spi_imx_data is only
defined once. I guess you wanted to say "forward declaration".

> Signed-off-by: Fabio Estevam <fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> ---
>  drivers/spi/spi-imx.c |   20 +++++++++-----------
>  1 files changed, 9 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
> index 31054e3..f1f6700 100644
> --- a/drivers/spi/spi-imx.c
> +++ b/drivers/spi/spi-imx.c
> @@ -68,17 +68,6 @@ enum spi_imx_devtype {
>  	IMX51_ECSPI,	/* ECSPI on i.mx51 and later */
>  };
>  
> -struct spi_imx_data;
> -
> -struct spi_imx_devtype_data {
> -	void (*intctrl)(struct spi_imx_data *, int);
> -	int (*config)(struct spi_imx_data *, struct spi_imx_config *);
> -	void (*trigger)(struct spi_imx_data *);
> -	int (*rx_available)(struct spi_imx_data *);
> -	void (*reset)(struct spi_imx_data *);
> -	enum spi_imx_devtype devtype;
> -};
> -
>  struct spi_imx_data {
>  	struct spi_bitbang bitbang;
>  
> @@ -99,6 +88,15 @@ struct spi_imx_data {
>  	int chipselect[0];
>  };
>  
> +struct spi_imx_devtype_data {
> +	void (*intctrl)(struct spi_imx_data *, int);
> +	int (*config)(struct spi_imx_data *, struct spi_imx_config *);
> +	void (*trigger)(struct spi_imx_data *);
> +	int (*rx_available)(struct spi_imx_data *);
> +	void (*reset)(struct spi_imx_data *);
> +	enum spi_imx_devtype devtype;
> +};
> +
Does this really work? struct spi_imx_data has a member

	struct spi_imx_devtype_data *devtype_data;

. So when reordering you can drop the forward definition of
spi_imx_data, but don't you need another one for spi_imx_devtype_data?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure

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

* Re: [PATCH] spi-imx: Remove duplicate spi_imx_data definition
       [not found]     ` <20120326205940.GM15647-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2012-03-27  2:19       ` Fabio Estevam
       [not found]         ` <4F7123BE.8090608-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Fabio Estevam @ 2012-03-27  2:19 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ

On 3/26/2012 5:59 PM, Uwe Kleine-König wrote:

> In my version of drivers/spi/spi-imx.c struct spi_imx_data is only
> defined once. I guess you wanted to say "forward declaration".

Yes, correct.

...

> Does this really work? struct spi_imx_data has a member

Yes, tested it on a mx31pdk board.

Regards,

Fabio Estevam




------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure

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

* Re: [PATCH] spi-imx: Remove duplicate spi_imx_data definition
       [not found]         ` <4F7123BE.8090608-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
@ 2012-03-27  7:01           ` Uwe Kleine-König
       [not found]             ` <20120327070135.GN15647-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Uwe Kleine-König @ 2012-03-27  7:01 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ

Hello Fabio,

On Mon, Mar 26, 2012 at 11:19:42PM -0300, Fabio Estevam wrote:
> On 3/26/2012 5:59 PM, Uwe Kleine-König wrote:
> 
> > In my version of drivers/spi/spi-imx.c struct spi_imx_data is only
> > defined once. I guess you wanted to say "forward declaration".
> 
> Yes, correct.
> 
> ...
> 
> > Does this really work? struct spi_imx_data has a member
> 
> Yes, tested it on a mx31pdk board.
Strange, I can confirm it compiles without warnings. Even sparse doesn't
complain about it. I don't understand it. *shrug*

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure

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

* Re: [PATCH] spi-imx: Remove duplicate spi_imx_data definition
       [not found]             ` <20120327070135.GN15647-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
@ 2012-03-27 22:04               ` Grant Likely
  0 siblings, 0 replies; 8+ messages in thread
From: Grant Likely @ 2012-03-27 22:04 UTC (permalink / raw)
  To: Uwe Kleine-König, Fabio Estevam
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 830 bytes --]

On Tue, 27 Mar 2012 09:01:35 +0200, Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org> wrote:
> Hello Fabio,
> 
> On Mon, Mar 26, 2012 at 11:19:42PM -0300, Fabio Estevam wrote:
> > On 3/26/2012 5:59 PM, Uwe Kleine-König wrote:
> > 
> > > In my version of drivers/spi/spi-imx.c struct spi_imx_data is only
> > > defined once. I guess you wanted to say "forward declaration".
> > 
> > Yes, correct.
> > 
> > ...
> > 
> > > Does this really work? struct spi_imx_data has a member
> > 
> > Yes, tested it on a mx31pdk board.
> Strange, I can confirm it compiles without warnings. Even sparse doesn't
> complain about it. I don't understand it. *shrug*

Still doesn't look right though because there needs to be a forward
declaration for spi_imx_devtype_data before it is used.  I'm not going
to apply.

g.



[-- Attachment #2: Type: text/plain, Size: 191 bytes --]

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure

[-- Attachment #3: Type: text/plain, Size: 210 bytes --]

_______________________________________________
spi-devel-general mailing list
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

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

end of thread, other threads:[~2012-03-27 22:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-26 18:13 [PATCH] spi-imx: Remove duplicate spi_imx_data definition Fabio Estevam
     [not found] ` <1332785632-17799-1-git-send-email-fabio.estevam-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-03-26 18:46   ` Shubhrajyoti Datta
     [not found]     ` <CAM=Q2cvL+Dac=Q1XmSUOLZGqK2zVdYd6nzQc-Tgeywois8rrxQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-03-26 19:04       ` Fabio Estevam
     [not found]         ` <4F70BDD4.5010003-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-03-26 19:02           ` Shubhrajyoti Datta
2012-03-26 20:59   ` Uwe Kleine-König
     [not found]     ` <20120326205940.GM15647-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-03-27  2:19       ` Fabio Estevam
     [not found]         ` <4F7123BE.8090608-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-03-27  7:01           ` Uwe Kleine-König
     [not found]             ` <20120327070135.GN15647-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-03-27 22:04               ` Grant Likely

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.