Message ID | 20240104235723.46931-1-francesco@dolcini.it |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-17343-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp5934951dyb; Thu, 4 Jan 2024 15:58:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEgE980qOwPUTfWhxkUUUC6KyssMCsNLpatP0iiwTR+OJ5UjT4d3hqf2Y74NLH8B6AU9OZE X-Received: by 2002:a17:906:187:b0:a28:ba5d:e786 with SMTP id 7-20020a170906018700b00a28ba5de786mr1352296ejb.14.1704412679785; Thu, 04 Jan 2024 15:57:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704412679; cv=none; d=google.com; s=arc-20160816; b=NK7PwQ4AxIiT0DPmZ6BGv21nx8oa+Lw66W8ihAxBxZCaK8nj0vcv6fPZPfKwhQ+Cd/ g/prs/kdObSWfA7is4O14D1/eaEqE8/c/aB44VBBfbXEEXKY7z70q/IbRnTNFOsv67Be TP2oj01MTQQH8ulVRI739A6FbXqfoQ+MN57tT9BNOnMCNgBQ6WWHml05GSw23gANDOtB i7RzRZZNrh+u2ChVoACk1N61LCueinKYfMsPkQ3gMXMzmjAnMbkY4Sy0jxFCiXxEQ1i5 M4gs2DXAAet8F0QXLbBbSN8hk9ACLnblq6ChlqhuTI1w2dFCuCH6zoF3MbkdcQutceDX NSZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=rcp1ZdvMjOxQ6T3aXwTO1NL2LEfXKUImEqErissK/Hk=; fh=WDUQwYaqmi0n0GoDqmUq8gB8rZsIxn6lD5eOHr+BKUA=; b=GsmUqiM2j3E42TeYSLr0X73pv0IoX3vDqgOGjPFHDKtNQs2/xR91rLm3khY0fxRkR8 8IBdQVy50/s6nAIiCcppKCyVkvL0MpnkU0CDIky4t4rX7JUVK6EJvBlZd4gQCbpRX9Hl +l/rhzVs3n2LOk9tv6VyDln3NfffhVEtIuhk0mwrTQU/qDbpOaoJdrZT4d6OMdlJ+5DK eR3VEnyGHu6WfLLudoUu/MWTvnkMPThMdZF5qy0R41fg9NJfeDMNahe9ou6LAtBz4Jy7 ak9rtxNgIiF/HRzEGj+G3A9C0laf9kZO8IEsrzT6TeZqgW0vdq9ZFED+eULJaUwlRNlX TgBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-17343-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17343-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id la14-20020a170906ad8e00b00a29358ec549si58836ejb.975.2024.01.04.15.57.59 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 15:57:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17343-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-17343-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17343-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 65F6E1F230EE for <ouuuleilei@gmail.com>; Thu, 4 Jan 2024 23:57:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D90992D635; Thu, 4 Jan 2024 23:57:40 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mail11.truemail.it (mail11.truemail.it [217.194.8.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D97182D60A; Thu, 4 Jan 2024 23:57:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dolcini.it Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dolcini.it Received: from francesco-nb.pivistrello.it (93-49-2-63.ip317.fastwebnet.it [93.49.2.63]) by mail11.truemail.it (Postfix) with ESMTPA id 9AC41206D8; Fri, 5 Jan 2024 00:57:28 +0100 (CET) From: Francesco Dolcini <francesco@dolcini.it> To: Chandrasekar Ramakrishnan <rcsekar@samsung.com>, Wolfgang Grandegger <wg@grandegger.com>, Marc Kleine-Budde <mkl@pengutronix.de>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> Cc: Francesco Dolcini <francesco.dolcini@toradex.com>, linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] can: m_can: remove redundant check for pm_clock_support Date: Fri, 5 Jan 2024 00:57:23 +0100 Message-Id: <20240104235723.46931-1-francesco@dolcini.it> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787206230218187186 X-GMAIL-MSGID: 1787206230218187186 |
Series |
can: m_can: remove redundant check for pm_clock_support
|
|
Commit Message
Francesco Dolcini
Jan. 4, 2024, 11:57 p.m. UTC
From: Francesco Dolcini <francesco.dolcini@toradex.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@toradex.com> --- 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(-)
Comments
On Fri, Jan 05, 2024 at 12:57:23AM +0100, Francesco Dolcini wrote: > From: Francesco Dolcini <francesco.dolcini@toradex.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@toradex.com> Reviewed-by: Markus Schneider-Pargmann <msp@baylibre.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 >
Hello Marc and Vincent, On Fri, Jan 05, 2024 at 12:57:23AM +0100, Francesco Dolcini wrote: > From: Francesco Dolcini <francesco.dolcini@toradex.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@toradex.com> Did you missed this? Or do you have some concern with it? Francesco
On 16.02.2024 08:45:27, Francesco Dolcini wrote: > Hello Marc and Vincent, > > On Fri, Jan 05, 2024 at 12:57:23AM +0100, Francesco Dolcini wrote: > > From: Francesco Dolcini <francesco.dolcini@toradex.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@toradex.com> > > Did you missed this? Or do you have some concern with it? Somehow missed it in the last PR, but already part of the next PR. regards, Marc
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,