2013-04-25 07:18:06

by Wei Yongjun

[permalink] [raw]
Subject: [PATCH] spi-topcliff-pch: missing platform_driver_unregister() on error in pch_spi_init()

From: Wei Yongjun <[email protected]>

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

Signed-off-by: Wei Yongjun <[email protected]>
---
drivers/spi/spi-topcliff-pch.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
index f756481..c8b672e 100644
--- a/drivers/spi/spi-topcliff-pch.c
+++ b/drivers/spi/spi-topcliff-pch.c
@@ -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;
}


2013-04-25 10:58:20

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] spi-topcliff-pch: missing platform_driver_unregister() on error in pch_spi_init()

On Thu, Apr 25, 2013 at 03:18:02PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun <[email protected]>
>
> Add the missing platform_driver_unregister() before return
> from pch_spi_init() in the error handling case.

Applied, thanks.


Attachments:
(No filename) (245.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments