* [PATCH] spi: topcliff-pch: Properly unregister platform devices on probe() error paths
@ 2014-03-24 7:46 Axel Lin
2014-03-24 10:57 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2014-03-24 7:46 UTC (permalink / raw)
To: Mark Brown
Cc: Alexander Stein, Tomoya MORINAGA, linux-spi-u79uwXL29TY76Z2rM5mHXA
Ensure all registered platform devices are unregistered on probe() error paths.
Signed-off-by: Axel Lin <axel.lin-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org>
---
drivers/spi/spi-topcliff-pch.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
index 3540d52..e935ca6 100644
--- a/drivers/spi/spi-topcliff-pch.c
+++ b/drivers/spi/spi-topcliff-pch.c
@@ -1569,8 +1569,7 @@ static struct platform_driver pch_spi_pd_driver = {
.resume = pch_spi_pd_resume
};
-static int pch_spi_probe(struct pci_dev *pdev,
- const struct pci_device_id *id)
+static int pch_spi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
struct pch_spi_board_data *board_dat;
struct platform_device *pd_dev = NULL;
@@ -1640,6 +1639,8 @@ static int pch_spi_probe(struct pci_dev *pdev,
return 0;
err_platform_device:
+ while (--i >= 0)
+ platform_device_unregister(pd_dev_save->pd_save[i]);
pci_disable_device(pdev);
pci_enable_device:
pci_release_regions(pdev);
--
1.8.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] spi: topcliff-pch: Properly unregister platform devices on probe() error paths
2014-03-24 7:46 [PATCH] spi: topcliff-pch: Properly unregister platform devices on probe() error paths Axel Lin
@ 2014-03-24 10:57 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-03-24 10:57 UTC (permalink / raw)
To: Axel Lin
Cc: Alexander Stein, Tomoya MORINAGA, linux-spi-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 158 bytes --]
On Mon, Mar 24, 2014 at 03:46:55PM +0800, Axel Lin wrote:
> Ensure all registered platform devices are unregistered on probe() error paths.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-03-24 10:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-24 7:46 [PATCH] spi: topcliff-pch: Properly unregister platform devices on probe() error paths Axel Lin
2014-03-24 10:57 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.