From patchwork Wed Nov 29 02:12:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 171034 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a5a7:0:b0:403:3b70:6f57 with SMTP id d7csp68585vqn; Tue, 28 Nov 2023 18:13:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEwt9aJmpPOVZlYzQydpdA56TzdkBSWUczJ4fNYSLq/DTk3AgoGroTe/SKFAtp42Q4f81qC X-Received: by 2002:a05:6808:19a4:b0:3ac:aae1:6d64 with SMTP id bj36-20020a05680819a400b003acaae16d64mr23900590oib.2.1701224016137; Tue, 28 Nov 2023 18:13:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701224016; cv=none; d=google.com; s=arc-20160816; b=xUeDPlIp485zktXOIG7XWBWJyI4thYRLH8cqEyNKIEhsPcaVgN5fpmPqpYSNnx4Hov ZBiNj+QOIQlGeN4BtiBGuwgaYLz1oYZc4QV2i+74H0qKemK1+xOSjMdYNHD+QLwSul2t EqGkFSPDRyTIdDwUiX7gtWbd2dezHxNONaZSkpLy4evXayYU+MU2K5AtsQFLog8vx/SQ lZiy11WdPvLOcBDFgYBOEGyrr9WPzpsOl4Cjt5W8k1Wix/Ocd+DRy+aVBeDk26QysmES nl/jPIUTKKHqsY9cQy/QZuQ6M4YV1o31rjbuRcixq8j8k+UwIYi5VYkPlEgGQYYSgJYe bqMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=spIA+TVjxFqYjCqYdLI5WqUat6LJ/25LYK4uOryfg2Q=; fh=M/Mg9TtngevyqXgZJCTwFV5p5//1sl9LEorA0JOhC3o=; b=0N8Ki7qDmN0GTbDsnzAjHC1YltvheXsjksa05GTEPw030PfGzdEv3lp6S/z+8ANMJu K1CQDgHFr5MW4Qt88Bg2LQYcxVVWWkAzw5jH8Is+Ss4DOJCbr7NSsJPzMcB7jW8WKk8j IgxoV1zb6tbRBFs2n/QFRhiix42tYYgyMIwRYbZCXzs166odw+0T68cTAPdM8YOa6OVt N+tz2AsxnMrgQ+HD+fFDA3DtE/6+l5pp6N/CTk8MDlsJv3j8KBhvGjKMtsexOvXSx5KM 7E+w2jXw+NHMEtc+NDYQ7vD9ga1lDsWFipaPJvIxrzRmYYjipMrNbXyeKIZBlzz0Lpuz Sm/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PkGCGP9y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id u21-20020a634715000000b00573f94e8b83si13120966pga.265.2023.11.28.18.13.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 18:13:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PkGCGP9y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 1E29380A9AAA; Tue, 28 Nov 2023 18:13:27 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234566AbjK2CMc (ORCPT + 99 others); Tue, 28 Nov 2023 21:12:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232195AbjK2CM0 (ORCPT ); Tue, 28 Nov 2023 21:12:26 -0500 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DB9A1735; Tue, 28 Nov 2023 18:12:33 -0800 (PST) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-40b4f6006d5so8891345e9.1; Tue, 28 Nov 2023 18:12:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701223951; x=1701828751; 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=spIA+TVjxFqYjCqYdLI5WqUat6LJ/25LYK4uOryfg2Q=; b=PkGCGP9yvCYJtSK/fn3XDhHB1RHAOoZC4ubcACm+sjWpJ0/zxWbS7/ioN15f0lMgSK PnuTYxfBrHJw4213WA9GUOktGdD5I7YVol0zlc+U+D+ntO6gWeHSH/KtwVmmh4dxA7U5 gsIR/BM7HPKpSZhTzDaNOLKdJhl5edHkK7OPfcN3MNF0E5d/CKgNrOw7MQ6snRQ55AfM yATwhlVNhJUsWrqU2IudpeStjy4F0YAVBjgbMGSV3Rd/282it2VaDTNWGkMQq05Bwsel AOv4uoK6vmWkmR4eUUZBx4viWR1wEm/ZeomD9T+rA8tcNt6KSyHPu23i7E/Aqmi9eceF dzig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701223951; x=1701828751; 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=spIA+TVjxFqYjCqYdLI5WqUat6LJ/25LYK4uOryfg2Q=; b=Mewd6+F6PtI2/u/zCezbNenQhsba/qgV4j1OfIQrT4WDoqUoz6vdbmrdMdjCv63olF rpRNQtYBNTzTiHeHzTz64gahWe3A8ivC6qeGISKebrt3WOHEZE7P3VZvt/PmO/n7UpmA BqYq6gFMRdkMKw0F2jB2YFCfxHG+X6yw/eRweQklxDta0KDLcXYxUYyKxMW5s/RRH/y7 O6TfVkrxILdPgZNeKQ2DORXrKzjE+kiupiCEdK6LSoO34V98R1owO9O7a0xbSX6IMohg S/29Z7dKlu5R46Psl1xnKpBmiumEmYiaj/5x8VLHL/BojL7YuBpTPnCh7uywotPlBxgQ 3E1g== X-Gm-Message-State: AOJu0YxsWNqR6bAMrXp+1vIoF1P25p4BEZdJEaOQGED2bDoZI8bZVMaq sXgRrRbwbx1hlxQDx0Tp1Qk= X-Received: by 2002:adf:f705:0:b0:332:ef1e:bb8b with SMTP id r5-20020adff705000000b00332ef1ebb8bmr8792250wrp.7.1701223951645; Tue, 28 Nov 2023 18:12:31 -0800 (PST) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id b19-20020a05600c4e1300b0040648217f4fsm321406wmq.39.2023.11.28.18.12.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 18:12:31 -0800 (PST) From: Christian Marangi To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andy Gross , Bjorn Andersson , Konrad Dybcio , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Christian Marangi Subject: [net-next PATCH 03/14] net: phy: at803x: raname hw_stats functions to qca83xx specific name Date: Wed, 29 Nov 2023 03:12:08 +0100 Message-Id: <20231129021219.20914-4-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231129021219.20914-1-ansuelsmth@gmail.com> References: <20231129021219.20914-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 28 Nov 2023 18:13:27 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783862674107118873 X-GMAIL-MSGID: 1783862674107118873 The function and the struct related to hw_stats were specific to qca83xx PHY but were called following the convention in the driver of calling everything with at803x prefix. To better organize the code, rename these function a more specific name to better describe that they are specific to 83xx PHY family. Signed-off-by: Christian Marangi Reviewed-by: Andrew Lunn --- drivers/net/phy/at803x.c | 44 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index b32ff82240dc..4ff41d70fc47 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c @@ -295,7 +295,7 @@ struct at803x_hw_stat { enum stat_access_type access_type; }; -static struct at803x_hw_stat at803x_hw_stats[] = { +static struct at803x_hw_stat qca83xx_hw_stats[] = { { "phy_idle_errors", 0xa, GENMASK(7, 0), PHY}, { "phy_receive_errors", 0x15, GENMASK(15, 0), PHY}, { "eee_wake_errors", 0x16, GENMASK(15, 0), MMD}, @@ -311,7 +311,7 @@ struct at803x_priv { bool is_1000basex; struct regulator_dev *vddio_rdev; struct regulator_dev *vddh_rdev; - u64 stats[ARRAY_SIZE(at803x_hw_stats)]; + u64 stats[ARRAY_SIZE(qca83xx_hw_stats)]; }; struct at803x_context { @@ -529,24 +529,24 @@ static void at803x_get_wol(struct phy_device *phydev, wol->wolopts |= WAKE_MAGIC; } -static int at803x_get_sset_count(struct phy_device *phydev) +static int qca83xx_get_sset_count(struct phy_device *phydev) { - return ARRAY_SIZE(at803x_hw_stats); + return ARRAY_SIZE(qca83xx_hw_stats); } -static void at803x_get_strings(struct phy_device *phydev, u8 *data) +static void qca83xx_get_strings(struct phy_device *phydev, u8 *data) { int i; - for (i = 0; i < ARRAY_SIZE(at803x_hw_stats); i++) { + for (i = 0; i < ARRAY_SIZE(qca83xx_hw_stats); i++) { strscpy(data + i * ETH_GSTRING_LEN, - at803x_hw_stats[i].string, ETH_GSTRING_LEN); + qca83xx_hw_stats[i].string, ETH_GSTRING_LEN); } } -static u64 at803x_get_stat(struct phy_device *phydev, int i) +static u64 qca83xx_get_stat(struct phy_device *phydev, int i) { - struct at803x_hw_stat stat = at803x_hw_stats[i]; + struct at803x_hw_stat stat = qca83xx_hw_stats[i]; struct at803x_priv *priv = phydev->priv; int val; u64 ret; @@ -567,13 +567,13 @@ static u64 at803x_get_stat(struct phy_device *phydev, int i) return ret; } -static void at803x_get_stats(struct phy_device *phydev, - struct ethtool_stats *stats, u64 *data) +static void qca83xx_get_stats(struct phy_device *phydev, + struct ethtool_stats *stats, u64 *data) { int i; - for (i = 0; i < ARRAY_SIZE(at803x_hw_stats); i++) - data[i] = at803x_get_stat(phydev, i); + for (i = 0; i < ARRAY_SIZE(qca83xx_hw_stats); i++) + data[i] = qca83xx_get_stat(phydev, i); } static int at803x_suspend(struct phy_device *phydev) @@ -2168,9 +2168,9 @@ static struct phy_driver at803x_driver[] = { .flags = PHY_IS_INTERNAL, .config_init = qca83xx_config_init, .soft_reset = genphy_soft_reset, - .get_sset_count = at803x_get_sset_count, - .get_strings = at803x_get_strings, - .get_stats = at803x_get_stats, + .get_sset_count = qca83xx_get_sset_count, + .get_strings = qca83xx_get_strings, + .get_stats = qca83xx_get_stats, .suspend = qca83xx_suspend, .resume = qca83xx_resume, }, { @@ -2184,9 +2184,9 @@ static struct phy_driver at803x_driver[] = { .flags = PHY_IS_INTERNAL, .config_init = qca83xx_config_init, .soft_reset = genphy_soft_reset, - .get_sset_count = at803x_get_sset_count, - .get_strings = at803x_get_strings, - .get_stats = at803x_get_stats, + .get_sset_count = qca83xx_get_sset_count, + .get_strings = qca83xx_get_strings, + .get_stats = qca83xx_get_stats, .suspend = qca83xx_suspend, .resume = qca83xx_resume, }, { @@ -2200,9 +2200,9 @@ static struct phy_driver at803x_driver[] = { .flags = PHY_IS_INTERNAL, .config_init = qca83xx_config_init, .soft_reset = genphy_soft_reset, - .get_sset_count = at803x_get_sset_count, - .get_strings = at803x_get_strings, - .get_stats = at803x_get_stats, + .get_sset_count = qca83xx_get_sset_count, + .get_strings = qca83xx_get_strings, + .get_stats = qca83xx_get_stats, .suspend = qca83xx_suspend, .resume = qca83xx_resume, }, {