Skip to content

Commit fe68278

Browse files
andy-shevwsakernel
authored andcommitted
i2c: designware-pci: Use standard pattern for memory allocation
The pattern foo = kmalloc(sizeof(*foo), GFP_KERNEL); has an advantage when foo type is changed. Since we are planning a such, better to be prepared by using standard pattern for memory allocation. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent 6576916 commit fe68278

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/i2c/busses/i2c-designware-pcidrv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
263263
return dev_err_probe(&pdev->dev, r,
264264
"I/O memory remapping failed\n");
265265

266-
dev = devm_kzalloc(&pdev->dev, sizeof(struct dw_i2c_dev), GFP_KERNEL);
266+
dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
267267
if (!dev)
268268
return -ENOMEM;
269269

0 commit comments

Comments
 (0)