From: Alexandre Belloni Date: Mon, 12 Feb 2018 22:47:35 +0000 (+0100) Subject: rtc: ds1343: simplify regmap initialization X-Git-Tag: v4.19~1240^2~102 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b5086150a685dcf8a3a2943eb7677a5fc4186782;p=platform%2Fkernel%2Flinux-rpi.git rtc: ds1343: simplify regmap initialization Avoid using memset as gcc can properly initialize structures. Signed-off-by: Alexandre Belloni --- diff --git a/drivers/rtc/rtc-ds1343.c b/drivers/rtc/rtc-ds1343.c index 895fbee..b5102cd 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;