Skip to contentSkip to conversation

rtc: rtc-ds1390/rtc-ds3234/rtc-m41t94: eliminate compile warning

PATCH Dennis Aberilla 2 participants 2 messages Mar 17, 2011 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

Hi Axel, that doesn't seem to make sense to me since "platform_get_drvdata" is (from include/linux/platform_device.h):

#define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev)

|Dennis

--- On Thu, 24/2/11, Axel Lin <[email protected]> wrote:

From: Axel Lin <[email protected]>
Subject: [PATCH] rtc: rtc-ds1390/rtc-ds3234/rtc-m41t94: eliminate compile warning
To: [email protected]
Cc: "Mark Jackson" <[email protected]>, "Dennis Aberilla" <[email protected]>, "Kim B. Heino" <[email protected]>, "Alessandro Zummo" <[email protected]>, "Thomas Gleixner" <[email protected]>, [email protected]
Received: Thursday, 24 February, 2011, 9:28 AM

Eliminate the following compile warning:
drivers/rtc/rtc-ds1390.c: In function 'ds1390_remove':
drivers/rtc/rtc-ds1390.c:161: warning: passing argument 1 of 'platform_get_drvdata' from incompatible pointer type drivers/rtc/rtc-ds3234.c: In function 'ds3234_remove':
drivers/rtc/rtc-ds3234.c:161: warning: passing argument 1 of 'platform_get_drvdata' from incompatible pointer type drivers/rtc/rtc-m41t94.c: In function 'm41t94_remove':
drivers/rtc/rtc-m41t94.c:139: warning: passing argument 1 of 'platform_get_drvdata' from incompatible pointer type

Cc Mark Jackson <[email protected]>
Cc Dennis Aberilla <[email protected]>
Cc Kim B. Heino <[email protected]>
---
 drivers/rtc/rtc-ds1390.c |    2 +-
 drivers/rtc/rtc-ds3234.c |    2 +-
 drivers/rtc/rtc-m41t94.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/rtc/rtc-ds1390.c +1 -1
index 26a86d2..4832248 100644
@@ -158,7 +158,7 @@ static int __devinit ds1390_probe(struct spi_device *spi)
 
 static int __devexit ds1390_remove(struct spi_device *spi)
 {
-    struct ds1390 *chip = platform_get_drvdata(spi);
+    struct ds1390 *chip = dev_get_drvdata(&spi->dev);
 
     rtc_device_unregister(chip->rtc);
     kfree(chip);
drivers/rtc/rtc-ds3234.c +1 -1
index a774ca3..07a558e 100644
@@ -158,7 +158,7 @@ static int __devinit ds3234_probe(struct spi_device *spi)
 
 static int __devexit ds3234_remove(struct spi_device *spi)
 {
-    struct rtc_device *rtc = platform_get_drvdata(spi);
+    struct rtc_device *rtc = dev_get_drvdata(&spi->dev);
 
     rtc_device_unregister(rtc);
     return 0;
drivers/rtc/rtc-m41t94.c +1 -1
index c8c97a4..21e6091 100644
@@ -136,7 +136,7 @@ static int __devinit m41t94_probe(struct spi_device *spi)
 
 static int __devexit m41t94_remove(struct spi_device *spi)
 {
-    struct rtc_device *rtc = platform_get_drvdata(spi);
+    struct rtc_device *rtc = dev_get_drvdata(&spi->dev);
 
     if (rtc)
         rtc_device_unregister(rtc);
Signature · 1 line
1.7.2
#1 lore raw

hi Dennis,

2011/3/17 Dennis Aberilla <[email protected]>:

Quoted 3 lines

Hi Axel, that doesn't seem to make sense to me since "platform_get_drvdata" is (from include/linux/platform_device.h):

#define platform_get_drvdata(_dev)      dev_get_drvdata(&(_dev)->dev)

These drivers are registered as spi drivers, not platform drivers. How about using spi_get_drvdata instead.

Regards,
Axel