All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Fixes related to rtc-s3c
@ 2012-03-28 10:50 Tushar Behera
  2012-03-28 10:50 ` [PATCH 1/2] rtc: rtc-s3c: Fix compilation error Tushar Behera
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Tushar Behera @ 2012-03-28 10:50 UTC (permalink / raw)
  To: rtc-linux; +Cc: linux-samsung-soc, a.zummo, kgene.kim, patches

The patches are based on Kukjin's for-next branch and they fix a couple
of compile-time errors and warnings.

The patches have been only build-tested.

Tushar Behera (2):
  rtc: rtc-s3c: Fix compilation error
  rtc: rtc-s3c: Add placeholder for driver private data

 drivers/rtc/rtc-s3c.c |   31 ++++++++++++++++++++++---------
 1 files changed, 22 insertions(+), 9 deletions(-)

-- 
1.7.4.1

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

* [PATCH 1/2] rtc: rtc-s3c: Fix compilation error
  2012-03-28 10:50 [PATCH 0/2] Fixes related to rtc-s3c Tushar Behera
@ 2012-03-28 10:50 ` Tushar Behera
  2012-03-28 10:50 ` [PATCH 2/2] rtc: rtc-s3c: Add placeholder for driver private data Tushar Behera
  2012-03-28 11:28 ` [PATCH 0/2] Fixes related to rtc-s3c Heiko Stübner
  2 siblings, 0 replies; 6+ messages in thread
From: Tushar Behera @ 2012-03-28 10:50 UTC (permalink / raw)
  To: rtc-linux; +Cc: linux-samsung-soc, a.zummo, kgene.kim, patches, Heiko Stuebner

Fixes following compilation error.
drivers/rtc/rtc-s3c.c: At top level:
drivers/rtc/rtc-s3c.c:671:3: error: request for member ‘data’ in something not a structure or union
drivers/rtc/rtc-s3c.c:674:3: error: request for member ‘data’ in something not a structure or union
drivers/rtc/rtc-s3c.c:677:3: error: request for member ‘data’ in something not a structure or union
drivers/rtc/rtc-s3c.c:680:3: error: request for member ‘data’ in something not a structure or union

