From patchwork Wed Jan 31 08:41:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu X-Patchwork-Id: 13538962 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (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 C35DE7B3CB for ; Wed, 31 Jan 2024 08:42:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706690529; cv=none; b=qsPNKolZqIAdTEibRvnxYsPNU9YVvBZslKuGp0UpI6lsgpFE7OkETo7JghCxGZu9Garb02w5rkhsBGfnwV4rKjm4Izwz3fNqo2OXjdD0KnmkTlIVOYEfxXJBPBVikeqqRG/E4heRclPCXTr/T0NVDCbE82OnO1KiIwLzFtPkhAY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706690529; c=relaxed/simple; bh=M4XElsAbkAPToo3ZEnKBpvLmehS5jEZzhlJpMuxS2lc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cImx18yFzDOUk+YCRPUqINz5U4qCwgJXBeMuEPdk54yWO7ke+wO/Fc46Nr/jM1V1s6JwkqYmIj4v8wuOZGGFF2N7COruj9zx9b1Yr/dKy5T4TubxODiGm8kKeWmsskxeF6/xn+MedPVvHqRwLhpWbsZrt6wC7emYlzkNgBrZvRc= 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=IpHUfG7v; arc=none smtp.client-ip=209.85.208.52 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="IpHUfG7v" Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-55c2cf644f3so5036704a12.1 for ; Wed, 31 Jan 2024 00:42:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1706690526; x=1707295326; 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=E1XrNomjmra/GM8RS/lknacwokF475kMeMhwWZ3EcPk=; b=IpHUfG7vGrYoMGri/XmbloOWvDcKQ9AFzDYOQ92wu4KCpW1cbM2Px27HrdVYIJd+Eq zHLXboJ+ZgY/cRoPLGoKEHiymO2GtyH9RJkdHWzVo050pyjLp434PA7uQp3kf6RNLLbX uaL14BScifZSILXbfD2M0fKUvvodRjAB5Qsv+S3Vab4tKL7tgqMJWwOO/AJsQ5kxvIrA gYE8nOo/BCrlmVU15EKn/iEBtGpRJidIa+h3spZQNZFZ4CJQ6lv8LSkzSZqkep8FgXwf lgJJZuuYBONWGxdrPHdtVy6U4xY53qFUJTDnk0fYHTWY078LMZFVoTBUoOOUA5mdSs+o rs9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706690526; x=1707295326; 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=E1XrNomjmra/GM8RS/lknacwokF475kMeMhwWZ3EcPk=; b=L2jRuSjWwtr4UjxwGJVxSlnnXv6w5aYCn+/r7osY24MjuqhFXpEBy+k3++I0FUpKYd qW4d4DFq24eLooyH3OFzPS8Eq5IPWkT+JYFbGLqOde/4fmdOaVIV0Ayr7kupQkRUgQDx qsq3fhho901ABS4o5v7ctXcv6awqUqr2yKfbLJ/didjT5oC7FjbBK5IcloDQdVpofSqu 7hRZmooMUUBKHBDEdd2qKj66sfdF2xdisvj4b8g7Up1o0RCl5vFLRdBEuHE7AJPTL0b9 hxfGo9Mk/pVEjTGDsnFRYLPQupBDnu8xjSCJTxqnd/LfTauzfgBVxdwdxRed/ntk4tL2 wRTw== X-Gm-Message-State: AOJu0YwAgTqW1T2y2z22P7iwXOXQkNPIASGRuVghzN5pSKMVoDYn606p fSv11OU89mTcS41T227txrvHbkeXALfH25EHM8vr0sQugLNghS4V+/3fvsV05BU= X-Google-Smtp-Source: AGHT+IEYcNtSIIzLCU/TMm9w1bEGYlnXRZN3KzRwiFoYa83jrAWMHaIWWxOlkyinI5M2+MzKlTNT+g== X-Received: by 2002:a05:6402:1cad:b0:55f:82b:2da3 with SMTP id cz13-20020a0564021cad00b0055f082b2da3mr561401edb.22.1706690525968; Wed, 31 Jan 2024 00:42:05 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXIkeN+/q/7fkLe7PzMiRTrGGYp00Bgy3bQ1jPEuKPEBJVX0h37D/hMWLvhlSkSi/f13QSgf+r+BRMOgXxH2a6200kHM1DYhsUJAYuPrh+rbrACpP24O0qT5nlfxcDfkhTSEYigBHk9WPIqNVGzy9itC6VRSD6ZM1TfbPIlUSq3J48kjLfI4HMJy0NaWMPPtGVnHq8NwXx8klz1JZY0Q3wBlpSgklAgzL1FuUmw9Dk+JQnTPWmfWMRX4x6r5HlVt1p4uNCk2AwybR+1C1+9FID1AXV+1CbZiZQhaYKIfgfSUJXhmrQHcocU6CSpuKjHJENER11RspvZ3awkm5ws8gSx+02Joy+fx4+IfcaVqF2QmJ8kX2UsBRZQXPGQYRlqCKdibrNBG1lMKzAyZkHH6xN444BHhbTPURQnrRaOj4AcTId80Hw= Received: from claudiu-X670E-Pro-RS.. ([82.78.167.87]) by smtp.gmail.com with ESMTPSA id cq16-20020a056402221000b0055f02661ae2sm2863630edb.78.2024.01.31.00.42.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 00:42:05 -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 v5 14/15] net: ravb: Simplify ravb_suspend() Date: Wed, 31 Jan 2024 10:41:32 +0200 Message-Id: <20240131084133.1671440-15-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240131084133.1671440-1-claudiu.beznea.uj@bp.renesas.com> References: <20240131084133.1671440-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org 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 v5: - none 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 0dab98ea615a..661236affa5b 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: