Message ID | 20121029214307.GH21164@n2100.arm.linux.org.uk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi, On Mon, Oct 29 2012, Russell King - ARM Linux wrote: > Anyway, here's a replacement patch, updated against my cubox tree but > lacking the cubox gpio changes for it. Un-tested through: (a) I can't > test this on its own on the cubox, (b) I don't have a separate dove > tree to test it against and my disk space is all but out at the moment > for yet another build tree... Compile-tested and pushed to mmc-next, and I'll submit it for 3.7 if I get a Tested-by from someone like Sebastian (CC'd), or for 3.8 if I don't. (I'll add sdhci-pltfm API rework to my TODO list, too.) Thanks, - Chris.
On 10/29/2012 10:49 PM, Chris Ball wrote: > On Mon, Oct 29 2012, Russell King - ARM Linux wrote: >> Anyway, here's a replacement patch, updated against my cubox tree but >> lacking the cubox gpio changes for it. Un-tested through: (a) I can't >> test this on its own on the cubox, (b) I don't have a separate dove >> tree to test it against and my disk space is all but out at the moment >> for yet another build tree... > > Compile-tested and pushed to mmc-next, and I'll submit it for 3.7 if > I get a Tested-by from someone like Sebastian (CC'd), or for 3.8 if I > don't. (I'll add sdhci-pltfm API rework to my TODO list, too.) Chris, Russell, obviously I am not the one to ask for a Tested-by because it was my patch that originally caused all the trouble. My apologies for this! Anyway, I did test the patch on 3.7-rc3 and except that you need a 3-way git am because of a one-line offset, sdhci-dove runs just fine. Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Hi, On Mon, Oct 29 2012, Sebastian Hesselbarth wrote: > On 10/29/2012 10:49 PM, Chris Ball wrote: >> On Mon, Oct 29 2012, Russell King - ARM Linux wrote: >>> Anyway, here's a replacement patch, updated against my cubox tree but >>> lacking the cubox gpio changes for it. Un-tested through: (a) I can't >>> test this on its own on the cubox, (b) I don't have a separate dove >>> tree to test it against and my disk space is all but out at the moment >>> for yet another build tree... >> >> Compile-tested and pushed to mmc-next, and I'll submit it for 3.7 if >> I get a Tested-by from someone like Sebastian (CC'd), or for 3.8 if I >> don't. (I'll add sdhci-pltfm API rework to my TODO list, too.) > > Chris, Russell, > > obviously I am not the one to ask for a Tested-by because it was my > patch that originally caused all the trouble. My apologies for this! > > Anyway, I did test the patch on 3.7-rc3 and except that you need a > 3-way git am because of a one-line offset, sdhci-dove runs just fine. > > Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Great, thanks -- will push to 3.7. - Chris.
diff --git a/drivers/mmc/host/sdhci-dove.c b/drivers/mmc/host/sdhci-dove.c index a6e53a1..bb3cefe 100644 --- a/drivers/mmc/host/sdhci-dove.c +++ b/drivers/mmc/host/sdhci-dove.c @@ -19,6 +19,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include <linux/err.h> #include <linux/io.h> #include <linux/clk.h> #include <linux/err.h> @@ -83,30 +84,32 @@ static int __devinit sdhci_dove_probe(struct platform_device *pdev) struct sdhci_dove_priv *priv; int ret; - ret = sdhci_pltfm_register(pdev, &sdhci_dove_pdata); - if (ret) - goto sdhci_dove_register_fail; - priv = devm_kzalloc(&pdev->dev, sizeof(struct sdhci_dove_priv), GFP_KERNEL); if (!priv) { dev_err(&pdev->dev, "unable to allocate private data"); - ret = -ENOMEM; - goto sdhci_dove_allocate_fail; + return -ENOMEM; } + priv->clk = clk_get(&pdev->dev, NULL); + if (!IS_ERR(priv->clk)) + clk_prepare_enable(priv->clk); + + ret = sdhci_pltfm_register(pdev, &sdhci_dove_pdata); + if (ret) + goto sdhci_dove_register_fail; + host = platform_get_drvdata(pdev); pltfm_host = sdhci_priv(host); pltfm_host->priv = priv; - priv->clk = clk_get(&pdev->dev, NULL); - if (!IS_ERR(priv->clk)) - clk_prepare_enable(priv->clk); return 0; -sdhci_dove_allocate_fail: - sdhci_pltfm_unregister(pdev); sdhci_dove_register_fail: + if (!IS_ERR(priv->clk)) { + clk_disable_unprepare(priv->clk); + clk_put(priv->clk); + } return ret; } @@ -116,14 +119,13 @@ static int __devexit sdhci_dove_remove(struct platform_device *pdev) struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); struct sdhci_dove_priv *priv = pltfm_host->priv; - if (priv->clk) { - if (!IS_ERR(priv->clk)) { - clk_disable_unprepare(priv->clk); - clk_put(priv->clk); - } - devm_kfree(&pdev->dev, priv->clk); + sdhci_pltfm_unregister(pdev); + + if (!IS_ERR(priv->clk)) { + clk_disable_unprepare(priv->clk); + clk_put(priv->clk); } - return sdhci_pltfm_unregister(pdev); + return 0; } static struct platform_driver sdhci_dove_driver = {