summaryrefslogtreecommitdiff
path: root/drivers/hsi/clients
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-05 00:28:22 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-05 00:28:22 +0300
commitc9946d014fe8da95257a118ba946bd4bd44a0c86 (patch)
tree5c9581b89130180861c124f65ba46808002e381c /drivers/hsi/clients
parenta897a10141ae4deb43346fbf2ae2a5149bd7fd5a (diff)
parent67ddd75771b6b860bc0cebb3b7fd4cbebeda9cd4 (diff)
downloadlinux-c9946d014fe8da95257a118ba946bd4bd44a0c86.tar.xz
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()
Diffstat (limited to 'drivers/hsi/clients')
-rw-r--r--drivers/hsi/clients/nokia-modem.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/hsi/clients/nokia-modem.c b/drivers/hsi/clients/nokia-modem.c
index c000780d931f..f78cca98266f 100644
--- a/drivers/hsi/clients/nokia-modem.c
+++ b/drivers/hsi/clients/nokia-modem.c
@@ -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");