[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <nls37vv4rj6pn5vvrjizapb23l3mikpwkh2fk7gtrpnxgiym5b@jbmlyci4q3pg>
Date: Mon, 15 Jan 2024 10:52:32 +0100
From: Markus Schneider-Pargmann <msp@...libre.com>
To: Francesco Dolcini <francesco@...cini.it>
Cc: Chandrasekar Ramakrishnan <rcsekar@...sung.com>,
Wolfgang Grandegger <wg@...ndegger.com>, Marc Kleine-Budde <mkl@...gutronix.de>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Francesco Dolcini <francesco.dolcini@...adex.com>, linux-can@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] can: m_can: remove redundant check for pm_clock_support
On Fri, Jan 05, 2024 at 12:57:23AM +0100, Francesco Dolcini wrote:
> From: Francesco Dolcini <francesco.dolcini@...adex.com>
>
> m_can_clk_start() already skip starting the clock when
> clock support is disabled, remove the redundant check in
> m_can_class_register().
>
> This also solves the imbalance with m_can_clk_stop() that is called
> afterward in the same function before the return.
>
> Signed-off-by: Francesco Dolcini <francesco.dolcini@...adex.com>
Reviewed-by: Markus Schneider-Pargmann <msp@...libre.com>
Best,
Markus
> ---
> I spotted the issue while debugging some other part of the code,
> the patch is only compile-tested.
> ---
> drivers/net/can/m_can/m_can.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
> index 16ecc11c7f62..bd1d1626684d 100644
> --- a/drivers/net/can/m_can/m_can.c
> +++ b/drivers/net/can/m_can/m_can.c
> @@ -2056,11 +2056,9 @@ int m_can_class_register(struct m_can_classdev *cdev)
> {
> int ret;
>
> - if (cdev->pm_clock_support) {
> - ret = m_can_clk_start(cdev);
> - if (ret)
> - return ret;
> - }
> + ret = m_can_clk_start(cdev);
> + if (ret)
> + return ret;
>
> if (cdev->is_peripheral) {
> ret = can_rx_offload_add_manual(cdev->net, &cdev->offload,
> --
> 2.39.2
>
Powered by blists - more mailing lists