drm: omapdrm: fb: Simplify objects lookup when creating framebuffer
Merge the single-user objects_lookup inline function into its caller, allowing reuse of the error code path. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:
@@ -236,29 +236,4 @@ struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev,
|
||||
uint32_t pipe2vbl(struct drm_crtc *crtc);
|
||||
struct omap_dss_device *omap_encoder_get_dssdev(struct drm_encoder *encoder);
|
||||
|
||||
/* should these be made into common util helpers?
|
||||
*/
|
||||
|
||||
static inline int objects_lookup(
|
||||
struct drm_file *filp, uint32_t pixel_format,
|
||||
struct drm_gem_object **bos, const uint32_t *handles)
|
||||
{
|
||||
int i, n = drm_format_num_planes(pixel_format);
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
bos[i] = drm_gem_object_lookup(filp, handles[i]);
|
||||
if (!bos[i])
|
||||
goto fail;
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
while (--i > 0)
|
||||
drm_gem_object_unreference_unlocked(bos[i]);
|
||||
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
#endif /* __OMAP_DRV_H__ */
|
||||
|
Reference in New Issue
Block a user