Commit b5086150 authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: ds1343: simplify regmap initialization

Avoid using memset as gcc can properly initialize structures.
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 0391df74
...@@ -599,15 +599,11 @@ static const struct rtc_class_ops ds1343_rtc_ops = { ...@@ -599,15 +599,11 @@ static const struct rtc_class_ops ds1343_rtc_ops = {
static int ds1343_probe(struct spi_device *spi) static int ds1343_probe(struct spi_device *spi)
{ {
struct ds1343_priv *priv; 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; unsigned int data;
int res; 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); priv = devm_kzalloc(&spi->dev, sizeof(struct ds1343_priv), GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment