[Letux-kernel] Patch "pwm: jz4740: Fix build failure" has been added to the 5.4-stable tree

gregkh at linuxfoundation.org gregkh at linuxfoundation.org
Tue Jul 14 19:13:19 CEST 2020


This is a note to let you know that I've just added the patch titled

    pwm: jz4740: Fix build failure

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     pwm-jz4740-fix-build-failure.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable at vger.kernel.org> know about it.


>From u.kleine-koenig at pengutronix.de  Tue Jul 14 18:58:26 2020
From: "Uwe Kleine-König" <u.kleine-koenig at pengutronix.de>
Date: Fri, 10 Jul 2020 12:27:58 +0200
Subject: pwm: jz4740: Fix build failure
To: stable at vger.kernel.org
Cc: "H. Nikolaus Schaller" <hns at goldelico.com>, Paul Cercueil <paul at crapouillou.net>, Thierry Reding <thierry.reding at gmail.com>, linux-pwm at vger.kernel.org, linux-kernel at vger.kernel.org, letux-kernel at openphoenux.org, linux-mips at vger.kernel.org, tsbogend at alpha.franken.de
Message-ID: <20200710102758.8341-1-u.kleine-koenig at pengutronix.de>

From: "Uwe Kleine-König" <u.kleine-koenig at pengutronix.de>

When commit 9017dc4fbd59 ("pwm: jz4740: Enhance precision in calculation
of duty cycle") from v5.8-rc1 was backported to v5.4.x its dependency on
commit ce1f9cece057 ("pwm: jz4740: Use clocks from TCU driver") was not
noticed which made the pwm-jz4740 driver fail to build.

As ce1f9cece057 depends on still more rework, just backport a small part
of this commit to make the driver build again. (There is no dependency
on the functionality introduced in ce1f9cece057, just the rate variable
is needed.)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
Reported-by: H. Nikolaus Schaller <hns at goldelico.com>
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>

---
 drivers/pwm/pwm-jz4740.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/drivers/pwm/pwm-jz4740.c
+++ b/drivers/pwm/pwm-jz4740.c
@@ -92,11 +92,12 @@ static int jz4740_pwm_apply(struct pwm_c
 {
 	struct jz4740_pwm_chip *jz4740 = to_jz4740(pwm->chip);
 	unsigned long long tmp;
-	unsigned long period, duty;
+	unsigned long rate, period, duty;
 	unsigned int prescaler = 0;
 	uint16_t ctrl;
 
-	tmp = (unsigned long long)clk_get_rate(jz4740->clk) * state->period;
+	rate = clk_get_rate(jz4740->clk);
+	tmp = rate * state->period;
 	do_div(tmp, 1000000000);
 	period = tmp;
 


Patches currently in stable-queue which might be from u.kleine-koenig at pengutronix.de are

queue-5.4/pwm-jz4740-fix-build-failure.patch


More information about the Letux-kernel mailing list