Cc: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
---
 drivers/rtc/rtc-s3c.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index 7895186..dc6c0d2 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -667,16 +667,16 @@ static int s3c_rtc_resume(struct platform_device *pdev)
 #ifdef CONFIG_OF
 static const struct of_device_id s3c_rtc_dt_match[] = {
 	{
-		.compatible = "samsung,s3c2410-rtc"
+		.compatible = "samsung,s3c2410-rtc",
 		.data = TYPE_S3C2410,
 	}, {
-		.compatible = "samsung,s3c2416-rtc"
+		.compatible = "samsung,s3c2416-rtc",
 		.data = TYPE_S3C2416,
 	}, {
-		.compatible = "samsung,s3c2443-rtc"
+		.compatible = "samsung,s3c2443-rtc",
 		.data = TYPE_S3C2443,
 	}, {
-		.compatible = "samsung,s3c6410-rtc"
+		.compatible = "samsung,s3c6410-rtc",
 		.data = TYPE_S3C64XX,
 	},
 	{},
-- 
1.7.4.1

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

* [PATCH 2/2] rtc: rtc-s3c: Add placeholder for driver private data
  2012-03-28 10:50 [PATCH 0/2] Fixes related to rtc-s3c Tushar Behera
  2012-03-28 10:50 ` [PATCH 1/2] rtc: rtc-s3c: Fix compilation error Tushar Behera
@ 2012-03-28 10:50 ` Tushar Behera
  2012-03-28 11:28 ` [PATCH 0/2] Fixes related to rtc-s3c Heiko Stübner
  2 siblings, 0 replies; 6+ messages in thread
From: Tushar Behera @ 2012-03-28 10:50 UTC (permalink / raw)
  To: rtc-linux; +Cc: linux-samsung-soc, a.zummo, kgene.kim, patches, Heiko Stuebner

Driver data field is a pointer, hence assigning that to an integer
results in compilation warnings.

Fixes following compilation warnigs.

drivers/rtc/rtc-s3c.c: In function ‘s3c_rtc_get_driver_data’:
drivers/rtc/rtc-s3c.c:452:3: warning: return makes integer from pointer without a cast [enabled by default]
drivers/rtc/rtc-s3c.c: At top level:
drivers/rtc/rtc-s3c.c:674:3: warning: initialization makes pointer from integer without a cast [enabled by default]
drivers/rtc/rtc-s3c.c:674:3: warning: (near initialization for ‘s3c_rtc_dt_match[1].data’) [enabled by default]
drivers/rtc/rtc-s3c.c:677:3: warning: initialization makes pointer from integer without a cast [enabled by default]
drivers/rtc/rtc-s3c.c:677:3: warning: (near initialization for ‘s3c_rtc_dt_match[2].data’) [enabled by default]
drivers/rtc/rtc-s3c.c:680:3: warning: initialization makes pointer from integer without a cast [enabled by default]
drivers/rtc/rtc-s3c.c:680:3: warning: (near initialization for ‘s3c_rtc_dt_match[3].data’) [enabled by default]

Cc: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
---
 drivers/rtc/rtc-s3c.c |   23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index dc6c0d2..6774a27 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -40,6 +40,10 @@ enum s3c_cpu_type {
 	TYPE_S3C64XX,
 };
 
+struct s3c_rtc_drv_data {
+	int cpu_type;
+};
+
 /* I have yet to find an S3C implementation with more than one
  * of these rtc blocks in */
 
@@ -446,10 +450,12 @@ static const struct of_device_id s3c_rtc_dt_match[];
 static inline int s3c_rtc_get_driver_data(struct platform_device *pdev)
 {
 #ifdef CONFIG_OF
+	struct s3c_rtc_drv_data *data;
 	if (pdev->dev.of_node) {
 		const struct of_device_id *match;
 		match = of_match_node(s3c_rtc_dt_match, pdev->dev.of_node);
-		return match->data;
+		data = (struct s3c_rtc_drv_data *) match->data;
+		return data->cpu_type;
 	}
 #endif
 	return platform_get_device_id(pdev)->driver_data;
@@ -664,20 +670,27 @@ static int s3c_rtc_resume(struct platform_device *pdev)
 #define s3c_rtc_resume  NULL
 #endif
 
+static struct s3c_rtc_drv_data s3c_rtc_drv_data_array[] = {
+	[TYPE_S3C2410] = { TYPE_S3C2410 },
+	[TYPE_S3C2416] = { TYPE_S3C2416 },
+	[TYPE_S3C2443] = { TYPE_S3C2443 },
+	[TYPE_S3C64XX] = { TYPE_S3C64XX },
+};
+
 #ifdef CONFIG_OF
 static const struct of_device_id s3c_rtc_dt_match[] = {
 	{
 		.compatible = "samsung,s3c2410-rtc",
-		.data = TYPE_S3C2410,
+		.data = &s3c_rtc_drv_data_array[TYPE_S3C2410],
 	}, {
 		.compatible = "samsung,s3c2416-rtc",
-		.data = TYPE_S3C2416,
+		.data = &s3c_rtc_drv_data_array[TYPE_S3C2416],
 	}, {
 		.compatible = "samsung,s3c2443-rtc",
-		.data = TYPE_S3C2443,
+		.data = &s3c_rtc_drv_data_array[TYPE_S3C2443],
 	}, {
 		.compatible = "samsung,s3c6410-rtc",
-		.data = TYPE_S3C64XX,
+		.data = &s3c_rtc_drv_data_array[TYPE_S3C64XX],
 	},
 	{},
 };
-- 
1.7.4.1

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

* Re: [PATCH 0/2] Fixes related to rtc-s3c
  2012-03-28 10:50 [PATCH 0/2] Fixes related to rtc-s3c Tushar Behera
  2012-03-28 10:50 ` [PATCH 1/2] rtc: rtc-s3c: Fix compilation error Tushar Behera
  2012-03-28 10:50 ` [PATCH 2/2] rtc: rtc-s3c: Add placeholder for driver private data Tushar Behera
@ 2012-03-28 11:28 ` Heiko Stübner
  2012-03-28 12:08   ` Tushar Behera
  2 siblings, 1 reply; 6+ messages in thread
From: Heiko Stübner @ 2012-03-28 11:28 UTC (permalink / raw)
  To: Tushar Behera; +Cc: rtc-linux, linux-samsung-soc, a.zummo, kgene.kim, patches

Am Mittwoch, 28. März 2012, 12:50:35 schrieb Tushar Behera:
> The patches are based on Kukjin's for-next branch and they fix a couple
> of compile-time errors and warnings.
There was also a fixup patch for these problems posted on 2012-01-04. But it seems
to have been forgotten somehow.

I think either solution is fine.


Heiko


For reference the original patch was:

---- 8< ----------------------------------- >8 ----
Subject: [PATCH] rtc-s3c: Fix breakage introduced by S3C2443/S3C2416 support

Commits 7006ee4f (rtc-s3c: make room for more variants in devicetree block)
and 6c0a2365 (rtc-s3c: add variants for S3C2443 and S3C2416)
introduced build-failures with enabled CONFIG_USE_OF option.

This patch fixes missing "," in s3c_rtc_dt_match and wrong handling of
the of_device_id.data property.

Reported-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
 drivers/rtc/rtc-s3c.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index bb0f320..2b4feb8 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -449,7 +449,7 @@ static inline int s3c_rtc_get_driver_data(struct platform_device *pdev)
        if (pdev->dev.of_node) {
                const struct of_device_id *match;
                match = of_match_node(s3c_rtc_dt_match, pdev->dev.of_node);
-               return match->data;
+               return (int)match->data;
        }
 #endif
        return platform_get_device_id(pdev)->driver_data;
@@ -667,17 +667,17 @@ static int s3c_rtc_resume(struct platform_device *pdev)
 #ifdef CONFIG_OF
 static const struct of_device_id s3c_rtc_dt_match[] = {
        {
-               .compatible = "samsung,s3c2410-rtc"
-               .data = TYPE_S3C2410,
+               .compatible = "samsung,s3c2410-rtc",
+               .data = (void *)TYPE_S3C2410,
        }, {
-               .compatible = "samsung,s3c2416-rtc"
-               .data = TYPE_S3C2416,
+               .compatible = "samsung,s3c2416-rtc",
+               .data = (void *)TYPE_S3C2416,
        }, {
-               .compatible = "samsung,s3c2443-rtc"
-               .data = TYPE_S3C2443,
+               .compatible = "samsung,s3c2443-rtc",
+               .data = (void *)TYPE_S3C2443,
        }, {
-               .compatible = "samsung,s3c6410-rtc"
-               .data = TYPE_S3C64XX,
+               .compatible = "samsung,s3c6410-rtc",
+               .data = (void *)TYPE_S3C64XX,
        },
        {},
 };
-- 
1.7.5.4

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

* Re: [PATCH 0/2] Fixes related to rtc-s3c
  2012-03-28 11:28 ` [PATCH 0/2] Fixes related to rtc-s3c Heiko Stübner
@ 2012-03-28 12:08   ` Tushar Behera
  2012-04-06 20:12     ` Heiko Stübner
  0 siblings, 1 reply; 6+ messages in thread
From: Tushar Behera @ 2012-03-28 12:08 UTC (permalink / raw)
  To: Heiko Stübner
  Cc: rtc-linux, linux-samsung-soc, a.zummo, kgene.kim, patches

On 03/28/2012 04:58 PM, Heiko Stübner wrote:
> Am Mittwoch, 28. März 2012, 12:50:35 schrieb Tushar Behera:
>> The patches are based on Kukjin's for-next branch and they fix a couple
>> of compile-time errors and warnings.
> There was also a fixup patch for these problems posted on 2012-01-04. But it seems
> to have been forgotten somehow.
> 
> I think either solution is fine.
> 
> 
> Heiko
> 
I must have missed this patch too. We can go ahead with Heiko's patch.

> 
> For reference the original patch was:
> 
> ---- 8< ----------------------------------- >8 ----
> Subject: [PATCH] rtc-s3c: Fix breakage introduced by S3C2443/S3C2416 support
> 
> Commits 7006ee4f (rtc-s3c: make room for more variants in devicetree block)
> and 6c0a2365 (rtc-s3c: add variants for S3C2443 and S3C2416)
> introduced build-failures with enabled CONFIG_USE_OF option.
> 
> This patch fixes missing "," in s3c_rtc_dt_match and wrong handling of
> the of_device_id.data property.
> 
> Reported-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
>  drivers/rtc/rtc-s3c.c |   18 +++++++++---------
>  1 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
> index bb0f320..2b4feb8 100644
> --- a/drivers/rtc/rtc-s3c.c
> +++ b/drivers/rtc/rtc-s3c.c
> @@ -449,7 +449,7 @@ static inline int s3c_rtc_get_driver_data(struct platform_device *pdev)
>         if (pdev->dev.of_node) {
>                 const struct of_device_id *match;
>                 match = of_match_node(s3c_rtc_dt_match, pdev->dev.of_node);
> -               return match->data;
> +               return (int)match->data;
>         }
>  #endif
>         return platform_get_device_id(pdev)->driver_data;
> @@ -667,17 +667,17 @@ static int s3c_rtc_resume(struct platform_device *pdev)
>  #ifdef CONFIG_OF
>  static const struct of_device_id s3c_rtc_dt_match[] = {
>         {
> -               .compatible = "samsung,s3c2410-rtc"
> -               .data = TYPE_S3C2410,
> +               .compatible = "samsung,s3c2410-rtc",
> +               .data = (void *)TYPE_S3C2410,
>         }, {
> -               .compatible = "samsung,s3c2416-rtc"
> -               .data = TYPE_S3C2416,
> +               .compatible = "samsung,s3c2416-rtc",
> +               .data = (void *)TYPE_S3C2416,
>         }, {
> -               .compatible = "samsung,s3c2443-rtc"
> -               .data = TYPE_S3C2443,
> +               .compatible = "samsung,s3c2443-rtc",
> +               .data = (void *)TYPE_S3C2443,
>         }, {
> -               .compatible = "samsung,s3c6410-rtc"
> -               .data = TYPE_S3C64XX,
> +               .compatible = "samsung,s3c6410-rtc",
> +               .data = (void *)TYPE_S3C64XX,
>         },
>         {},
>  };


-- 
Tushar Behera

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

* Re: [PATCH 0/2] Fixes related to rtc-s3c
  2012-03-28 12:08   ` Tushar Behera
@ 2012-04-06 20:12     ` Heiko Stübner
  0 siblings, 0 replies; 6+ messages in thread
From: Heiko Stübner @ 2012-04-06 20:12 UTC (permalink / raw)
  To: kgene.kim; +Cc: Tushar Behera, rtc-linux, linux-samsung-soc, a.zummo, patches

Hi Kgene,

Am Mittwoch 28 März 2012, 14:08:05 schrieb Tushar Behera:
> On 03/28/2012 04:58 PM, Heiko Stübner wrote:
> > Am Mittwoch, 28. März 2012, 12:50:35 schrieb Tushar Behera:
> >> The patches are based on Kukjin's for-next branch and they fix a couple
> >> of compile-time errors and warnings.
> > 
> > There was also a fixup patch for these problems posted on 2012-01-04. But
> > it seems to have been forgotten somehow.
> > 
> > I think either solution is fine.
> > 
> > 
> > Heiko
> 
> I must have missed this patch too. We can go ahead with Heiko's patch.

could you please take either this patch, or my two-patch series from 
2012-01-04 to fix this problem?


Thanks
Heiko


> 
> > For reference the original patch was:
> > 
> > ---- 8< ----------------------------------- >8 ----
> > Subject: [PATCH] rtc-s3c: Fix breakage introduced by S3C2443/S3C2416
> > support
> > 
> > Commits 7006ee4f (rtc-s3c: make room for more variants in devicetree
> > block) and 6c0a2365 (rtc-s3c: add variants for S3C2443 and S3C2416)
> > introduced build-failures with enabled CONFIG_USE_OF option.
> > 
> > This patch fixes missing "," in s3c_rtc_dt_match and wrong handling of
> > the of_device_id.data property.
> > 
> > Reported-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> > Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> > ---
> > 
> >  drivers/rtc/rtc-s3c.c |   18 +++++++++---------
> >  1 files changed, 9 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
> > index bb0f320..2b4feb8 100644
> > --- a/drivers/rtc/rtc-s3c.c
> > +++ b/drivers/rtc/rtc-s3c.c
> > @@ -449,7 +449,7 @@ static inline int s3c_rtc_get_driver_data(struct
> > platform_device *pdev)
> > 
> >         if (pdev->dev.of_node) {
> >         
> >                 const struct of_device_id *match;
> >                 match = of_match_node(s3c_rtc_dt_match,
> >                 pdev->dev.of_node);
> > 
> > -               return match->data;
> > +               return (int)match->data;
> > 
> >         }
> >  
> >  #endif
> >  
> >         return platform_get_device_id(pdev)->driver_data;
> > 
> > @@ -667,17 +667,17 @@ static int s3c_rtc_resume(struct platform_device
> > *pdev)
> > 
> >  #ifdef CONFIG_OF
> >  static const struct of_device_id s3c_rtc_dt_match[] = {
> >  
> >         {
> > 
> > -               .compatible = "samsung,s3c2410-rtc"
> > -               .data = TYPE_S3C2410,
> > +               .compatible = "samsung,s3c2410-rtc",
> > +               .data = (void *)TYPE_S3C2410,
> > 
> >         }, {
> > 
> > -               .compatible = "samsung,s3c2416-rtc"
> > -               .data = TYPE_S3C2416,
> > +               .compatible = "samsung,s3c2416-rtc",
> > +               .data = (void *)TYPE_S3C2416,
> > 
> >         }, {
> > 
> > -               .compatible = "samsung,s3c2443-rtc"
> > -               .data = TYPE_S3C2443,
> > +               .compatible = "samsung,s3c2443-rtc",
> > +               .data = (void *)TYPE_S3C2443,
> > 
> >         }, {
> > 
> > -               .compatible = "samsung,s3c6410-rtc"
> > -               .data = TYPE_S3C64XX,
> > +               .compatible = "samsung,s3c6410-rtc",
> > +               .data = (void *)TYPE_S3C64XX,
> > 
> >         },
> >         {},
> >  
> >  };

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

end of thread, other threads:[~2012-04-06 20:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-28 10:50 [PATCH 0/2] Fixes related to rtc-s3c Tushar Behera
2012-03-28 10:50 ` [PATCH 1/2] rtc: rtc-s3c: Fix compilation error Tushar Behera
2012-03-28 10:50 ` [PATCH 2/2] rtc: rtc-s3c: Add placeholder for driver private data Tushar Behera
2012-03-28 11:28 ` [PATCH 0/2] Fixes related to rtc-s3c Heiko Stübner
2012-03-28 12:08   ` Tushar Behera
2012-04-06 20:12     ` Heiko Stübner

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.