The nice thing about devm_* is that the driver doesn't need to free the
resources but the driver core takes care about that. This also
simplifies the error path quite a bit and removes the wrong check for a
clock pointer being NULL.
Signed-off-by: Uwe Kleine-König <redacted>
---
drivers/video/mmp/hw/mmp_ctrl.c | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
@@ -514,7 +514,7 @@ static int mmphw_probe(struct platform_device *pdev)if(IS_ERR(ctrl->clk)){dev_err(ctrl->dev,"unable to get clk %s\n",mi->clk_name);ret=-ENOENT;-gotofailed_get_clk;+gotofailed;}clk_prepare_enable(ctrl->clk);
From: Russell King - ARM Linux <hidden> Date: 2013-09-23 16:19:44
On Mon, Sep 23, 2013 at 06:13:10PM +0200, Uwe Kleine-König wrote:
quoted hunk
The nice thing about devm_* is that the driver doesn't need to free the
resources but the driver core takes care about that. This also
simplifies the error path quite a bit and removes the wrong check for a
clock pointer being NULL.
Signed-off-by: Uwe Kleine-König <redacted>
---
drivers/video/mmp/hw/mmp_ctrl.c | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
@@ -514,7 +514,7 @@ static int mmphw_probe(struct platform_device *pdev)if(IS_ERR(ctrl->clk)){dev_err(ctrl->dev,"unable to get clk %s\n",mi->clk_name);ret=-ENOENT;-gotofailed_get_clk;+gotofailed;}clk_prepare_enable(ctrl->clk);
From: Tomi Valkeinen <hidden> Date: 2013-09-24 07:34:03
On 23/09/13 19:19, Russell King - ARM Linux wrote:
On Mon, Sep 23, 2013 at 06:13:10PM +0200, Uwe Kleine-König wrote:
quoted
The nice thing about devm_* is that the driver doesn't need to free the
resources but the driver core takes care about that. This also
simplifies the error path quite a bit and removes the wrong check for a
clock pointer being NULL.
Signed-off-by: Uwe Kleine-König <redacted>
---
drivers/video/mmp/hw/mmp_ctrl.c | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
@@ -514,7 +514,7 @@ static int mmphw_probe(struct platform_device *pdev)if(IS_ERR(ctrl->clk)){dev_err(ctrl->dev,"unable to get clk %s\n",mi->clk_name);ret=-ENOENT;-gotofailed_get_clk;+gotofailed;}clk_prepare_enable(ctrl->clk);
On 23/09/13 19:19, Russell King - ARM Linux wrote:
quoted
On Mon, Sep 23, 2013 at 06:13:10PM +0200, Uwe Kleine-König wrote:
quoted
The nice thing about devm_* is that the driver doesn't need to free the
resources but the driver core takes care about that. This also
simplifies the error path quite a bit and removes the wrong check for a
clock pointer being NULL.
Signed-off-by: Uwe Kleine-König <redacted>
---
drivers/video/mmp/hw/mmp_ctrl.c | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
@@ -514,7 +514,7 @@ static int mmphw_probe(struct platform_device *pdev)if(IS_ERR(ctrl->clk)){dev_err(ctrl->dev,"unable to get clk %s\n",mi->clk_name);ret=-ENOENT;-gotofailed_get_clk;+gotofailed;}clk_prepare_enable(ctrl->clk);
And this patch also fixes the above: disabling/unpreparing _after_ putting
the thing - which was quite silly... :)
Hmm, I wonder if that causes any issues... I.e. should this patch go for
3.12, or is 3.13 fine?
Tomi
It would cause oops if probe failed due to some reason - although it
would almost never happen so we missed it.
Thank you for finding it out.
--
Thanks, -Zhou
From: Tomi Valkeinen <hidden> Date: 2013-09-26 08:43:04
On 23/09/13 19:13, Uwe Kleine-König wrote:
The nice thing about devm_* is that the driver doesn't need to free the
resources but the driver core takes care about that. This also
simplifies the error path quite a bit and removes the wrong check for a
clock pointer being NULL.
Signed-off-by: Uwe Kleine-König <redacted>
---
drivers/video/mmp/hw/mmp_ctrl.c | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)