From: Markus Elfring Date: Sat, 13 May 2017 13:05:28 +0000 (+0200) Subject: mmc: atmel-mci: Delete an error message for a failed memory allocation X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9b344ba4205ee19dec1a57dd7bdc38473336e19e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mmc: atmel-mci: Delete an error message for a failed memory allocation Omit an extra message for a memory allocation failure. This issue was detected by using the Coccinelle software. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index 2e96d964f582..97de2d32ba84 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -660,10 +660,8 @@ atmci_of_init(struct platform_device *pdev) } pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); - if (!pdata) { - dev_err(&pdev->dev, "could not allocate memory for pdata\n"); + if (!pdata) return ERR_PTR(-ENOMEM); - } for_each_child_of_node(np, cnp) { if (of_property_read_u32(cnp, "reg", &slot_id)) {