Commit 65d55e8a authored by Markus Elfring's avatar Markus Elfring Committed by Mark Brown
Browse files

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.pdf


Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 27d30400
Loading
Loading
Loading
Loading
+1 −3
Original line number Original line Diff line number Diff line
@@ -216,10 +216,8 @@ static int spdif_in_probe(struct platform_device *pdev)
		return -EINVAL;
		return -EINVAL;


	host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
	host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
	if (!host) {
	if (!host)
		dev_warn(&pdev->dev, "kzalloc fail\n");
		return -ENOMEM;
		return -ENOMEM;
	}


	host->io_base = io_base;
	host->io_base = io_base;
	host->irq = platform_get_irq(pdev, 0);
	host->irq = platform_get_irq(pdev, 0);
+1 −3
Original line number Original line Diff line number Diff line
@@ -282,10 +282,8 @@ static int spdif_out_probe(struct platform_device *pdev)
	int ret;
	int ret;


	host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
	host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
	if (!host) {
	if (!host)
		dev_warn(&pdev->dev, "kzalloc fail\n");
		return -ENOMEM;
		return -ENOMEM;
	}


	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	host->io_base = devm_ioremap_resource(&pdev->dev, res);
	host->io_base = devm_ioremap_resource(&pdev->dev, res);