Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp9978rdb; Fri, 5 Jan 2024 00:28:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IFGggzhbA/Tc644hExChl7rVk7oaO3ieFIQXBzKCDbZco5DHIKcfCSPnE5Ri1vaImGfuWDd X-Received: by 2002:a05:6214:c83:b0:680:ce23:cb45 with SMTP id r3-20020a0562140c8300b00680ce23cb45mr2801156qvr.15.1704443339562; Fri, 05 Jan 2024 00:28:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704443339; cv=none; d=google.com; s=arc-20160816; b=tVmxeot1m1L79d/Cy7K2YK4wt+czDpmwgyDij9FZ/pV2XzNQpudXht0Gil6Toyxmol DMqHj/GqouOSTAlM7TSiWKioPI4WRnGUSDKCygKgmAejG1t9eoDGPkDp31TthSdwqxGc EQf6QRBFiA/D6GVGfv6CT4BqnS6Z4dgtK3V3/gh5jTWxyiihbjivxrupUHSA1MgtlZLV 3PcqRqZYtlOv2N1J+Ab4mk/ttSo6vnjTjIGQFNFUG1VUhRxM9++EsALjxbvM5ukpCbix D5/IDnslBdhcro7J3GxOC734M0w3C1Zfwv7g46opotIgHdu/zo4bnFT5iPHVyr5Zr+wR 90dA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=CJ8CzScii+mqzmjbtrVuVx2JcFAYoPC8SxGsrNUa8W0=; fh=qryrdWWtksp4Ojh0keXejXriHeHARah4mOGZkuZ1jnk=; b=lmgu4naLYSdGcGvuNinDgCpjTtLdNNiROo9vbaqaPW6uTUlPRjkX4cEAzagiFn4+GL aj/gk7Xe7VqpTvBsfuSWZmWQSBE00bRdGf5F2WSuQQoAe4hTTbFr4MBA8UB2qkVlYaGS 4aAf+Nxr1SU6i6AqoglFBYC0vKrTX0HsiucYPVlWgEIQq6eZEMhOkQiAZECpumQ35gq6 vVXUJaMvSKW15ug8iw4ODX9Sia13EnZDeqFxLc50Gf4IAxBxfKF9ubzaWNdHOPn4OYWc npHt3VojYgquZ16B7lY+WtrBcn2mE2PTtT7kX51PG8DfodTdp0DFzk6i7BtTWfT7fplE fkuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=qP021Lgu; spf=pass (google.com: domain of linux-kernel+bounces-17593-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17593-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 h18-20020a0cf412000000b0067eeb5d03f9si1306978qvl.63.2024.01.05.00.28.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 00:28:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17593-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=qP021Lgu; spf=pass (google.com: domain of linux-kernel+bounces-17593-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17593-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 53A581C22C9E for ; Fri, 5 Jan 2024 08:28:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8447E2E41C; Fri, 5 Jan 2024 08:25:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="qP021Lgu" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (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 760122E40A for ; Fri, 5 Jan 2024 08:25:08 +0000 (UTC) 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-ej1-f44.google.com with SMTP id a640c23a62f3a-a27733ae1dfso154070166b.3 for ; Fri, 05 Jan 2024 00:25:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1704443107; x=1705047907; 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=CJ8CzScii+mqzmjbtrVuVx2JcFAYoPC8SxGsrNUa8W0=; b=qP021LguCyMr20k6VTFD5ZxUE6GRlK8C3CiuWrIFYOV+JclvpV2cBL36RMHV9Hhcwj mT9TxnYeIav2/S0KfmlpJulGNLjgjkfGIjS6mhH987sbEJuH7AkRafcwfidD8GukWA94 BmzZkMP9LThfnVA1mo3qijIrj7fi0IJEPsG5ocB3Quh0W7jyK++EApGGL1TmYtfwUUXP ZflJuXWm4gEf33J5mGa+D2hNIbnhwd0wM28tvv1tS4KG/12MbLMCBcAsyc8G0e2y+t8G up3cJBuccEqlCDRDoi5b89jlTscIZza++3L5SYtdjxFo7eOQ4B7036lY8CaoCUE9EAut HdEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704443107; x=1705047907; 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=CJ8CzScii+mqzmjbtrVuVx2JcFAYoPC8SxGsrNUa8W0=; b=WxerRSirsaanxJJ/1gmGPylspDgH9/KLTduYQjMc/i7ItOlylHEacq40qejDK9jMxd +X1oqildpPlm5jRlY1t/mfdgmPWTkOG8h3rpIDN4BjzUv81o/6SEnc/N6rBbLBXKU+U1 nf0hniNf0IeEzi4gFces8txrl5qeEsUg/lfxUDfMoleIunuG3T2v6RgEmW977ieXV80k QMrwAczjwND1zfufXBaL7Y657r2ejlzYFnmieu1WlpzlIZZvwa6yGQv4f8H6G4dRsQM9 +8mcXlYoMixNr6biQcuKwFknrkJ+suf+jqqVpu/Jg43p9okK4GFJ8oR/TNft9BymWdlx sAEw== X-Gm-Message-State: AOJu0YwBWOfsV/JirR8IxyO7MqkKhMPDsAOxtBdVOVY1/B2IHuNvix9d gBBaiy+xdWp24+aXwmYBG4BOpYsARnnGrA== X-Received: by 2002:a17:906:4a81:b0:a23:65cb:6f7a with SMTP id x1-20020a1709064a8100b00a2365cb6f7amr479978eju.78.1704443106857; Fri, 05 Jan 2024 00:25:06 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.5]) by smtp.gmail.com with ESMTPSA id j15-20020a1709064b4f00b00a28e759a447sm596198ejv.213.2024.01.05.00.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 00:25:06 -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, yoshihiro.shimoda.uh@renesas.com, wsa+renesas@sang-engineering.com Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, claudiu.beznea@tuxon.dev, geert+renesas@glider.be, Claudiu Beznea Subject: [PATCH net-next v3 14/19] net: ravb: Simplify ravb_suspend() Date: Fri, 5 Jan 2024 10:23:34 +0200 Message-Id: <20240105082339.1468817-15-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240105082339.1468817-1-claudiu.beznea.uj@bp.renesas.com> References: <20240105082339.1468817-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 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 434b4777de5e..1d228e0d875f 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2890,6 +2890,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); } @@ -2922,14 +2925,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