Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp8014392rdb; Thu, 4 Jan 2024 15:57:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IHdmAcuvfqk1/j5sphE/33uhgMTePo21d9wb5xutN9rEk83oVl+GbsbVjf8YMq92NtqYNKT X-Received: by 2002:a05:6122:2988:b0:4b6:c9fb:b185 with SMTP id fn8-20020a056122298800b004b6c9fbb185mr1236866vkb.23.1704412669438; Thu, 04 Jan 2024 15:57:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704412669; cv=none; d=google.com; s=arc-20160816; b=IuzmKgj2uq9eOY43b4MMoNVck+Cplw3O1DG8pnj/4WlaVzQnEWP0HqZsDGwCsZEOmK Ivyry4D9Vvk3J292XOVyIWx6HQJ1KWNSElaigjBvfjSlsZDpyNJcyEUJ0WQRrsdNyODx HuQMtGKmQWafy+Pz2ZPBquT66uGaQ1pfor5pW21JytfzfICrOqZlmWxXsc8wgZ5zTJFi Kyo8hnrL3aVl4VGi8ETMXd4US4Hto8R/GM4jlBmHMV6/ipFUucrlxJq8rXQqKZS9Umry 0xr/CaoYYP3EFiD+TD5xBRl+avKIfAnerSAY6PaZwCPfrTv7hH/DR4rguA+QC/qZpZc+ 093Q== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17343-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d27-20020a05620a137b00b0078152733ae4si584164qkl.43.2024.01.04.15.57.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 15:57:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17343-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-17343-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17343-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2FA1C1C221B9 for ; Thu, 4 Jan 2024 23:57:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D7A8C2D620; Thu, 4 Jan 2024 23:57:39 +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 To: Chandrasekar Ramakrishnan , Wolfgang Grandegger , Marc Kleine-Budde , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Francesco Dolcini , 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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Francesco Dolcini 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 --- 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