Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1689600rdb; Thu, 25 Jan 2024 03:20:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/V1C3v9YVQvUXKUvn0MEZss1bgtYm3tmun8gklvrX1vy8c7D+Yajt/s0ckOU9gM03s2sx X-Received: by 2002:a05:622a:1b86:b0:42a:53ee:9a31 with SMTP id bp6-20020a05622a1b8600b0042a53ee9a31mr1029505qtb.82.1706181628382; Thu, 25 Jan 2024 03:20:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706181628; cv=pass; d=google.com; s=arc-20160816; b=lSYumO+wSwgEBx7s1sGOnXlJm9bYDTaC5JtmmvYEhdMUzmV1DH0tUcglibHAYRrBKh 8bQcQaMzTnQ2RxW+BUoUOhN0xR1PjZj4HWb95mzSvMbZXxLhsbbTkoumW9HpnpVikIlt hXNjE2iX6vOxs6Q5BR85bCxanKrlb9PudBuMQm9Sn4ZmrHkCiiXgjGkzJMGbTFiz1Ndr 1CsyF4kC8DWC2gQQQJVtKc53qVNFM4TvTUovJjvcFy8fKHHl7C2KkOBLXsBmEcj/JaSo yt1uWJrSn+F0JdBNTZm42Dj36lahDl5Y5wtFNG8XXmm3SHlQ0qrwCtHWoncQ8UvRCisb gAMA== ARC-Message-Signature: i=2; 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=5b1oLq4gou76iDcjhTA1HtV5RCuNVpeTpFhZ4OqPYQ0=; fh=UyecQQQXnYrqJOxUwLOxxxo1ko/XVjNRN6+YZN+rtNE=; b=nTuV14oxYjq/YGH0ruVk1tb5x5KR+mtZXFwOqyQBYF6qbxFM1EgutYSsHSUUNI1eoF I29BCI8RHOzm8Tds6R59/ID2oQeh+SdapWoIKdpd57wj2m1SYoF8Y1dW+9EpDQO4+2yP ZLa7VW1JBmmanBDOyOGX9/7sXwsbtZaE8m43gazRlqzkp3Ewq3HMzDQf/RXGpOgosIo0 m/lwH6R5PAJII9IhzDCJbaZW8al4LX/cuvFcREQix8PUcMg/3RjlLrelG2Tmrt5hPTKp Bm3rlGs6ilb+bfNPUWXtvUfowKKkRLJ8JHzC6ZDH4RfhQ3AB42QylsHALi5q1eLKmomF 7r4w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=YmC4zG0j; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-35304-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35304-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id w15-20020ac87e8f000000b0042a51fbf9d1si5602969qtj.49.2024.01.25.03.20.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 03:20:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35304-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=YmC4zG0j; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-35304-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35304-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 BF2141C22DBC for ; Tue, 23 Jan 2024 13:05:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 34C47612E6; Tue, 23 Jan 2024 12:59:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="YmC4zG0j" Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 B01C060DC3 for ; Tue, 23 Jan 2024 12:59:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706014793; cv=none; b=C+vp0o6+Z41XDqq6N2ygYtpv7B4Rt1QC73AT+dohKlCGblotOvhnJQo8YQQ2QxjODcXTwGqdWtxO73mcfs/GbEYvHG227LRQsE4duofkpcctZhfFErmj/tSZdsxvy0Xj4DjibBpxxVfjmfLexkjeKBtYDJjL8u1Mu3yryJa0AEc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706014793; c=relaxed/simple; bh=hqR1Fnpsr1zfZ4XXcoXvlX+RpLOUELhZTTBjGjxL0o8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GXW1fu0LyX+sLdJGeeLTA4yVbhhpuQg17uu8yMO84aHsqBwq9JTE4Dtw/kmijQ7KNF4X3rgwnKdaQGe34Uim/ua0gwii8YvsbsANTh+HZ7DsiGFvsmLMcuVKzVZNzIREL0L5bxvCg/XE2DDeaIC/U2fkj0p88F2NOKcdxKLPQBs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=YmC4zG0j; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-40e60e137aaso47443335e9.0 for ; Tue, 23 Jan 2024 04:59:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1706014790; x=1706619590; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5b1oLq4gou76iDcjhTA1HtV5RCuNVpeTpFhZ4OqPYQ0=; b=YmC4zG0jTksQVPjkb92HEunVFQCS4/NAb56zj2Sr1S7O+ZPbIwM01q48AXCmKPow+p WOoDbAebfh8w44pyUwWL7FiyeIjh8EWW3I8AnAOd7MH/KsoJabUvmgcBOqBZrmbnTlim dziiqJvFhEcWDA+znKAcNYWCuRABQ61biSjsWSWyeFq4NMi2PHF8akXMDd+e1K7ApElc 7yNRJz82gq6p9qNqoWDEBn7h+PhYB7w08gAfMT8ZN/Ip5WkMAjwgObcMjMLTh4DCq8aZ MpbO7frsAWo0jdIUB4I2K6drBwMLJIosdKsd+kK+Yu3+1PO8TggsC0k/yUPWHxqke9k8 +K8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706014790; x=1706619590; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5b1oLq4gou76iDcjhTA1HtV5RCuNVpeTpFhZ4OqPYQ0=; b=wKNxiCEPh77Scsqpnh594WqB734SLSzyfTraMsPeJ8El0uSIm/lqgPDekslahSTzDs D0vJL5g6mBUBV2GufvWCxAJOnLCmGfCvUG49f1i9FMZwJt0QXEdyW0kt2Ance2jxdRdp n3R0oNNi6ux3jHSXi/K2XSf5pcfOD87rW5KGQBM75C6cuk6BDgtBQeivUBtSfZxj7yT5 ljsFziANJ+i9txTqP8BBt8zc1FzaK4fCSAA/mSyRYfnW5uvYNZuqORX+iehhdv9AZ1Vu 4J7qxHEXFoRGhFqm118FF05SYqXstc9XKsULwS7yYZkHZkQv5zw62ZLh2unonNRfnbZh P4KQ== X-Gm-Message-State: AOJu0YyzJW6vLEoVE4gAO3YzN6G1UWYPyaVkd3M1t3cI2XR41geErDGw R3Wo7J7wdt2ci53cbKsS/WOtUIXNWKvNS8FIgCbkEB1DODh0OorXxw8ckgMAIY0= X-Received: by 2002:a05:600c:4509:b0:40e:b244:1be3 with SMTP id t9-20020a05600c450900b0040eb2441be3mr490190wmo.175.1706014790203; Tue, 23 Jan 2024 04:59:50 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.135]) by smtp.gmail.com with ESMTPSA id s4-20020a05600c45c400b0040e6ff60057sm33655711wmo.48.2024.01.23.04.59.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 04:59:49 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: s.shtylyov@omp.ru, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com, p.zabel@pengutronix.de, geert+renesas@glider.be Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH net-next v4 14/15] net: ravb: Simplify ravb_suspend() Date: Tue, 23 Jan 2024 14:58:28 +0200 Message-Id: <20240123125829.3970325-15-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240123125829.3970325-1-claudiu.beznea.uj@bp.renesas.com> References: <20240123125829.3970325-1-claudiu.beznea.uj@bp.renesas.com> 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: Claudiu Beznea As ravb_close() contains now the call to ravb_ptp_stop() for both ccc_gac and gPTP aware platforms, there is no need to keep the separate call in ravb_suspend(). Instead, move it to ravb_wol_setup(). In this way the resulting code is cleaner. Reviewed-by: Sergey Shtylyov Signed-off-by: Claudiu Beznea --- Changes in v4: - none Changes in v3: - fixed typos in patch description - collected tags Changes in v2: - none; this patch is new drivers/net/ethernet/renesas/ravb_main.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index e22760b91a97..74568c836468 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2929,6 +2929,9 @@ static int ravb_wol_setup(struct net_device *ndev) /* Enable MagicPacket */ ravb_modify(ndev, ECMR, ECMR_MPDE, ECMR_MPDE); + if (priv->info->ccc_gac) + ravb_ptp_stop(ndev); + return enable_irq_wake(priv->emac_irq); } @@ -2961,14 +2964,10 @@ static int ravb_suspend(struct device *dev) netif_device_detach(ndev); if (priv->wol_enabled) - ret = ravb_wol_setup(ndev); - else - ret = ravb_close(ndev); + return ravb_wol_setup(ndev); - if (priv->info->ccc_gac) - ravb_ptp_stop(ndev); - - if (priv->wol_enabled) + ret = ravb_close(ndev); + if (ret) return ret; reset_assert: -- 2.39.2