Merge tag 'hsi-for-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi

Pull HSI updates from Sebastian Reichel:
 "Misc cleanups"

* tag 'hsi-for-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi:
  HSI: core: Use kcalloc() in two functions
  HSI: Use kcalloc() in hsi_register_board_info()
  HSI: omap_ssi: Delete an error message for a failed memory allocation in ssi_add_controller()
  HSI: omap_ssi: Fix a typo in a comment line
  HSI: omap_ssi: Use devm_kcalloc() in ssi_add_controller()
  HSI: nokia-modem: Add a space character for better code readability in nokia_modem_probe()
  HSI: nokia-modem: Delete error messages for a failed memory allocation in two functions
  HSI: nokia-modem: Use devm_kcalloc() in nokia_modem_gpio_probe()
This commit is contained in:
Linus Torvalds
2017-07-04 14:28:22 -07:00
4 changed files with 14 additions and 20 deletions

View File

@@ -102,12 +102,10 @@ static int nokia_modem_gpio_probe(struct device *dev)
return -EINVAL;
}
modem->gpios = devm_kzalloc(dev, gpio_count *
sizeof(struct nokia_modem_gpio), GFP_KERNEL);
if (!modem->gpios) {
dev_err(dev, "Could not allocate memory for gpios\n");
modem->gpios = devm_kcalloc(dev, gpio_count, sizeof(*modem->gpios),
GFP_KERNEL);
if (!modem->gpios)
return -ENOMEM;
}
modem->gpio_amount = gpio_count;
@@ -156,10 +154,9 @@ static int nokia_modem_probe(struct device *dev)
}
modem = devm_kzalloc(dev, sizeof(*modem), GFP_KERNEL);
if (!modem) {
dev_err(dev, "Could not allocate memory for nokia_modem_device\n");
if (!modem)
return -ENOMEM;
}
dev_set_drvdata(dev, modem);
modem->device = dev;
@@ -182,7 +179,7 @@ static int nokia_modem_probe(struct device *dev)
}
enable_irq_wake(irq);
if(pm) {
if (pm) {
err = nokia_modem_gpio_probe(dev);
if (err < 0) {
dev_err(dev, "Could not probe GPIOs\n");