Commit 5ccb7d71 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

drivers/rtc/rtc-s5m.c: fix info->rtc assignment

Fix this warning:

  drivers/rtc/rtc-s5m.c: In function `s5m_rtc_probe':
  drivers/rtc/rtc-s5m.c:545: warning: assignment from incompatible pointer type

struct s5m_rtc_info.rtc has type "struct regmap *", while
struct sec_pmic_dev.rtc has type "struct i2c_client *".

Probably the author wanted to assign "struct sec_pmic_dev.regmap", which
has the correct type.

Also, as "rtc" doesn't make much sense as a name for a regmap, rename it
to "regmap".
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Cc: Sangbeom Kim <sbkim73@samsung.com>
Cc: Sachin Kamat <sachin.kamat@linaro.org>
Tested-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 386e7906
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
struct s5m_rtc_info { struct s5m_rtc_info {
struct device *dev; struct device *dev;
struct sec_pmic_dev *s5m87xx; struct sec_pmic_dev *s5m87xx;
struct regmap *rtc; struct regmap *regmap;
struct rtc_device *rtc_dev; struct rtc_device *rtc_dev;
int irq; int irq;
int device_type; int device_type;
...@@ -89,7 +89,7 @@ static inline int s5m8767_rtc_set_time_reg(struct s5m_rtc_info *info) ...@@ -89,7 +89,7 @@ static inline int s5m8767_rtc_set_time_reg(struct s5m_rtc_info *info)
int ret; int ret;
unsigned int data; unsigned int data;
ret = regmap_read(info->rtc, SEC_RTC_UDR_CON, &data); ret = regmap_read(info->regmap, SEC_RTC_UDR_CON, &data);
if (ret < 0) { if (ret < 0) {
dev_err(info->dev, "failed to read update reg(%d)\n", ret); dev_err(info->dev, "failed to read update reg(%d)\n", ret);
return ret; return ret;
...@@ -98,14 +98,14 @@ static inline int s5m8767_rtc_set_time_reg(struct s5m_rtc_info *info) ...@@ -98,14 +98,14 @@ static inline int s5m8767_rtc_set_time_reg(struct s5m_rtc_info *info)
data |= RTC_TIME_EN_MASK; data |= RTC_TIME_EN_MASK;
data |= RTC_UDR_MASK; data |= RTC_UDR_MASK;
ret = regmap_write(info->rtc, SEC_RTC_UDR_CON, data); ret = regmap_write(info->regmap, SEC_RTC_UDR_CON, data);
if (ret < 0) { if (ret < 0) {
dev_err(info->dev, "failed to write update reg(%d)\n", ret); dev_err(info->dev, "failed to write update reg(%d)\n", ret);
return ret; return ret;
} }
do { do {
ret = regmap_read(info->rtc, SEC_RTC_UDR_CON, &data); ret = regmap_read(info->regmap, SEC_RTC_UDR_CON, &data);
} while ((data & RTC_UDR_MASK) && !ret); } while ((data & RTC_UDR_MASK) && !ret);
return ret; return ret;
...@@ -116,7 +116,7 @@ static inline int s5m8767_rtc_set_alarm_reg(struct s5m_rtc_info *info) ...@@ -116,7 +116,7 @@ static inline int s5m8767_rtc_set_alarm_reg(struct s5m_rtc_info *info)
int ret; int ret;
unsigned int data; unsigned int data;
ret = regmap_read(info->rtc, SEC_RTC_UDR_CON, &data); ret = regmap_read(info->regmap, SEC_RTC_UDR_CON, &data);
if (ret < 0) { if (ret < 0) {
dev_err(info->dev, "%s: fail to read update reg(%d)\n", dev_err(info->dev, "%s: fail to read update reg(%d)\n",
__func__, ret); __func__, ret);
...@@ -126,7 +126,7 @@ static inline int s5m8767_rtc_set_alarm_reg(struct s5m_rtc_info *info) ...@@ -126,7 +126,7 @@ static inline int s5m8767_rtc_set_alarm_reg(struct s5m_rtc_info *info)
data &= ~RTC_TIME_EN_MASK; data &= ~RTC_TIME_EN_MASK;
data |= RTC_UDR_MASK; data |= RTC_UDR_MASK;
ret = regmap_write(info->rtc, SEC_RTC_UDR_CON, data); ret = regmap_write(info->regmap, SEC_RTC_UDR_CON, data);
if (ret < 0) { if (ret < 0) {
dev_err(info->dev, "%s: fail to write update reg(%d)\n", dev_err(info->dev, "%s: fail to write update reg(%d)\n",
__func__, ret); __func__, ret);
...@@ -134,7 +134,7 @@ static inline int s5m8767_rtc_set_alarm_reg(struct s5m_rtc_info *info) ...@@ -134,7 +134,7 @@ static inline int s5m8767_rtc_set_alarm_reg(struct s5m_rtc_info *info)
} }
do { do {
ret = regmap_read(info->rtc, SEC_RTC_UDR_CON, &data); ret = regmap_read(info->regmap, SEC_RTC_UDR_CON, &data);
} while ((data & RTC_UDR_MASK) && !ret); } while ((data & RTC_UDR_MASK) && !ret);
return ret; return ret;
...@@ -178,7 +178,7 @@ static int s5m_rtc_read_time(struct device *dev, struct rtc_time *tm) ...@@ -178,7 +178,7 @@ static int s5m_rtc_read_time(struct device *dev, struct rtc_time *tm)
u8 data[8]; u8 data[8];
int ret; int ret;
ret = regmap_bulk_read(info->rtc, SEC_RTC_SEC, data, 8); ret = regmap_bulk_read(info->regmap, SEC_RTC_SEC, data, 8);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -226,7 +226,7 @@ static int s5m_rtc_set_time(struct device *dev, struct rtc_time *tm) ...@@ -226,7 +226,7 @@ static int s5m_rtc_set_time(struct device *dev, struct rtc_time *tm)
1900 + tm->tm_year, 1 + tm->tm_mon, tm->tm_mday, 1900 + tm->tm_year, 1 + tm->tm_mon, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec, tm->tm_wday); tm->tm_hour, tm->tm_min, tm->tm_sec, tm->tm_wday);
ret = regmap_raw_write(info->rtc, SEC_RTC_SEC, data, 8); ret = regmap_raw_write(info->regmap, SEC_RTC_SEC, data, 8);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -242,20 +242,20 @@ static int s5m_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) ...@@ -242,20 +242,20 @@ static int s5m_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
unsigned int val; unsigned int val;
int ret, i; int ret, i;
ret = regmap_bulk_read(info->rtc, SEC_ALARM0_SEC, data, 8); ret = regmap_bulk_read(info->regmap, SEC_ALARM0_SEC, data, 8);
if (ret < 0) if (ret < 0)
return ret; return ret;
switch (info->device_type) { switch (info->device_type) {
case S5M8763X: case S5M8763X:
s5m8763_data_to_tm(data, &alrm->time); s5m8763_data_to_tm(data, &alrm->time);
ret = regmap_read(info->rtc, SEC_ALARM0_CONF, &val); ret = regmap_read(info->regmap, SEC_ALARM0_CONF, &val);
if (ret < 0) if (ret < 0)
return ret; return ret;
alrm->enabled = !!val; alrm->enabled = !!val;
ret = regmap_read(info->rtc, SEC_RTC_STATUS, &val); ret = regmap_read(info->regmap, SEC_RTC_STATUS, &val);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -278,7 +278,7 @@ static int s5m_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) ...@@ -278,7 +278,7 @@ static int s5m_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
} }
alrm->pending = 0; alrm->pending = 0;
ret = regmap_read(info->rtc, SEC_RTC_STATUS, &val); ret = regmap_read(info->regmap, SEC_RTC_STATUS, &val);
if (ret < 0) if (ret < 0)
return ret; return ret;
break; break;
...@@ -301,7 +301,7 @@ static int s5m_rtc_stop_alarm(struct s5m_rtc_info *info) ...@@ -301,7 +301,7 @@ static int s5m_rtc_stop_alarm(struct s5m_rtc_info *info)
int ret, i; int ret, i;
struct rtc_time tm; struct rtc_time tm;
ret = regmap_bulk_read(info->rtc, SEC_ALARM0_SEC, data, 8); ret = regmap_bulk_read(info->regmap, SEC_ALARM0_SEC, data, 8);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -312,14 +312,14 @@ static int s5m_rtc_stop_alarm(struct s5m_rtc_info *info) ...@@ -312,14 +312,14 @@ static int s5m_rtc_stop_alarm(struct s5m_rtc_info *info)
switch (info->device_type) { switch (info->device_type) {
case S5M8763X: case S5M8763X:
ret = regmap_write(info->rtc, SEC_ALARM0_CONF, 0); ret = regmap_write(info->regmap, SEC_ALARM0_CONF, 0);
break; break;
case S5M8767X: case S5M8767X:
for (i = 0; i < 7; i++) for (i = 0; i < 7; i++)
data[i] &= ~ALARM_ENABLE_MASK; data[i] &= ~ALARM_ENABLE_MASK;
ret = regmap_raw_write(info->rtc, SEC_ALARM0_SEC, data, 8); ret = regmap_raw_write(info->regmap, SEC_ALARM0_SEC, data, 8);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -341,7 +341,7 @@ static int s5m_rtc_start_alarm(struct s5m_rtc_info *info) ...@@ -341,7 +341,7 @@ static int s5m_rtc_start_alarm(struct s5m_rtc_info *info)
u8 alarm0_conf; u8 alarm0_conf;
struct rtc_time tm; struct rtc_time tm;
ret = regmap_bulk_read(info->rtc, SEC_ALARM0_SEC, data, 8); ret = regmap_bulk_read(info->regmap, SEC_ALARM0_SEC, data, 8);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -353,7 +353,7 @@ static int s5m_rtc_start_alarm(struct s5m_rtc_info *info) ...@@ -353,7 +353,7 @@ static int s5m_rtc_start_alarm(struct s5m_rtc_info *info)
switch (info->device_type) { switch (info->device_type) {
case S5M8763X: case S5M8763X:
alarm0_conf = 0x77; alarm0_conf = 0x77;
ret = regmap_write(info->rtc, SEC_ALARM0_CONF, alarm0_conf); ret = regmap_write(info->regmap, SEC_ALARM0_CONF, alarm0_conf);
break; break;
case S5M8767X: case S5M8767X:
...@@ -368,7 +368,7 @@ static int s5m_rtc_start_alarm(struct s5m_rtc_info *info) ...@@ -368,7 +368,7 @@ static int s5m_rtc_start_alarm(struct s5m_rtc_info *info)
if (data[RTC_YEAR1] & 0x7f) if (data[RTC_YEAR1] & 0x7f)
data[RTC_YEAR1] |= ALARM_ENABLE_MASK; data[RTC_YEAR1] |= ALARM_ENABLE_MASK;
ret = regmap_raw_write(info->rtc, SEC_ALARM0_SEC, data, 8); ret = regmap_raw_write(info->regmap, SEC_ALARM0_SEC, data, 8);
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = s5m8767_rtc_set_alarm_reg(info); ret = s5m8767_rtc_set_alarm_reg(info);
...@@ -410,7 +410,7 @@ static int s5m_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) ...@@ -410,7 +410,7 @@ static int s5m_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = regmap_raw_write(info->rtc, SEC_ALARM0_SEC, data, 8); ret = regmap_raw_write(info->regmap, SEC_ALARM0_SEC, data, 8);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -455,7 +455,7 @@ static const struct rtc_class_ops s5m_rtc_ops = { ...@@ -455,7 +455,7 @@ static const struct rtc_class_ops s5m_rtc_ops = {
static void s5m_rtc_enable_wtsr(struct s5m_rtc_info *info, bool enable) static void s5m_rtc_enable_wtsr(struct s5m_rtc_info *info, bool enable)
{ {
int ret; int ret;
ret = regmap_update_bits(info->rtc, SEC_WTSR_SMPL_CNTL, ret = regmap_update_bits(info->regmap, SEC_WTSR_SMPL_CNTL,
WTSR_ENABLE_MASK, WTSR_ENABLE_MASK,
enable ? WTSR_ENABLE_MASK : 0); enable ? WTSR_ENABLE_MASK : 0);
if (ret < 0) if (ret < 0)
...@@ -466,7 +466,7 @@ static void s5m_rtc_enable_wtsr(struct s5m_rtc_info *info, bool enable) ...@@ -466,7 +466,7 @@ static void s5m_rtc_enable_wtsr(struct s5m_rtc_info *info, bool enable)
static void s5m_rtc_enable_smpl(struct s5m_rtc_info *info, bool enable) static void s5m_rtc_enable_smpl(struct s5m_rtc_info *info, bool enable)
{ {
int ret; int ret;
ret = regmap_update_bits(info->rtc, SEC_WTSR_SMPL_CNTL, ret = regmap_update_bits(info->regmap, SEC_WTSR_SMPL_CNTL,
SMPL_ENABLE_MASK, SMPL_ENABLE_MASK,
enable ? SMPL_ENABLE_MASK : 0); enable ? SMPL_ENABLE_MASK : 0);
if (ret < 0) if (ret < 0)
...@@ -481,7 +481,7 @@ static int s5m8767_rtc_init_reg(struct s5m_rtc_info *info) ...@@ -481,7 +481,7 @@ static int s5m8767_rtc_init_reg(struct s5m_rtc_info *info)
int ret; int ret;
struct rtc_time tm; struct rtc_time tm;
ret = regmap_read(info->rtc, SEC_RTC_UDR_CON, &tp_read); ret = regmap_read(info->regmap, SEC_RTC_UDR_CON, &tp_read);
if (ret < 0) { if (ret < 0) {
dev_err(info->dev, "%s: fail to read control reg(%d)\n", dev_err(info->dev, "%s: fail to read control reg(%d)\n",
__func__, ret); __func__, ret);
...@@ -493,7 +493,7 @@ static int s5m8767_rtc_init_reg(struct s5m_rtc_info *info) ...@@ -493,7 +493,7 @@ static int s5m8767_rtc_init_reg(struct s5m_rtc_info *info)
data[1] = (0 << BCD_EN_SHIFT) | (1 << MODEL24_SHIFT); data[1] = (0 << BCD_EN_SHIFT) | (1 << MODEL24_SHIFT);
info->rtc_24hr_mode = 1; info->rtc_24hr_mode = 1;
ret = regmap_raw_write(info->rtc, SEC_ALARM0_CONF, data, 2); ret = regmap_raw_write(info->regmap, SEC_ALARM0_CONF, data, 2);
if (ret < 0) { if (ret < 0) {
dev_err(info->dev, "%s: fail to write controlm reg(%d)\n", dev_err(info->dev, "%s: fail to write controlm reg(%d)\n",
__func__, ret); __func__, ret);
...@@ -515,7 +515,7 @@ static int s5m8767_rtc_init_reg(struct s5m_rtc_info *info) ...@@ -515,7 +515,7 @@ static int s5m8767_rtc_init_reg(struct s5m_rtc_info *info)
ret = s5m_rtc_set_time(info->dev, &tm); ret = s5m_rtc_set_time(info->dev, &tm);
} }
ret = regmap_update_bits(info->rtc, SEC_RTC_UDR_CON, ret = regmap_update_bits(info->regmap, SEC_RTC_UDR_CON,
RTC_TCON_MASK, tp_read | RTC_TCON_MASK); RTC_TCON_MASK, tp_read | RTC_TCON_MASK);
if (ret < 0) if (ret < 0)
dev_err(info->dev, "%s: fail to update TCON reg(%d)\n", dev_err(info->dev, "%s: fail to update TCON reg(%d)\n",
...@@ -542,7 +542,7 @@ static int s5m_rtc_probe(struct platform_device *pdev) ...@@ -542,7 +542,7 @@ static int s5m_rtc_probe(struct platform_device *pdev)
info->dev = &pdev->dev; info->dev = &pdev->dev;
info->s5m87xx = s5m87xx; info->s5m87xx = s5m87xx;
info->rtc = s5m87xx->rtc; info->regmap = s5m87xx->regmap;
info->device_type = s5m87xx->device_type; info->device_type = s5m87xx->device_type;
info->wtsr_smpl = s5m87xx->wtsr_smpl; info->wtsr_smpl = s5m87xx->wtsr_smpl;
...@@ -596,7 +596,7 @@ static void s5m_rtc_shutdown(struct platform_device *pdev) ...@@ -596,7 +596,7 @@ static void s5m_rtc_shutdown(struct platform_device *pdev)
if (info->wtsr_smpl) { if (info->wtsr_smpl) {
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
s5m_rtc_enable_wtsr(info, false); s5m_rtc_enable_wtsr(info, false);
regmap_read(info->rtc, SEC_WTSR_SMPL_CNTL, &val); regmap_read(info->regmap, SEC_WTSR_SMPL_CNTL, &val);
pr_debug("%s: WTSR_SMPL reg(0x%02x)\n", __func__, val); pr_debug("%s: WTSR_SMPL reg(0x%02x)\n", __func__, val);
if (val & WTSR_ENABLE_MASK) if (val & WTSR_ENABLE_MASK)
pr_emerg("%s: fail to disable WTSR\n", pr_emerg("%s: fail to disable WTSR\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment