From 08a709467c17e89c824a36cae76626527a4ccbbe Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Wed, 14 Jul 2021 16:22:29 +0200 Subject: [PATCH] drm/mgag200: Return errno codes from PLL compute functions Return -EINVAL if there's no PLL configuration for the given pixel clock. The returned errors are currently ignored by the caller, but the errno codes will become useful when the compute functions run during atomic checks. v2: * give a rational for this change (Sam) Signed-off-by: Thomas Zimmermann Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210714142240.21979-3-tzimmermann@suse.de --- drivers/gpu/drm/mgag200/mgag200_mode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index 1bdf214..69daa0f 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -133,7 +133,7 @@ static int mgag200_g200_set_plls(struct mga_device *mdev, long clock) if (clock > p_clk_max) { drm_err(dev, "Pixel Clock %ld too high\n", clock); - return 1; + return -EINVAL; } if (clock < p_clk_min >> 3) @@ -288,7 +288,7 @@ static int mga_g200se_set_plls(struct mga_device *mdev, long clock) if (delta > permitteddelta) { pr_warn("PLL delta too large\n"); - return 1; + return -EINVAL; } WREG_MISC_MASKED(MGAREG_MISC_CLKSEL_MGA, MGAREG_MISC_CLKSEL_MASK); -- 2.7.4