* [PATCH v2] soundwire: amd: fix an error check in probe()
@ 2023-04-06 13:22 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2023-04-06 13:22 UTC (permalink / raw)
To: Vijendar Mukunda
Cc: Bard Liao, Pierre-Louis Bossart, Sanyog Kale, alsa-devel,
kernel-janitors
This code is testing the wrong variable. It should be ->acp_mmio
instead of ->mmio. It also should be a NULL check instead of an
IS_ERR() check.
Fixes: a673a8dfc214 ("soundwire: amd: Add support for AMD Manager driver")
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
v2: My first patch just fixed the NULL vs IS_ERR() but because it was
using the wrong variable that broke the driver completely. Thanks,
Vijendar for finding this:
Fixes-from: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
drivers/soundwire/amd_manager.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c
index 9fb7f91ca182..21c638e38c51 100644
--- a/drivers/soundwire/amd_manager.c
+++ b/drivers/soundwire/amd_manager.c
@@ -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 +
--
2.39.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-04-06 13:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-06 13:22 [PATCH v2] soundwire: amd: fix an error check in probe() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).