]> Gentwo Git Trees - linux/.git/commitdiff
pwm: Simplify printf to emit chip->npwm in $debugfs/pwm
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>
Fri, 26 Sep 2025 16:57:03 +0000 (18:57 +0200)
committerUwe Kleine-König <ukleinek@kernel.org>
Fri, 14 Nov 2025 10:56:13 +0000 (11:56 +0100)
Instead of caring to correctly pluralize "PWM device(s)" using

(chip->npwm != 1) ? "s" : ""

or

str_plural(chip->npwm)

just simplify the format to not need a plural-s.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/20250926165702.321514-2-u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
drivers/pwm/core.c

index ea2ccf42e81441d00a349f6d8641c92143d94797..5b75f4a0849670e9176ab2ad5cb74e4bcf6e3f67 100644 (file)
@@ -2696,11 +2696,10 @@ static int pwm_seq_show(struct seq_file *s, void *v)
 {
        struct pwm_chip *chip = v;
 
-       seq_printf(s, "%s%d: %s/%s, %d PWM device%s\n",
+       seq_printf(s, "%s%d: %s/%s, npwm: %d\n",
                   (char *)s->private, chip->id,
                   pwmchip_parent(chip)->bus ? pwmchip_parent(chip)->bus->name : "no-bus",
-                  dev_name(pwmchip_parent(chip)), chip->npwm,
-                  (chip->npwm != 1) ? "s" : "");
+                  dev_name(pwmchip_parent(chip)), chip->npwm);
 
        pwm_dbg_show(chip, s);