提交 c430cf37 编写于 作者: A Amitoj Kaur Chawla 提交者: Jassi Brar

mailbox: Fix devm_ioremap_resource error detection code

devm_ioremap_resource returns an ERR_PTR value, not NULL,
on failure.

The Coccinelle semantic patch used to make this change is
as follows:
@@
expression e,e1;
statement S;
@@

*e = devm_ioremap_resource(...);
if (!e1) S
Signed-off-by: NAmitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: NJassi Brar <jaswinder.singh@linaro.org>
上级 dd282165
......@@ -430,8 +430,8 @@ static int sti_mbox_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
mdev->base = devm_ioremap_resource(&pdev->dev, res);
if (!mdev->base)
return -ENOMEM;
if (IS_ERR(mdev->base))
return PTR_ERR(mdev->base);
ret = of_property_read_string(np, "mbox-name", &mdev->name);
if (ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册