From a9face899413f468460219c79503c091c4d362cb Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 9 May 2022 12:08:28 +0300 Subject: 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: cdc3d2abf438 ("usb: typec: ucsi: acpi: Map the mailbox with memremap()") Signed-off-by: Dan Carpenter Reviewed-by: Heikki Krogerus Acked-by: Greg Kroah-Hartman Signed-off-by: Rafael J. Wysocki --- drivers/usb/typec/ucsi/ucsi_acpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/usb') diff --git a/drivers/usb/typec/ucsi/ucsi_acpi.c b/drivers/usb/typec/ucsi/ucsi_acpi.c index 7455e3aff2be..8873c1644a29 100644 --- a/drivers/usb/typec/ucsi/ucsi_acpi.c +++ b/drivers/usb/typec/ucsi/ucsi_acpi.c @@ -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) -- cgit v1.2.3