drm/bridge: use devm_add_action_or_reset() to handle failed condition
Subsystems (3)
PATCH 1/1 drm/bridge: use devm_add_action_or_reset() to handle failed condition
switch to using devm_add_action_or_reset() instead of devm_add_action to avoid call the cec_delete_adapter,when devm_add_action_or_reset return failed.
Signed-off-by Tian Tao <[email protected]>
--- drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c +2 -4
@@ -265,11 +265,9 @@ static int dw_hdmi_cec_probe(struct platform_device *pdev)/* override the module pointer */ cec->adap->owner =THIS_MODULE ; - ret =devm_add_action (&pdev->dev, dw_hdmi_cec_del, cec); -if (ret) { -cec_delete_adapter (cec->adap); + ret =devm_add_action_or_reset (&pdev->dev, dw_hdmi_cec_del, cec); +if (ret)return ret; - } ret = devm_request_threaded_irq(&pdev->dev, cec->irq, dw_hdmi_cec_hardirq,
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Tian,
Thank you for the patch.
Quoted 5 lines · Tian Tao
switch to using
devm_add_action_or_reset()instead ofdevm_add_actionto avoid call the cec_delete_adapter,whendevm_add_action_or_resetreturn failed.Signed-off-by Tian Tao <[email protected]>
Reviewed-by Laurent Pinchart <[email protected]>
Quoted 22 lines
--- drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c +2
-4@@ -265,11 +265,9 @@ static int dw_hdmi_cec_probe(struct platform_device *pdev)/* override the module pointer */ cec->adap->owner =THIS_MODULE ; - ret =devm_add_action (&pdev->dev, dw_hdmi_cec_del, cec); -if (ret) { -cec_delete_adapter (cec->adap); + ret =devm_add_action_or_reset (&pdev->dev, dw_hdmi_cec_del, cec); +if (ret)return ret; - } ret = devm_request_threaded_irq(&pdev->dev, cec->irq, dw_hdmi_cec_hardirq,
Signature · 7 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel