Skip to content

Commit

Permalink
soundwire: amd: Fix a check for errors in probe()
Browse files Browse the repository at this point in the history
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" <vijendar.mukunda@amd.com>
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/9863b2bf-0de2-4bf8-8f09-fe24dc5c63ff@moroto.mountain
Signed-off-by: Vinod Koul <vkoul@kernel.org>
  • Loading branch information
Dan Carpenter authored and Vinod Koul committed Jul 13, 2023
1 parent f84d41b commit 7891d0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/soundwire/amd_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -910,9 +910,9 @@ static int amd_sdw_manager_probe(struct platform_device *pdev)
return -ENOMEM;

amd_manager->acp_mmio = devm_ioremap(dev, res->start, resource_size(res));
if (IS_ERR(amd_manager->mmio)) {
if (!amd_manager->acp_mmio) {
dev_err(dev, "mmio not found\n");
return PTR_ERR(amd_manager->mmio);
return -ENOMEM;
}
amd_manager->instance = pdata->instance;
amd_manager->mmio = amd_manager->acp_mmio +
Expand Down

0 comments on commit 7891d0a

Please sign in to comment.