diff options
-rw-r--r-- | drivers/gpu/drm/sti/sti_hdmi.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c index 0ebae95d59e5..cd501563c0cc 100644 --- a/drivers/gpu/drm/sti/sti_hdmi.c +++ b/drivers/gpu/drm/sti/sti_hdmi.c | |||
@@ -793,13 +793,10 @@ static int sti_hdmi_probe(struct platform_device *pdev) | |||
793 | 793 | ||
794 | ddc = of_parse_phandle(pdev->dev.of_node, "ddc", 0); | 794 | ddc = of_parse_phandle(pdev->dev.of_node, "ddc", 0); |
795 | if (ddc) { | 795 | if (ddc) { |
796 | hdmi->ddc_adapt = of_find_i2c_adapter_by_node(ddc); | 796 | hdmi->ddc_adapt = of_get_i2c_adapter_by_node(ddc); |
797 | if (!hdmi->ddc_adapt) { | ||
798 | of_node_put(ddc); | ||
799 | return -EPROBE_DEFER; | ||
800 | } | ||
801 | |||
802 | of_node_put(ddc); | 797 | of_node_put(ddc); |
798 | if (!hdmi->ddc_adapt) | ||
799 | return -EPROBE_DEFER; | ||
803 | } | 800 | } |
804 | 801 | ||
805 | hdmi->dev = pdev->dev; | 802 | hdmi->dev = pdev->dev; |
@@ -888,8 +885,7 @@ static int sti_hdmi_probe(struct platform_device *pdev) | |||
888 | return component_add(&pdev->dev, &sti_hdmi_ops); | 885 | return component_add(&pdev->dev, &sti_hdmi_ops); |
889 | 886 | ||
890 | release_adapter: | 887 | release_adapter: |
891 | if (hdmi->ddc_adapt) | 888 | i2c_put_adapter(hdmi->ddc_adapt); |
892 | put_device(&hdmi->ddc_adapt->dev); | ||
893 | 889 | ||
894 | return ret; | 890 | return ret; |
895 | } | 891 | } |
@@ -898,10 +894,9 @@ static int sti_hdmi_remove(struct platform_device *pdev) | |||
898 | { | 894 | { |
899 | struct sti_hdmi *hdmi = dev_get_drvdata(&pdev->dev); | 895 | struct sti_hdmi *hdmi = dev_get_drvdata(&pdev->dev); |
900 | 896 | ||
901 | if (hdmi->ddc_adapt) | 897 | i2c_put_adapter(hdmi->ddc_adapt); |
902 | put_device(&hdmi->ddc_adapt->dev); | ||
903 | |||
904 | component_del(&pdev->dev, &sti_hdmi_ops); | 898 | component_del(&pdev->dev, &sti_hdmi_ops); |
899 | |||
905 | return 0; | 900 | return 0; |
906 | } | 901 | } |
907 | 902 | ||