]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pwm: rzg2l-gpt: Allow checking period_tick cache value only if sibling channel is...
authorBiju Das <biju.das.jz@bp.renesas.com>
Wed, 26 Nov 2025 10:42:48 +0000 (10:42 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Jan 2026 11:57:29 +0000 (12:57 +0100)
commit17be376bb250718e466eb33d3538b478781823af
tree9ddd946713294aa8e448af4d30798390c8fb729c
parentf80e4e91b010ee7d6c52f24d069975ac955ac6b2
pwm: rzg2l-gpt: Allow checking period_tick cache value only if sibling channel is enabled

commit fae00ea9f00367771003ace78f29549dead58fc7 upstream.

The rzg2l_gpt_config() tests the rzg2l_gpt->period_tick variable when
both channels of a hardware channel are in use. This check is not valid
if rzg2l_gpt_config() is called after disabling all the channels, as it
tests against the cached value. Hence, allow checking and setting the
cached value only if the sibling channel is enabled.

While at it, drop else after return statement to fix the check patch
warning.

Cc: stable@kernel.org
Fixes: 061f087f5d0b ("pwm: Add support for RZ/G2L GPT")
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://patch.msgid.link/20251126104308.142302-1-biju.das.jz@bp.renesas.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pwm/pwm-rzg2l-gpt.c