提交 65d55e8a 编写于 作者: M Markus Elfring 提交者: Mark Brown

ASoC: spear: Delete an error message for a failed memory allocation in two functions

Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdfSigned-off-by: NMarkus Elfring <elfring@users.sourceforge.net>
Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 27d30400
......@@ -216,10 +216,8 @@ static int spdif_in_probe(struct platform_device *pdev)
return -EINVAL;
host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
if (!host) {
dev_warn(&pdev->dev, "kzalloc fail\n");
if (!host)
return -ENOMEM;
}
host->io_base = io_base;
host->irq = platform_get_irq(pdev, 0);
......
......@@ -282,10 +282,8 @@ static int spdif_out_probe(struct platform_device *pdev)
int ret;
host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
if (!host) {
dev_warn(&pdev->dev, "kzalloc fail\n");
if (!host)
return -ENOMEM;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
host->io_base = devm_ioremap_resource(&pdev->dev, res);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册