Skip to content

Commit 7891d0a

Browse files
Dan Carpentervinodkoul
authored andcommitted
soundwire: amd: Fix a check for errors in probe()
This code has two problems: 1) The devm_ioremap() function returns NULL, not error pointers. 2) It's checking the wrong variable. ->mmio instead of ->acp_mmio. Fixes: d8f48fb ("soundwire: amd: Add support for AMD Manager driver") Suggested-by: "Mukunda,Vijendar" <[email protected]> Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent f84d41b commit 7891d0a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/soundwire/amd_manager.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -910,9 +910,9 @@ static int amd_sdw_manager_probe(struct platform_device *pdev)
910910
return -ENOMEM;
911911

912912
amd_manager->acp_mmio = devm_ioremap(dev, res->start, resource_size(res));
913-
if (IS_ERR(amd_manager->mmio)) {
913+
if (!amd_manager->acp_mmio) {
914914
dev_err(dev, "mmio not found\n");
915-
return PTR_ERR(amd_manager->mmio);
915+
return -ENOMEM;
916916
}
917917
amd_manager->instance = pdata->instance;
918918
amd_manager->mmio = amd_manager->acp_mmio +

0 commit comments

Comments
 (0)