提交 a9face89 编写于 作者: D Dan Carpenter 提交者: Rafael J. Wysocki

usb: typec: ucsi: acpi: fix a NULL vs IS_ERR() check in probe

The devm_memremap() function never returns NULL.  It returns error
pointers.

Fixes: cdc3d2ab ("usb: typec: ucsi: acpi: Map the mailbox with memremap()")
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 b941820e
......@@ -133,8 +133,8 @@ static int ucsi_acpi_probe(struct platform_device *pdev)
}
ua->base = devm_memremap(&pdev->dev, res->start, resource_size(res), MEMREMAP_WB);
if (!ua->base)
return -ENOMEM;
if (IS_ERR(ua->base))
return PTR_ERR(ua->base);
ret = guid_parse(UCSI_DSM_UUID, &ua->guid);
if (ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册