Commit c3cba9281ba39f3aef377fe52890e2d8f1e6dae3

Authored by Tushar Behera
Committed by Linus Torvalds
1 parent cd1e6f9e53

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>

Showing 1 changed file with 18 additions and 5 deletions Side-by-side Diff

drivers/rtc/rtc-s3c.c
... ... @@ -40,6 +40,10 @@
40 40 TYPE_S3C64XX,
41 41 };
42 42  
  43 +struct s3c_rtc_drv_data {
  44 + int cpu_type;
  45 +};
  46 +
43 47 /* I have yet to find an S3C implementation with more than one
44 48 * of these rtc blocks in */
45 49  
46 50  
... ... @@ -446,10 +450,12 @@
446 450 static inline int s3c_rtc_get_driver_data(struct platform_device *pdev)
447 451 {
448 452 #ifdef CONFIG_OF
  453 + struct s3c_rtc_drv_data *data;
449 454 if (pdev->dev.of_node) {
450 455 const struct of_device_id *match;
451 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 460 #endif
455 461 return platform_get_device_id(pdev)->driver_data;
456 462  
457 463  
458 464  
459 465  
... ... @@ -664,20 +670,27 @@
664 670 #define s3c_rtc_resume NULL
665 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 680 #ifdef CONFIG_OF
668 681 static const struct of_device_id s3c_rtc_dt_match[] = {
669 682 {
670 683 .compatible = "samsung,s3c2410-rtc",
671   - .data = TYPE_S3C2410,
  684 + .data = &s3c_rtc_drv_data_array[TYPE_S3C2410],
672 685 }, {
673 686 .compatible = "samsung,s3c2416-rtc",
674   - .data = TYPE_S3C2416,
  687 + .data = &s3c_rtc_drv_data_array[TYPE_S3C2416],
675 688 }, {
676 689 .compatible = "samsung,s3c2443-rtc",
677   - .data = TYPE_S3C2443,
  690 + .data = &s3c_rtc_drv_data_array[TYPE_S3C2443],
678 691 }, {
679 692 .compatible = "samsung,s3c6410-rtc",
680   - .data = TYPE_S3C64XX,
  693 + .data = &s3c_rtc_drv_data_array[TYPE_S3C64XX],
681 694 },
682 695 {},
683 696 };