From: Axel Lin Date: Wed, 11 May 2011 13:27:00 +0000 (+0800) Subject: spi/spi_sh: use spi_unregister_master instead of spi_master_put in remove path X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=680c1305e259a488f489bc887854523b6c6e0705;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git spi/spi_sh: use spi_unregister_master instead of spi_master_put in remove path spi_master_put() should only be used in error handling. Once spi_register_master() returns success, we should call spi_unregister_master() instead. Signed-off-by: Axel Lin Signed-off-by: Grant Likely --- diff --git a/drivers/spi/spi_sh.c b/drivers/spi/spi_sh.c index 869a07d375d6..9eedd71ad898 100644 --- a/drivers/spi/spi_sh.c +++ b/drivers/spi/spi_sh.c @@ -427,10 +427,10 @@ static int __devexit spi_sh_remove(struct platform_device *pdev) { struct spi_sh_data *ss = dev_get_drvdata(&pdev->dev); + spi_unregister_master(ss->master); destroy_workqueue(ss->workqueue); free_irq(ss->irq, ss); iounmap(ss->addr); - spi_master_put(ss->master); return 0; }