summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-pcf85063.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-pcf85063.c')
-rw-r--r--drivers/rtc/rtc-pcf85063.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-pcf85063.c b/drivers/rtc/rtc-pcf85063.c
index bf2e370907b7..89e080798e03 100644
--- a/drivers/rtc/rtc-pcf85063.c
+++ b/drivers/rtc/rtc-pcf85063.c
@@ -320,7 +320,16 @@ static const struct rtc_class_ops pcf85063_rtc_ops = {
static int pcf85063_nvmem_read(void *priv, unsigned int offset,
void *val, size_t bytes)
{
- return regmap_read(priv, PCF85063_REG_RAM, val);
+ unsigned int tmp;
+ int ret;
+
+ ret = regmap_read(priv, PCF85063_REG_RAM, &tmp);
+ if (ret < 0)
+ return ret;
+
+ *(u8 *)val = tmp;
+
+ return 0;
}
static int pcf85063_nvmem_write(void *priv, unsigned int offset,