aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-prosavage.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-prosavage.c')
-rw-r--r--drivers/i2c/busses/i2c-prosavage.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-prosavage.c b/drivers/i2c/busses/i2c-prosavage.c
index 92b744273577..42f8b5ce3bf8 100644
--- a/drivers/i2c/busses/i2c-prosavage.c
+++ b/drivers/i2c/busses/i2c-prosavage.c
@@ -241,14 +241,12 @@ static int __devinit prosavage_probe(struct pci_dev *dev, const struct pci_devic
241 struct s_i2c_chip *chip; 241 struct s_i2c_chip *chip;
242 struct s_i2c_bus *bus; 242 struct s_i2c_bus *bus;
243 243
244 pci_set_drvdata(dev, kmalloc(sizeof(struct s_i2c_chip), GFP_KERNEL)); 244 pci_set_drvdata(dev, kzalloc(sizeof(struct s_i2c_chip), GFP_KERNEL));
245 chip = (struct s_i2c_chip *)pci_get_drvdata(dev); 245 chip = (struct s_i2c_chip *)pci_get_drvdata(dev);
246 if (chip == NULL) { 246 if (chip == NULL) {
247 return -ENOMEM; 247 return -ENOMEM;
248 } 248 }
249 249
250 memset(chip, 0, sizeof(struct s_i2c_chip));
251
252 base = dev->resource[0].start & PCI_BASE_ADDRESS_MEM_MASK; 250 base = dev->resource[0].start & PCI_BASE_ADDRESS_MEM_MASK;
253 len = dev->resource[0].end - base + 1; 251 len = dev->resource[0].end - base + 1;
254 chip->mmio = ioremap_nocache(base, len); 252 chip->mmio = ioremap_nocache(base, len);