diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2014-07-03 09:10:34 -0400 |
---|---|---|
committer | Inki Dae <daeinki@gmail.com> | 2014-08-03 03:52:19 -0400 |
commit | 134f0e9b5da9079795776a2790944b28728fece7 (patch) | |
tree | f333149eb542518b8cb14d07809c5afb215fcf5b /drivers/gpu/drm/exynos | |
parent | 5ece5a1da1fef337a3ec02fd8f0fa7948f172d72 (diff) |
drm/exynos/ipp: simplify ipp_find_obj
The patch simplifies ipp_find_obj and removes debug messages.
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_ipp.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 26c8a2cfe8da..c7ea047e0158 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c | |||
@@ -172,18 +172,8 @@ static void *ipp_find_obj(struct idr *id_idr, struct mutex *lock, u32 id) | |||
172 | { | 172 | { |
173 | void *obj; | 173 | void *obj; |
174 | 174 | ||
175 | DRM_DEBUG_KMS("id[%d]\n", id); | ||
176 | |||
177 | mutex_lock(lock); | 175 | mutex_lock(lock); |
178 | |||
179 | /* find object using handle */ | ||
180 | obj = idr_find(id_idr, id); | 176 | obj = idr_find(id_idr, id); |
181 | if (!obj) { | ||
182 | DRM_ERROR("failed to find object.\n"); | ||
183 | mutex_unlock(lock); | ||
184 | return ERR_PTR(-ENODEV); | ||
185 | } | ||
186 | |||
187 | mutex_unlock(lock); | 177 | mutex_unlock(lock); |
188 | 178 | ||
189 | return obj; | 179 | return obj; |
@@ -215,9 +205,9 @@ static struct exynos_drm_ippdrv *ipp_find_driver(struct ipp_context *ctx, | |||
215 | /* find ipp driver using idr */ | 205 | /* find ipp driver using idr */ |
216 | ippdrv = ipp_find_obj(&ctx->ipp_idr, &ctx->ipp_lock, | 206 | ippdrv = ipp_find_obj(&ctx->ipp_idr, &ctx->ipp_lock, |
217 | ipp_id); | 207 | ipp_id); |
218 | if (IS_ERR(ippdrv)) { | 208 | if (!ippdrv) { |
219 | DRM_ERROR("not found ipp%d driver.\n", ipp_id); | 209 | DRM_ERROR("not found ipp%d driver.\n", ipp_id); |
220 | return ippdrv; | 210 | return ERR_PTR(-ENODEV); |
221 | } | 211 | } |
222 | 212 | ||
223 | /* | 213 | /* |
@@ -339,10 +329,10 @@ int exynos_drm_ipp_get_property(struct drm_device *drm_dev, void *data, | |||
339 | */ | 329 | */ |
340 | ippdrv = ipp_find_obj(&ctx->ipp_idr, &ctx->ipp_lock, | 330 | ippdrv = ipp_find_obj(&ctx->ipp_idr, &ctx->ipp_lock, |
341 | prop_list->ipp_id); | 331 | prop_list->ipp_id); |
342 | if (IS_ERR(ippdrv)) { | 332 | if (!ippdrv) { |
343 | DRM_ERROR("not found ipp%d driver.\n", | 333 | DRM_ERROR("not found ipp%d driver.\n", |
344 | prop_list->ipp_id); | 334 | prop_list->ipp_id); |
345 | return PTR_ERR(ippdrv); | 335 | return -ENODEV; |
346 | } | 336 | } |
347 | 337 | ||
348 | *prop_list = ippdrv->prop_list; | 338 | *prop_list = ippdrv->prop_list; |
@@ -920,9 +910,9 @@ int exynos_drm_ipp_queue_buf(struct drm_device *drm_dev, void *data, | |||
920 | /* find command node */ | 910 | /* find command node */ |
921 | c_node = ipp_find_obj(&ctx->prop_idr, &ctx->prop_lock, | 911 | c_node = ipp_find_obj(&ctx->prop_idr, &ctx->prop_lock, |
922 | qbuf->prop_id); | 912 | qbuf->prop_id); |
923 | if (IS_ERR(c_node)) { | 913 | if (!c_node) { |
924 | DRM_ERROR("failed to get command node.\n"); | 914 | DRM_ERROR("failed to get command node.\n"); |
925 | return PTR_ERR(c_node); | 915 | return -ENODEV; |
926 | } | 916 | } |
927 | 917 | ||
928 | /* buffer control */ | 918 | /* buffer control */ |
@@ -1055,9 +1045,9 @@ int exynos_drm_ipp_cmd_ctrl(struct drm_device *drm_dev, void *data, | |||
1055 | 1045 | ||
1056 | c_node = ipp_find_obj(&ctx->prop_idr, &ctx->prop_lock, | 1046 | c_node = ipp_find_obj(&ctx->prop_idr, &ctx->prop_lock, |
1057 | cmd_ctrl->prop_id); | 1047 | cmd_ctrl->prop_id); |
1058 | if (IS_ERR(c_node)) { | 1048 | if (!c_node) { |
1059 | DRM_ERROR("invalid command node list.\n"); | 1049 | DRM_ERROR("invalid command node list.\n"); |
1060 | return PTR_ERR(c_node); | 1050 | return -ENODEV; |
1061 | } | 1051 | } |
1062 | 1052 | ||
1063 | if (!exynos_drm_ipp_check_valid(ippdrv->dev, cmd_ctrl->ctrl, | 1053 | if (!exynos_drm_ipp_check_valid(ippdrv->dev, cmd_ctrl->ctrl, |