diff mbox series

[4/6] rtc: pcf2127: provide ->read8_array method

Message ID 20200504212032.3759-5-rasmus.villemoes@prevas.dk
State Superseded
Delegated to: Tom Rini
Headers show
Series rtc: add rtc_{read,write}8_array and rtc command | expand

Commit Message

Rasmus Villemoes May 4, 2020, 9:20 p.m. UTC
This simply consists of renaming the existing pcf2127_read_reg()
helper to follow the naming of the other
methods (i.e. pcf2127_rtc_<method name>) and changing the type of its
"len" parameter.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
---
 drivers/rtc/pcf2127.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Simon Glass May 6, 2020, 3:42 a.m. UTC | #1
On Mon, 4 May 2020 at 15:20, Rasmus Villemoes
<rasmus.villemoes@prevas.dk> wrote:
>
> This simply consists of renaming the existing pcf2127_read_reg()
> helper to follow the naming of the other
> methods (i.e. pcf2127_rtc_<method name>) and changing the type of its
> "len" parameter.
>
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
> ---
>  drivers/rtc/pcf2127.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/drivers/rtc/pcf2127.c b/drivers/rtc/pcf2127.c
index b34ed63bf0..b3f6de8496 100644
--- a/drivers/rtc/pcf2127.c
+++ b/drivers/rtc/pcf2127.c
@@ -22,8 +22,8 @@ 
 #define PCF2127_REG_MO		0x08
 #define PCF2127_REG_YR		0x09
 
-static int pcf2127_read_reg(struct udevice *dev, uint offset,
-			    u8 *buffer, int len)
+static int pcf2127_rtc_read8_array(struct udevice *dev, uint offset,
+				   u8 *buffer, uint len)
 {
 	struct dm_i2c_chip *chip = dev_get_parent_platdata(dev);
 	struct i2c_msg msg;
@@ -72,7 +72,7 @@  static int pcf2127_rtc_get(struct udevice *dev, struct rtc_time *tm)
 	int ret = 0;
 	uchar buf[10] = { PCF2127_REG_CTRL1 };
 
-	ret = pcf2127_read_reg(dev, PCF2127_REG_CTRL1, buf, sizeof(buf));
+	ret = pcf2127_rtc_read8_array(dev, PCF2127_REG_CTRL1, buf, sizeof(buf));
 	if (ret < 0)
 		return ret;
 
@@ -109,6 +109,7 @@  static const struct rtc_ops pcf2127_rtc_ops = {
 	.get = pcf2127_rtc_get,
 	.set = pcf2127_rtc_set,
 	.reset = pcf2127_rtc_reset,
+	.read8_array = pcf2127_rtc_read8_array,
 };
 
 static const struct udevice_id pcf2127_rtc_ids[] = {