]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/bridge: synopsys: dw-mipi-dsi: Remove a redundant check on existence of bridge...
authorSui Jingfeng <sui.jingfeng@linux.dev>
Mon, 13 May 2024 15:31:06 +0000 (23:31 +0800)
committerRobert Foss <rfoss@kernel.org>
Mon, 13 May 2024 16:31:09 +0000 (18:31 +0200)
commit80221a89ff95ede55be4bdf2c272eb35b6d410c0
tree9fb246232c00e8f5c7b1e37c0df5d18749dcc381
parent0a59deb2fedb8b6d9299327c4a9a5f4e77002e3b
drm/bridge: synopsys: dw-mipi-dsi: Remove a redundant check on existence of bridge->encoder

In the dw_mipi_dsi_bridge_attach() function, the check on the existence
of bridge->encoder is not necessary, as it has already been checked in
the drm_bridge_attach() function invocked by 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 struct drm_bridge is not NULL when
dw_mipi_dsi_bridge_attach() function gets called.

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

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@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-10-sui.jingfeng@linux.dev
drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c