RE: [PATCH 1/5] pwm: rz-mtu3: fix prescale check when enabling 2nd channel

From: Cosmin-Gabriel Tanislav

Date: Mon Mar 16 2026 - 15:13:14 EST


> From: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
> Sent: Monday, March 16, 2026 8:26 PM
>
> Hi Cosmin,
>
> On Mon, 16 Mar 2026 at 16:52, Cosmin-Gabriel Tanislav
> <cosmin-gabriel.tanislav.xa@xxxxxxxxxxx> wrote:
> > static int rz_mtu3_sibling_hwpwm(u32 hwpwm, u32 *sibling_hwpwm)
>
> Unused sibling_hwpwm?
>
> > {
> > if (!rz_mtu3_hwpwm_is_primary(hwpwm))
> > return hwpwm - 1;
> >
> > if (rz_mtu3_hwpwm_is_primary(hwpwm + 1))
> > return -EINVAL;
> >
> > return hwpwm + 1;
> > }
>
> Gr{oetje,eeting}s,
>

Hello Geert. Thanks for catching that.

It's funny how even after triple-checking the message I was about to
send, I didn't notice it.

This should have been what I sent.

static int rz_mtu3_sibling_hwpwm(u32 hwpwm, u32 *sibling_hwpwm)
{
if (!rz_mtu3_hwpwm_is_primary(hwpwm)) {
*sibling_hwpwm = hwpwm - 1;
return 0;
}

if (rz_mtu3_hwpwm_is_primary(hwpwm + 1))
return -EINVAL;

*sibling_hwpwm = hwpwm + 1;

return 0;
}

> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds