]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/bridge: it6505: Remove a redundant check on existence of bridge->encoder
authorSui Jingfeng <sui.jingfeng@linux.dev>
Mon, 13 May 2024 15:31:02 +0000 (23:31 +0800)
committerRobert Foss <rfoss@kernel.org>
Mon, 13 May 2024 16:31:04 +0000 (18:31 +0200)
commit8761a39e3f9d9f41a593af2fce1ba41537c35b83
treeb1ad39386a015c2e9ba8f9344a180790da90b054
parenta8f856bf054aeba9bb9c1a8b296c61711e9d76fb
drm/bridge: it6505: Remove a redundant check on existence of bridge->encoder

In it6505_bridge_attach(), the check on the existence of 'bridge->encoder'
is not necessary, as it has already been checked in the drm_bridge_attach()
which happens prior to it6505_bridge_attach() get called. Note that the
it6505_bridge_attach() will only be called by .attach() of the previous
bridge or KMS driver. The previous drm_bridge_attach() will quit with a
negative error code returned if it fails for some reasons. Hence, it is
guaranteed that the .encoder member of the drm_bridge instance is not NULL
when it6505_bridge_attach() function get called.

Remove the redundant checking codes "if (!bridge->encoder) { ... }".

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sui Jingfeng <sui.jingfeng@linux.dev>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240513153109.46786-6-sui.jingfeng@linux.dev
drivers/gpu/drm/bridge/ite-it6505.c