mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-28 21:45:01 +08:00
drm/exynos: simplify the return value handling in exynos_dp_get_modes()
Just use 0 and 1 directly, instead of the confusing local variable that's always set to 0. Cc: Inki Dae <inki.dae@samsung.com> Cc: Seung-Woo Kim <sw0312.kim@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/64cc680f14d961cedb726a6fd5c6dfd53ca9bb85.1709913674.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
parent
b43a72c4f3
commit
9dd81b2e1e
@ -74,16 +74,15 @@ static int exynos_dp_get_modes(struct analogix_dp_plat_data *plat_data,
|
||||
{
|
||||
struct exynos_dp_device *dp = to_dp(plat_data);
|
||||
struct drm_display_mode *mode;
|
||||
int num_modes = 0;
|
||||
|
||||
if (dp->plat_data.panel)
|
||||
return num_modes;
|
||||
return 0;
|
||||
|
||||
mode = drm_mode_create(connector->dev);
|
||||
if (!mode) {
|
||||
DRM_DEV_ERROR(dp->dev,
|
||||
"failed to create a new display mode.\n");
|
||||
return num_modes;
|
||||
return 0;
|
||||
}
|
||||
|
||||
drm_display_mode_from_videomode(&dp->vm, mode);
|
||||
@ -94,7 +93,7 @@ static int exynos_dp_get_modes(struct analogix_dp_plat_data *plat_data,
|
||||
drm_mode_set_name(mode);
|
||||
drm_mode_probed_add(connector, mode);
|
||||
|
||||
return num_modes + 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int exynos_dp_bridge_attach(struct analogix_dp_plat_data *plat_data,
|
||||
|
Loading…
Reference in New Issue
Block a user