diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-03-24 03:46:55 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-24 06:57:02 -0400 |
commit | b86e81d9a7d28a658904d8b14da7b5cb0d8f8a21 (patch) | |
tree | 3248a8d2a95aad9d351400eea7011387ac664a0f | |
parent | c1b20aa5d3b164a860e13b1bc5e85a24e45f0072 (diff) |
spi: topcliff-pch: Properly unregister platform devices on probe() error paths
Ensure all registered platform devices are unregistered on probe() error paths.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | drivers/spi/spi-topcliff-pch.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c index dc5d2d489953..372811aa5fb2 100644 --- a/drivers/spi/spi-topcliff-pch.c +++ b/drivers/spi/spi-topcliff-pch.c | |||
@@ -1568,8 +1568,7 @@ static struct platform_driver pch_spi_pd_driver = { | |||
1568 | .resume = pch_spi_pd_resume | 1568 | .resume = pch_spi_pd_resume |
1569 | }; | 1569 | }; |
1570 | 1570 | ||
1571 | static int pch_spi_probe(struct pci_dev *pdev, | 1571 | static int pch_spi_probe(struct pci_dev *pdev, const struct pci_device_id *id) |
1572 | const struct pci_device_id *id) | ||
1573 | { | 1572 | { |
1574 | struct pch_spi_board_data *board_dat; | 1573 | struct pch_spi_board_data *board_dat; |
1575 | struct platform_device *pd_dev = NULL; | 1574 | struct platform_device *pd_dev = NULL; |
@@ -1639,6 +1638,8 @@ static int pch_spi_probe(struct pci_dev *pdev, | |||
1639 | return 0; | 1638 | return 0; |
1640 | 1639 | ||
1641 | err_platform_device: | 1640 | err_platform_device: |
1641 | while (--i >= 0) | ||
1642 | platform_device_unregister(pd_dev_save->pd_save[i]); | ||
1642 | pci_disable_device(pdev); | 1643 | pci_disable_device(pdev); |
1643 | pci_enable_device: | 1644 | pci_enable_device: |
1644 | pci_release_regions(pdev); | 1645 | pci_release_regions(pdev); |