diff options
| author | Tushar Behera <tushar.behera@linaro.org> | 2012-04-12 15:49:14 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-12 16:12:12 -0400 |
| commit | c3cba9281ba39f3aef377fe52890e2d8f1e6dae3 (patch) | |
| tree | b5c9a43711be9a96c7689b39868beef266ac04a5 /drivers/rtc | |
| parent | cd1e6f9e53e1a673a489826729709aaffa8ad621 (diff) | |
drivers/rtc/rtc-s3c.c: add placeholder for driver private data
Driver data field is a pointer, hence assigning that to an integer results
in compilation warnings.
Fixes following compilation warnings:
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]
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc')
| -rw-r--r-- | 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 2087953f108d..3f3a29752369 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c | |||
| @@ -40,6 +40,10 @@ enum s3c_cpu_type { | |||
| 40 | TYPE_S3C64XX, | 40 | TYPE_S3C64XX, |
| 41 | }; | 41 | }; |
| 42 | 42 | ||
| 43 | struct s3c_rtc_drv_data { | ||
| 44 | int cpu_type; | ||
| 45 | }; | ||
| 46 | |||
| 43 | /* I have yet to find an S3C implementation with more than one | 47 | /* I have yet to find an S3C implementation with more than one |
| 44 | * of these rtc blocks in */ | 48 | * of these rtc blocks in */ |
| 45 | 49 | ||
| @@ -446,10 +450,12 @@ static const struct of_device_id s3c_rtc_dt_match[]; | |||
| 446 | static inline int s3c_rtc_get_driver_data(struct platform_device *pdev) | 450 | static inline int s3c_rtc_get_driver_data(struct platform_device *pdev) |
| 447 | { | 451 | { |
| 448 | #ifdef CONFIG_OF | 452 | #ifdef CONFIG_OF |
| 453 | struct s3c_rtc_drv_data *data; | ||
| 449 | if (pdev->dev.of_node) { | 454 | if (pdev->dev.of_node) { |
| 450 | const struct of_device_id *match; | 455 | const struct of_device_id *match; |
| 451 | match = of_match_node(s3c_rtc_dt_match, pdev->dev.of_node); | 456 | match = of_match_node(s3c_rtc_dt_match, pdev->dev.of_node); |
| 452 | return match->data; | 457 | data = (struct s3c_rtc_drv_data *) match->data; |
| 458 | return data->cpu_type; | ||
| 453 | } | 459 | } |
| 454 | #endif | 460 | #endif |
| 455 | return platform_get_device_id(pdev)->driver_data; | 461 | return platform_get_device_id(pdev)->driver_data; |
| @@ -664,20 +670,27 @@ static int s3c_rtc_resume(struct platform_device *pdev) | |||
| 664 | #define s3c_rtc_resume NULL | 670 | #define s3c_rtc_resume NULL |
| 665 | #endif | 671 | #endif |
| 666 | 672 | ||
| 673 | static struct s3c_rtc_drv_data s3c_rtc_drv_data_array[] = { | ||
| 674 | [TYPE_S3C2410] = { TYPE_S3C2410 }, | ||
| 675 | [TYPE_S3C2416] = { TYPE_S3C2416 }, | ||
| 676 | [TYPE_S3C2443] = { TYPE_S3C2443 }, | ||
| 677 | [TYPE_S3C64XX] = { TYPE_S3C64XX }, | ||
| 678 | }; | ||
| 679 | |||
| 667 | #ifdef CONFIG_OF | 680 | #ifdef CONFIG_OF |
| 668 | static const struct of_device_id s3c_rtc_dt_match[] = { | 681 | static const struct of_device_id s3c_rtc_dt_match[] = { |
| 669 | { | 682 | { |
| 670 | .compatible = "samsung,s3c2410-rtc", | 683 | .compatible = "samsung,s3c2410-rtc", |
| 671 | .data = TYPE_S3C2410, | 684 | .data = &s3c_rtc_drv_data_array[TYPE_S3C2410], |
| 672 | }, { | 685 | }, { |
| 673 | .compatible = "samsung,s3c2416-rtc", | 686 | .compatible = "samsung,s3c2416-rtc", |
| 674 | .data = TYPE_S3C2416, | 687 | .data = &s3c_rtc_drv_data_array[TYPE_S3C2416], |
| 675 | }, { | 688 | }, { |
| 676 | .compatible = "samsung,s3c2443-rtc", | 689 | .compatible = "samsung,s3c2443-rtc", |
| 677 | .data = TYPE_S3C2443, | 690 | .data = &s3c_rtc_drv_data_array[TYPE_S3C2443], |
| 678 | }, { | 691 | }, { |
| 679 | .compatible = "samsung,s3c6410-rtc", | 692 | .compatible = "samsung,s3c6410-rtc", |
| 680 | .data = TYPE_S3C64XX, | 693 | .data = &s3c_rtc_drv_data_array[TYPE_S3C64XX], |
| 681 | }, | 694 | }, |
| 682 | {}, | 695 | {}, |
| 683 | }; | 696 | }; |
