diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-05-16 23:31:01 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-06-12 20:50:31 -0400 |
commit | 44048752345460df738b87ebec82c9bfc8257943 (patch) | |
tree | 6c3c7cd638122d4f77e032ab2d8a8a1f4e6f3714 /drivers/media/platform/s5p-tv | |
parent | 793ad32d1b7159772feb36ac41e265786729e78c (diff) |
[media] s5p-tv: Fix incorrect usage of IS_ERR_OR_NULL in hdmi_drv.c
NULL check on clocks obtained using common clock APIs should not
be done. Use IS_ERR only.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/platform/s5p-tv')
-rw-r--r-- | drivers/media/platform/s5p-tv/hdmi_drv.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/media/platform/s5p-tv/hdmi_drv.c b/drivers/media/platform/s5p-tv/hdmi_drv.c index 4e86626dad4b..cd525f193240 100644 --- a/drivers/media/platform/s5p-tv/hdmi_drv.c +++ b/drivers/media/platform/s5p-tv/hdmi_drv.c | |||
@@ -755,6 +755,15 @@ static const struct dev_pm_ops hdmi_pm_ops = { | |||
755 | .runtime_resume = hdmi_runtime_resume, | 755 | .runtime_resume = hdmi_runtime_resume, |
756 | }; | 756 | }; |
757 | 757 | ||
758 | static void hdmi_resource_clear_clocks(struct hdmi_resources *res) | ||
759 | { | ||
760 | res->hdmi = ERR_PTR(-EINVAL); | ||
761 | res->sclk_hdmi = ERR_PTR(-EINVAL); | ||
762 | res->sclk_pixel = ERR_PTR(-EINVAL); | ||
763 | res->sclk_hdmiphy = ERR_PTR(-EINVAL); | ||
764 | res->hdmiphy = ERR_PTR(-EINVAL); | ||
765 | } | ||
766 | |||
758 | static void hdmi_resources_cleanup(struct hdmi_device *hdev) | 767 | static void hdmi_resources_cleanup(struct hdmi_device *hdev) |
759 | { | 768 | { |
760 | struct hdmi_resources *res = &hdev->res; | 769 | struct hdmi_resources *res = &hdev->res; |
@@ -765,17 +774,18 @@ static void hdmi_resources_cleanup(struct hdmi_device *hdev) | |||
765 | regulator_bulk_free(res->regul_count, res->regul_bulk); | 774 | regulator_bulk_free(res->regul_count, res->regul_bulk); |
766 | /* kfree is NULL-safe */ | 775 | /* kfree is NULL-safe */ |
767 | kfree(res->regul_bulk); | 776 | kfree(res->regul_bulk); |
768 | if (!IS_ERR_OR_NULL(res->hdmiphy)) | 777 | if (!IS_ERR(res->hdmiphy)) |
769 | clk_put(res->hdmiphy); | 778 | clk_put(res->hdmiphy); |
770 | if (!IS_ERR_OR_NULL(res->sclk_hdmiphy)) | 779 | if (!IS_ERR(res->sclk_hdmiphy)) |
771 | clk_put(res->sclk_hdmiphy); | 780 | clk_put(res->sclk_hdmiphy); |
772 | if (!IS_ERR_OR_NULL(res->sclk_pixel)) | 781 | if (!IS_ERR(res->sclk_pixel)) |
773 | clk_put(res->sclk_pixel); | 782 | clk_put(res->sclk_pixel); |
774 | if (!IS_ERR_OR_NULL(res->sclk_hdmi)) | 783 | if (!IS_ERR(res->sclk_hdmi)) |
775 | clk_put(res->sclk_hdmi); | 784 | clk_put(res->sclk_hdmi); |
776 | if (!IS_ERR_OR_NULL(res->hdmi)) | 785 | if (!IS_ERR(res->hdmi)) |
777 | clk_put(res->hdmi); | 786 | clk_put(res->hdmi); |
778 | memset(res, 0, sizeof(*res)); | 787 | memset(res, 0, sizeof(*res)); |
788 | hdmi_resource_clear_clocks(res); | ||
779 | } | 789 | } |
780 | 790 | ||
781 | static int hdmi_resources_init(struct hdmi_device *hdev) | 791 | static int hdmi_resources_init(struct hdmi_device *hdev) |
@@ -793,8 +803,9 @@ static int hdmi_resources_init(struct hdmi_device *hdev) | |||
793 | dev_dbg(dev, "HDMI resource init\n"); | 803 | dev_dbg(dev, "HDMI resource init\n"); |
794 | 804 | ||
795 | memset(res, 0, sizeof(*res)); | 805 | memset(res, 0, sizeof(*res)); |
796 | /* get clocks, power */ | 806 | hdmi_resource_clear_clocks(res); |
797 | 807 | ||
808 | /* get clocks, power */ | ||
798 | res->hdmi = clk_get(dev, "hdmi"); | 809 | res->hdmi = clk_get(dev, "hdmi"); |
799 | if (IS_ERR(res->hdmi)) { | 810 | if (IS_ERR(res->hdmi)) { |
800 | dev_err(dev, "failed to get clock 'hdmi'\n"); | 811 | dev_err(dev, "failed to get clock 'hdmi'\n"); |