mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
drm/vc4: tests: Use the correct return type in vc4_mock_atomic_add_output()
The function vc4_mock_atomic_add_output() should return a pointer, even during error treatment. Use the proper macros to create pointers from the error code. Signed-off-by: Maíra Canal <mcanal@igalia.com>
This commit is contained in:
@@ -90,29 +90,29 @@ vc4_mock_atomic_add_output(struct kunit *test,
|
|||||||
|
|
||||||
encoder = vc4_find_encoder_by_type(drm, type);
|
encoder = vc4_find_encoder_by_type(drm, type);
|
||||||
if (!encoder)
|
if (!encoder)
|
||||||
return -ENODEV;
|
return ERR_PTR(-ENODEV);
|
||||||
|
|
||||||
crtc = vc4_find_crtc_for_encoder(test, encoder);
|
crtc = vc4_find_crtc_for_encoder(test, encoder);
|
||||||
if (!crtc)
|
if (!crtc)
|
||||||
return -ENODEV;
|
return ERR_PTR(-ENODEV);
|
||||||
|
|
||||||
output = encoder_to_vc4_dummy_output(encoder);
|
output = encoder_to_vc4_dummy_output(encoder);
|
||||||
conn = &output->connector;
|
conn = &output->connector;
|
||||||
conn_state = drm_atomic_get_connector_state(state, conn);
|
conn_state = drm_atomic_get_connector_state(state, conn);
|
||||||
if (IS_ERR(conn_state))
|
if (IS_ERR(conn_state))
|
||||||
return PTR_ERR(conn_state);
|
return ERR_CAST(conn_state);
|
||||||
|
|
||||||
ret = drm_atomic_set_crtc_for_connector(conn_state, crtc);
|
ret = drm_atomic_set_crtc_for_connector(conn_state, crtc);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ERR_PTR(ret);
|
||||||
|
|
||||||
crtc_state = drm_atomic_get_crtc_state(state, crtc);
|
crtc_state = drm_atomic_get_crtc_state(state, crtc);
|
||||||
if (IS_ERR(crtc_state))
|
if (IS_ERR(crtc_state))
|
||||||
return PTR_ERR(crtc_state);
|
return ERR_CAST(crtc_state);
|
||||||
|
|
||||||
ret = drm_atomic_set_mode_for_crtc(crtc_state, &default_mode);
|
ret = drm_atomic_set_mode_for_crtc(crtc_state, &default_mode);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ERR_PTR(ret);
|
||||||
|
|
||||||
crtc_state->active = true;
|
crtc_state->active = true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user