mmc: sdhci-pxav3: fix error handling of sdhci_add_host
PATCH 1/1 mmc: sdhci-pxav3: fix error handling of sdhci_add_host
From: Xiang Wang <[email protected]>
Commit 0dcaa2499b7d111bd70da5b0976c34210c850fb3 improved error handling of sdhci_add_host. However, "err_of_parse" and "err_cd_req" should be placed after "pm_runtime_disable(&pdev->dev)".
--- drivers/mmc/host/sdhci-pxav3.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-pxav3.c +2 -2
@@ -380,11 +380,11 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)return 0 ; -err_of_parse: -err_cd_req: err_add_host:pm_runtime_put_sync (&pdev->dev);pm_runtime_disable (&pdev->dev); +err_of_parse: +err_cd_req:clk_disable_unprepare (clk);clk_put (clk); err_clk_get:
Signature · 1 line
1.7.5.4
Hi Xiang,
Thank you for the patch.
Quoted 7 lines · On Wednesday 16 July 2014 15:50:09 Xiang Wang wrote:
From: Xiang Wang <[email protected]>
Commit
0dcaa2499b7d111bd70da5b0976c34210c850fb3improved error handling ofsdhci_add_host. However, "err_of_parse" and "err_cd_req" should be placed after "pm_runtime_disable(&pdev->dev)".Signed-off-by Xiang Wang <[email protected]>
While we're touching the probe error path, how about converting the driver to the devm_* helpers ? I'll send a patch shortly.
Quoted 23 lines
--- drivers/mmc/host/sdhci-pxav3.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)drivers/mmc/host/sdhci-pxav3.c +2
-2@@ -380,11 +380,11 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)return 0 ; -err_of_parse: -err_cd_req: err_add_host:pm_runtime_put_sync (&pdev->dev);pm_runtime_disable (&pdev->dev); +err_of_parse: +err_cd_req:clk_disable_unprepare (clk);clk_put (clk);
err_clk_get:
Signature · 3 lines
Regards, Laurent Pinchart
Quoted 10 lines · On Wednesday 16 July 2014 11:53:21 Laurent Pinchart wrote:
Quoted 7 lines · On Wednesday 16 July 2014 15:50:09 Xiang Wang wrote:
From: Xiang Wang <[email protected]>
Commit
0dcaa2499b7d111bd70da5b0976c34210c850fb3improved error handling ofsdhci_add_host. However, "err_of_parse" and "err_cd_req" should be placed after "pm_runtime_disable(&pdev->dev)".Signed-off-by Xiang Wang <[email protected]>Acked-by Laurent Pinchart <[email protected]>
I can't find the patch in mainline, has it been lost somewhere ?
Quoted 28 lines
Quoted 28 lines
---
drivers/mmc/host/sdhci-pxav3.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/mmc/host/sdhci-pxav3.cindex 2fd73b3..0644655 100644drivers/mmc/host/sdhci-pxav3.c +2
-2@@ -380,11 +380,11 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)return 0 ; -err_of_parse: -err_cd_req: err_add_host:pm_runtime_put_sync (&pdev->dev);pm_runtime_disable (&pdev->dev); +err_of_parse: +err_cd_req:clk_disable_unprepare (clk);clk_put (clk); err_clk_get:
Signature · 3 lines
Regards, Laurent Pinchart
Quoted 8 lines · Laurent Pinchart
Quoted 7 lines · On Wednesday 16 July 2014 11:53:21 Laurent Pinchart wrote:
Quoted 6 lines · On Wednesday 16 July 2014 15:50:09 Xiang Wang wrote:
From: Xiang Wang <[email protected]>
Commit
0dcaa2499b7d111bd70da5b0976c34210c850fb3improved error handling ofsdhci_add_host. However, "err_of_parse" and "err_cd_req" should be placed after "pm_runtime_disable(&pdev->dev)".
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Xiang Wang <[email protected]>Acked-by Laurent Pinchart <[email protected]>I can't find the patch in mainline, has it been lost somewhere ?
It was lost, but now found, resolved a conflict for it and queued for 3.18.
Thanks for the reminder!
Kind regards
Uffe
PATCH 1/1 mmc: sdhci-pxav3: Use devm_* managed helpers
In reply to Xiang WangThis simplifies probe error and remove code paths.
--- drivers/mmc/host/sdhci-pxav3.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
This patch applies on top of Xiang Wang's " mmc: sdhci-pxav3: fix error handling of sdhci_add_host" patch.
drivers/mmc/host/sdhci-pxav3.c +3 -9
@@ -288,15 +288,13 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)int ret;struct clk *clk; - pxa =kzalloc (sizeof (struct sdhci_pxa ),GFP_KERNEL ); + pxa =devm_kzalloc (&pdev->dev,sizeof (struct sdhci_pxa ),GFP_KERNEL );if (!pxa)return -ENOMEM ; host =sdhci_pltfm_init (pdev, &sdhci_pxav3_pdata,0 ); -if (IS_ERR (host)) { -kfree (pxa); +if (IS_ERR (host))return PTR_ERR (host); - }if (of_device_is_compatible (np,"marvell,armada-380-sdhci" )) { ret =mv_conf_mbus_windows (pdev,mv_mbus_dram_info ());
@@ -308,7 +306,7 @@ static int sdhci_pxav3_probe(struct platform_device *pdev) pltfm_host =sdhci_priv (host); pltfm_host->priv = pxa; - clk =clk_get (dev,NULL ); + clk =devm_clk_get (dev,NULL );if (IS_ERR (clk)) {dev_err (dev,"failed to get io clock\n" ); ret =PTR_ERR (clk);
@@ -389,11 +387,9 @@ err_add_host: err_of_parse: err_cd_req:clk_disable_unprepare (clk); -clk_put (clk); err_clk_get: err_mbus_win:sdhci_pltfm_free (pdev); -kfree (pxa);return ret; }
@@ -408,10 +404,8 @@ static int sdhci_pxav3_remove(struct platform_device *pdev)pm_runtime_disable (&pdev->dev);clk_disable_unprepare (pltfm_host->clk); -clk_put (pltfm_host->clk);sdhci_pltfm_free (pdev); -kfree (pxa);return 0 ; }
Signature · 3 lines
Regards, Laurent Pinchart
Ulf Hansson
AppliedRe: [PATCH] mmc: sdhci-pxav3: Use devm_* managed helpers
Quoted 3 lines · Laurent Pinchart
This simplifies probe error and remove code paths.
Signed-off-by Laurent Pinchart <[email protected]>
Thanks! Applied for next.
Kind regards
Uffe
Quoted 70 lines
--- drivers/mmc/host/sdhci-pxav3.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)This patch applies on top of Xiang Wang's " mmc: sdhci-pxav3: fix error handling of
sdhci_add_host" patch.drivers/mmc/host/sdhci-pxav3.c +3
-10@@ -288,15 +288,13 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)int ret;struct clk *clk; - pxa =kzalloc (sizeof (struct sdhci_pxa ),GFP_KERNEL ); + pxa =devm_kzalloc (&pdev->dev,sizeof (struct sdhci_pxa ),GFP_KERNEL );if (!pxa)return -ENOMEM ; host =sdhci_pltfm_init (pdev, &sdhci_pxav3_pdata,0 ); -if (IS_ERR (host)) { -kfree (pxa); +if (IS_ERR (host))return PTR_ERR (host); - }if (of_device_is_compatible (np,"marvell,armada-380-sdhci" )) { ret =mv_conf_mbus_windows (pdev,mv_mbus_dram_info ());@@ -308,7 +306,7 @@ static int sdhci_pxav3_probe(struct platform_device *pdev) pltfm_host =sdhci_priv (host); pltfm_host->priv = pxa; - clk =clk_get (dev,NULL ); + clk =devm_clk_get (dev,NULL );if (IS_ERR (clk)) {dev_err (dev,"failed to get io clock\n" ); ret =PTR_ERR (clk);@@ -389,11 +387,9 @@ err_add_host: err_of_parse: err_cd_req:clk_disable_unprepare (clk); -clk_put (clk); err_clk_get: err_mbus_win:sdhci_pltfm_free (pdev); -kfree (pxa);return ret; }@@ -408,10 +404,8 @@ static int sdhci_pxav3_remove(struct platform_device *pdev)pm_runtime_disable (&pdev->dev);clk_disable_unprepare (pltfm_host->clk); -clk_put (pltfm_host->clk);sdhci_pltfm_free (pdev); -kfree (pxa);return 0 ; } --Regards,
Laurent Pinchart
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html