summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-ds1343.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2018-02-13 01:47:35 +0300
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2018-03-01 12:49:24 +0300
commitb5086150a685dcf8a3a2943eb7677a5fc4186782 (patch)
treef7aff017d69ce082397408ca3351ecfbea296eed /drivers/rtc/rtc-ds1343.c
parent0391df74a608e4e65c29ddf80e704edfa8f8ef25 (diff)
downloadlinux-b5086150a685dcf8a3a2943eb7677a5fc4186782.tar.xz
rtc: ds1343: simplify regmap initialization
Avoid using memset as gcc can properly initialize structures. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-ds1343.c')
-rw-r--r--drivers/rtc/rtc-ds1343.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/rtc/rtc-ds1343.c b/drivers/rtc/rtc-ds1343.c
index 895fbeeb47fe..b5102cdd7f61 100644
--- a/drivers/rtc/rtc-ds1343.c
+++ b/drivers/rtc/rtc-ds1343.c
@@ -599,15 +599,11 @@ static const struct rtc_class_ops ds1343_rtc_ops = {
static int ds1343_probe(struct spi_device *spi)
{
struct ds1343_priv *priv;
- struct regmap_config config;
+ struct regmap_config config = { .reg_bits = 8, .val_bits = 8,
+ .write_flag_mask = 0x80, };
unsigned int data;
int res;
- memset(&config, 0, sizeof(config));
- config.reg_bits = 8;
- config.val_bits = 8;
- config.write_flag_mask = 0x80;
-
priv = devm_kzalloc(&spi->dev, sizeof(struct ds1343_priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;