]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/tegra: dp: use str_plural in drm_dp_link_train_{full,fast}
authorThorsten Blum <thorsten.blum@linux.dev>
Thu, 21 May 2026 19:46:59 +0000 (21:46 +0200)
committerThierry Reding <treding@nvidia.com>
Thu, 28 May 2026 15:19:27 +0000 (17:19 +0200)
Replace the manual ternary "s" pluralizations with str_plural() to
simplify the code. This also corrects the "0 lanes" case.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patch.msgid.link/20260521194658.366737-3-thorsten.blum@linux.dev
drivers/gpu/drm/tegra/dp.c

index 990e744b0923d09421cd15055d4c48891f1793a5..3cb194f5ce367877de3f3a4808a71f6416d77dea 100644 (file)
@@ -4,6 +4,8 @@
  * Copyright (C) 2015 Rob Clark
  */
 
+#include <linux/string_choices.h>
+
 #include <drm/display/drm_dp_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_print.h>
@@ -668,7 +670,7 @@ static int drm_dp_link_train_full(struct drm_dp_link *link)
 
 retry:
        DRM_DEBUG_KMS("full-training link: %u lane%s at %u MHz\n",
-                     link->lanes, (link->lanes > 1) ? "s" : "",
+                     link->lanes, str_plural(link->lanes),
                      link->rate / 100);
 
        err = drm_dp_link_configure(link->aux, link);
@@ -724,7 +726,7 @@ static int drm_dp_link_train_fast(struct drm_dp_link *link)
        int err;
 
        DRM_DEBUG_KMS("fast-training link: %u lane%s at %u MHz\n",
-                     link->lanes, (link->lanes > 1) ? "s" : "",
+                     link->lanes, str_plural(link->lanes),
                      link->rate / 100);
 
        err = drm_dp_link_configure(link->aux, link);