Skip to content

Commit

Permalink
spi-topcliff-pch: missing platform_driver_unregister() on error in pc…
Browse files Browse the repository at this point in the history
…h_spi_init()

Add the missing platform_driver_unregister() before return
from pch_spi_init() in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Wei Yongjun authored and Mark Brown committed Apr 25, 2013
1 parent a68b728 commit 0113f22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/spi/spi-topcliff-pch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1789,8 +1789,10 @@ static int __init pch_spi_init(void)
return ret;

ret = pci_register_driver(&pch_spi_pcidev_driver);
if (ret)
if (ret) {
platform_driver_unregister(&pch_spi_pd_driver);
return ret;
}

return 0;
}
Expand Down

0 comments on commit 0113f22

Please sign in to comment.