drm/komeda: Refine function to_d71_input_id
authorjames qian wang (Arm Technology China) <james.qian.wang@arm.com>
Fri, 24 May 2019 02:55:45 +0000 (03:55 +0100)
committerLiviu Dudau <Liviu.Dudau@arm.com>
Wed, 19 Jun 2019 10:42:17 +0000 (11:42 +0100)
commit420810cec63bfd15069de1681605f137a8886d25
treef55a3e34c5809bdb719e2e0b591676b21b1d7798
parent3b9dfa4ef28c7dfb847cd3f8f97e7b92686c3e76
drm/komeda: Refine function to_d71_input_id

Since the component_state->input[i] is only valid when it is active, the
content of input[i] is undefined if it is inactive. The user must check the
state->active_inputs with input index firstly before using state->input[i].
Refine the function to_d71_input_id and directly move such check into it.
Simplify the using and avoid problem that caller forget the valid check.

Depends on:
- https://patchwork.freedesktop.org/series/60856/

Signed-off-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
drivers/gpu/drm/arm/display/komeda/d71/d71_component.c