* [PATCH -next 1/3] ASoC: amd: acp: add missing platform_device_unregister() in acp_pci_probe()
@ 2022-08-19 7:37 Yang Yingliang
2022-08-19 7:37 ` [PATCH -next 2/3] ASoC: amd: acp: switch to use dev_err_probe() Yang Yingliang
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Yang Yingliang @ 2022-08-19 7:37 UTC (permalink / raw)
To: linux-kernel, alsa-devel; +Cc: venkataprasad.potturu, Vijendar.Mukunda, broonie
Add missing platform_device_unregister() in error path in acp_pci_probe().
Fixes: c49f5e74a11e ("ASoC: amd: acp: Add error handling cases")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
sound/soc/amd/acp/acp-pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c
index 2c8e960cc9a6..5bb23ebe1216 100644
--- a/sound/soc/amd/acp/acp-pci.c
+++ b/sound/soc/amd/acp/acp-pci.c
@@ -104,6 +104,7 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id
addr = pci_resource_start(pci, 0);
chip->base = devm_ioremap(&pci->dev, addr, pci_resource_len(pci, 0));
if (!chip->base) {
+ platform_device_unregister(dmic_dev);
ret = -ENOMEM;
goto release_regions;
}
--
2.25.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH -next 2/3] ASoC: amd: acp: switch to use dev_err_probe()
2022-08-19 7:37 [PATCH -next 1/3] ASoC: amd: acp: add missing platform_device_unregister() in acp_pci_probe() Yang Yingliang
@ 2022-08-19 7:37 ` Yang Yingliang
2022-08-19 7:37 ` [PATCH -next 3/3] ASoC: amd: acp: add a label to make error path more clean Yang Yingliang
2022-08-19 22:47 ` [PATCH -next 1/3] ASoC: amd: acp: add missing platform_device_unregister() in acp_pci_probe() Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Yang Yingliang @ 2022-08-19 7:37 UTC (permalink / raw)
To: linux-kernel, alsa-devel; +Cc: venkataprasad.potturu, Vijendar.Mukunda, broonie
Use dev_err_probe() to simplify code and print error code.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
sound/soc/amd/acp/acp-pci.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c
index 5bb23ebe1216..691350646f1b 100644
--- a/sound/soc/amd/acp/acp-pci.c
+++ b/sound/soc/amd/acp/acp-pci.c
@@ -62,10 +62,9 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id
if (!chip)
return -ENOMEM;
- if (pci_enable_device(pci)) {
- dev_err(&pci->dev, "pci_enable_device failed\n");
- return -ENODEV;
- }
+ if (pci_enable_device(pci))
+ return dev_err_probe(&pci->dev, -ENODEV,
+ "pci_enable_device failed\n");
ret = pci_request_regions(pci, "AMD ACP3x audio");
if (ret < 0) {
--
2.25.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH -next 3/3] ASoC: amd: acp: add a label to make error path more clean
2022-08-19 7:37 [PATCH -next 1/3] ASoC: amd: acp: add missing platform_device_unregister() in acp_pci_probe() Yang Yingliang
2022-08-19 7:37 ` [PATCH -next 2/3] ASoC: amd: acp: switch to use dev_err_probe() Yang Yingliang
@ 2022-08-19 7:37 ` Yang Yingliang
2022-08-19 22:47 ` [PATCH -next 1/3] ASoC: amd: acp: add missing platform_device_unregister() in acp_pci_probe() Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Yang Yingliang @ 2022-08-19 7:37 UTC (permalink / raw)
To: linux-kernel, alsa-devel; +Cc: venkataprasad.potturu, Vijendar.Mukunda, broonie
Move platform_device_unregister() to a new label to make code more clean.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
sound/soc/amd/acp/acp-pci.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/sound/soc/amd/acp/acp-pci.c b/sound/soc/amd/acp/acp-pci.c
index 691350646f1b..ef2ce083521e 100644
--- a/sound/soc/amd/acp/acp-pci.c
+++ b/sound/soc/amd/acp/acp-pci.c
@@ -103,16 +103,14 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id
addr = pci_resource_start(pci, 0);
chip->base = devm_ioremap(&pci->dev, addr, pci_resource_len(pci, 0));
if (!chip->base) {
- platform_device_unregister(dmic_dev);
ret = -ENOMEM;
- goto release_regions;
+ goto unregister_dmic_dev;
}
res = devm_kzalloc(&pci->dev, sizeof(struct resource) * num_res, GFP_KERNEL);
if (!res) {
- platform_device_unregister(dmic_dev);
ret = -ENOMEM;
- goto release_regions;
+ goto unregister_dmic_dev;
}
for (i = 0; i < num_res; i++, res_acp++) {
@@ -139,13 +137,14 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id
pdev = platform_device_register_full(&pdevinfo);
if (IS_ERR(pdev)) {
dev_err(&pci->dev, "cannot register %s device\n", pdevinfo.name);
- platform_device_unregister(dmic_dev);
ret = PTR_ERR(pdev);
- goto release_regions;
+ goto unregister_dmic_dev;
}
return ret;
+unregister_dmic_dev:
+ platform_device_unregister(dmic_dev);
release_regions:
pci_release_regions(pci);
disable_pci:
--
2.25.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH -next 1/3] ASoC: amd: acp: add missing platform_device_unregister() in acp_pci_probe()
2022-08-19 7:37 [PATCH -next 1/3] ASoC: amd: acp: add missing platform_device_unregister() in acp_pci_probe() Yang Yingliang
2022-08-19 7:37 ` [PATCH -next 2/3] ASoC: amd: acp: switch to use dev_err_probe() Yang Yingliang
2022-08-19 7:37 ` [PATCH -next 3/3] ASoC: amd: acp: add a label to make error path more clean Yang Yingliang
@ 2022-08-19 22:47 ` Mark Brown
2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2022-08-19 22:47 UTC (permalink / raw)
To: Yang Yingliang, alsa-devel, linux-kernel
Cc: venkataprasad.potturu, Vijendar.Mukunda
On Fri, 19 Aug 2022 15:37:56 +0800, Yang Yingliang wrote:
> Add missing platform_device_unregister() in error path in acp_pci_probe().
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/3] ASoC: amd: acp: add missing platform_device_unregister() in acp_pci_probe()
commit: 6a4ce20fd776d2fd19ffaf85cf34a53761e2c888
[2/3] ASoC: amd: acp: switch to use dev_err_probe()
commit: f89a8c5bb3489e43ff87b5f91acc8db66a168e8e
[3/3] ASoC: amd: acp: add a label to make error path more clean
commit: fd8ec75207588f85c622ee49e5f32267d2406d92
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-08-19 22:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-19 7:37 [PATCH -next 1/3] ASoC: amd: acp: add missing platform_device_unregister() in acp_pci_probe() Yang Yingliang
2022-08-19 7:37 ` [PATCH -next 2/3] ASoC: amd: acp: switch to use dev_err_probe() Yang Yingliang
2022-08-19 7:37 ` [PATCH -next 3/3] ASoC: amd: acp: add a label to make error path more clean Yang Yingliang
2022-08-19 22:47 ` [PATCH -next 1/3] ASoC: amd: acp: add missing platform_device_unregister() in acp_pci_probe() Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®