diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2019-12-14 23:10:11 +0100 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2019-12-18 10:37:54 +0100 |
commit | 35c2daaf554b3e6bb4a3ff4438e801e57ae5a0a3 (patch) | |
tree | b481dc4214892baea474aee317a96f218bff784c /drivers/rtc | |
parent | 54c5970df449103ec1181b92d41a2d14a79fe562 (diff) | |
download | linux-35c2daaf554b3e6bb4a3ff4438e801e57ae5a0a3.tar.gz linux-35c2daaf554b3e6bb4a3ff4438e801e57ae5a0a3.tar.bz2 linux-35c2daaf554b3e6bb4a3ff4438e801e57ae5a0a3.zip |
rtc: rv3029: avoid reading the status register uselessly
RV3029_STATUS is read in multiple location but its value is never used
afterwards. Avoid this register access when not necessary.
Link: https://lore.kernel.org/r/20191214221022.622482-6-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-rv3029c2.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/drivers/rtc/rtc-rv3029c2.c b/drivers/rtc/rtc-rv3029c2.c index 421c66708138..9b152dfbc4a5 100644 --- a/drivers/rtc/rtc-rv3029c2.c +++ b/drivers/rtc/rtc-rv3029c2.c @@ -333,16 +333,9 @@ static irqreturn_t rv3029_handle_irq(int irq, void *dev_id) static int rv3029_read_time(struct device *dev, struct rtc_time *tm) { - u8 buf[1]; int ret; u8 regs[RV3029_WATCH_SECTION_LEN] = { 0, }; - ret = rv3029_get_sr(dev, buf); - if (ret < 0) { - dev_err(dev, "%s: reading SR failed\n", __func__); - return -EIO; - } - ret = rv3029_read_regs(dev, RV3029_W_SEC, regs, RV3029_WATCH_SECTION_LEN); if (ret < 0) { @@ -380,12 +373,6 @@ static int rv3029_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) int ret; u8 regs[8], controls, flags; - ret = rv3029_get_sr(dev, regs); - if (ret < 0) { - dev_err(dev, "%s: reading SR failed\n", __func__); - return -EIO; - } - ret = rv3029_read_regs(dev, RV3029_A_SC, regs, RV3029_ALARM_SECTION_LEN); @@ -459,12 +446,6 @@ static int rv3029_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) if (tm->tm_year < 100) return -EINVAL; - ret = rv3029_get_sr(dev, regs); - if (ret < 0) { - dev_err(dev, "%s: reading SR failed\n", __func__); - return -EIO; - } - /* Activate all the alarms with AE_x bit */ regs[RV3029_A_SC - RV3029_A_SC] = bin2bcd(tm->tm_sec) | RV3029_A_AE_X; regs[RV3029_A_MN - RV3029_A_SC] = bin2bcd(tm->tm_min) | RV3029_A_AE_X; @@ -748,7 +729,6 @@ static int rv3029_probe(struct device *dev, struct regmap *regmap, int irq, { struct rv3029_data *rv3029; int rc = 0; - u8 buf[1]; rv3029 = devm_kzalloc(dev, sizeof(*rv3029), GFP_KERNEL); if (!rv3029) @@ -759,12 +739,6 @@ static int rv3029_probe(struct device *dev, struct regmap *regmap, int irq, rv3029->dev = dev; dev_set_drvdata(dev, rv3029); - rc = rv3029_get_sr(dev, buf); - if (rc < 0) { - dev_err(dev, "reading status failed\n"); - return rc; - } - rv3029_trickle_config(dev); rv3029_hwmon_register(dev, name); |