diff mbox series

[5/7] eeprom: at24: zero-initialize variable chip in probe

Message ID 0f7340b5-9766-debe-37b5-04b38e5344de@gmail.com
State Not Applicable
Delegated to: Bartosz Golaszewski
Headers show
Series eeprom: at24: series with smaller improvements | expand

Commit Message

Heiner Kallweit Nov. 30, 2017, 6:49 a.m. UTC
Zero-initialize variable chip to be on the safe side. This also
allows ro remove some explicit NULL initializations.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/misc/eeprom/at24.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index 837f1d88c..8fef6d5a8 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -496,7 +496,7 @@  static const struct regmap_config regmap_config_16 = {
 
 static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
 {
-	struct at24_platform_data chip;
+	struct at24_platform_data chip = {};
 	kernel_ulong_t magic = 0;
 	bool writable;
 	struct at24_data *at24;
@@ -533,9 +533,6 @@  static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
 		chip.flags = magic & AT24_BITMASK(AT24_SIZE_FLAGS);
 
 		at24_get_pdata(dev, &chip);
-
-		chip.setup = NULL;
-		chip.context = NULL;
 	}
 
 	/* both flags imply read-only */