From patchwork Thu Jun 22 18:47:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giulio Benetti X-Patchwork-Id: 111788 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp5292318vqr; Thu, 22 Jun 2023 12:24:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6/S+YP0UNXaeOed3yqVZY1BINnHvItxbXqugxxEg8QYAlDL1QkxbK++6txw14yVgzm+IHD X-Received: by 2002:a05:6a20:4328:b0:125:377c:831d with SMTP id h40-20020a056a20432800b00125377c831dmr2389805pzk.3.1687461896284; Thu, 22 Jun 2023 12:24:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687461896; cv=none; d=google.com; s=arc-20160816; b=bAT5ujO03VLrfU7uWmA4C9NbKzc1iIBIQuZg3xgkAYZ/jAIPYJ3EyE8BZPdzGEZb4h xJjyTHnrnX2fLk2YYi2zi4EA9CFp6IPslIHkPJFYEjt3ij5u7ttI9zrizzx3wX1fgI1n x/cBhHDyTsNAnB0xky6OARDaGCnhdvGxtPMQ+5O1PqRsMW9tY6NQFBncu6XDCvoRSqBZ Xk7g2lmGfNixp+a6PKIqlHi+EymukBFJyNHmrsJxZmshNG2A96XG9jhhwk+Y0I7asHpH rZ1ORiQj3KvIjD5OiVJCh8gRrvWSGh3xs87yavQmi64HEKmhbkQgCzftC7FDaVIWVtAY GA1A== 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=cuwMLmTxDOxt34Sy1nHQi2wudtCG8J3hXYZulSXSsAg=; b=LYlaBV6egTPbNeyUvRkrhDQVGlNfsND1QzceltP4m4MSdpHhm21AuJ+Lk1UUuhIf5d mvhR+PG/oUOynceBTw4mOkIXwJWeKBfuB7viO+4wFhzJMM7GTCTSIqb/J9PsJiDv/GDD 3TtZ2mH96wG3isRJ0okqfSRn5no5vr2jGmYviKXCczzo99YMrkewhHJfaerX3vG61NSK LdjBSbVXFXj0/ZNqlB08ZkFV9ZD6A+w/Fh6cxW9Tvwofm6efqPrQADjVD+z0oGJ6bGmt H4QB5gOSXlwd6vu8hp2itVfVL/lK55MRTxo9qXeXGFtC6y6bxDoRAGDlmnu9qoIz1nOR 0qBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aruba.it header.s=a1 header.b="i+Gd4A8/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a6-20020a624d06000000b006436ead4abesi7026360pfb.227.2023.06.22.12.24.43; Thu, 22 Jun 2023 12:24:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@aruba.it header.s=a1 header.b="i+Gd4A8/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230062AbjFVSuC (ORCPT + 99 others); Thu, 22 Jun 2023 14:50:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229542AbjFVSuA (ORCPT ); Thu, 22 Jun 2023 14:50:00 -0400 X-Greylist: delayed 61 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 22 Jun 2023 11:49:58 PDT Received: from smtpcmd0642.aruba.it (smtpcmd0642.aruba.it [62.149.156.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92549A2 for ; Thu, 22 Jun 2023 11:49:58 -0700 (PDT) Received: from localhost.localdomain ([146.241.96.150]) by Aruba Outgoing Smtp with ESMTPSA id CPMRqVUdKoNFCCPMRqpqyA; Thu, 22 Jun 2023 20:48:53 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aruba.it; s=a1; t=1687459733; bh=zJtpFBlzWk1ZS1ZtblEKyuxmBEYkKm450YWAO4rklz0=; h=From:To:Subject:Date:MIME-Version; b=i+Gd4A8/0DnY9VnzFNPFpf5UTVc9Wa/avbpw3796KnZUToSU76jJmCHks8Nb8w+dA 2avDZYIfwaeRG6+DzbVWkU01xvdbjZvqlcljerCqeRC9dJ+V1bNibu/z8bDUo681r9 UcADbZy+YHGTFS4K/9pyX/v40PrlfgTFU623EHaWEt0Q6Apxxe1od6odsQmZJVm51q VK8V5kLKUTIcSFN9aiaA5YG6MWejvJUsSlEv/49weiDYSlmoZLLOxha9AQCTkcBUjN erACfpn+Ser9+YP2qugSJZtq50qCTliWfK4tLE+ySKBR+IQB2LHQFxWHLQtXKmz1ge WI03A7YrNCYPA== From: Giulio Benetti To: Florian Fainelli Cc: Broadcom internal kernel review list , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Simon Horman , Giulio Benetti Subject: [PATCH net-next v2] net: phy: broadcom: drop brcm_phy_setbits() and use phy_set_bits() instead Date: Thu, 22 Jun 2023 20:47:21 +0200 Message-Id: <20230622184721.24368-1-giulio.benetti@benettiengineering.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CMAE-Envelope: MS4xfA47KHPQ+3VK5+xnxuA//l8ONlMRqkhsU6gSpgBYA5KtR9yOjLrnq707eHgEyL4be4ghoSu7Peoj+b69HVOA+wh2WFbSjHymKCdL1zISGO5KeEaRbmQe hOR5eBaARQ1OZisyyMbp2E9nz3S4FR4HuEmEgNSHNYt020EAMX/Kh7Gcv4H2t0keD6zi4J2P+e4Wl7pKfTABnRGkoOeSfvTwskROCbbKHlvrhmAqgqE2/bGH XEolM1GACCVx4Uap8nR7J9DDgPGaHqCKzyeDzD/GiKxHgWHbw/PUxw/Am64wCn9KagdAagdTftIf1yKb21uK8v1XJZVuFY7ihoat6YyfBt+Nct0YdSQ5D5Lh ynzkvP9Wq2ByFitm9/XADjzqO25qMqS5UvVmfu7tRuMGy+oVS1jZnQlocEM29Vv2zFa8ubx9Wfo3zdM0mWoqpN8EK7zGEHAtIdOTqbl/Rbe+zmPK26Y5W3oU oa1PjCrUVeNEATO7YYgU0Yo401pLxD/tLbOwx6rDDjJs/AoRvioNvlA9XCaGx0FGLFxyt+3RBo9vsFmJB006eBD6FqnunGRDHsLryN4X/Dxd+hmQYnkZzAsa /j4DAtI3/pR+n7sdnpak9yovA8uPxkjN6rlZU97t1tH299KloEet9r6YPRIJ+Wec6m0= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769408043990109293?= X-GMAIL-MSGID: =?utf-8?q?1769432045449510677?= Linux provides phy_set_bits() helper so let's drop brcm_phy_setbits() and use phy_set_bits() in its place. Signed-off-by: Giulio Benetti Reviewed-by: Simon Horman Reviewed-by: Florian Fainelli --- V1->V2: * fix code style and add branch net-next to subject as suggested by Simon Horman --- drivers/net/phy/broadcom.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c index e81868d1830b..38a6615deaf7 100644 --- a/drivers/net/phy/broadcom.c +++ b/drivers/net/phy/broadcom.c @@ -608,17 +608,6 @@ static int bcm54616s_read_status(struct phy_device *phydev) return err; } -static int brcm_phy_setbits(struct phy_device *phydev, int reg, int set) -{ - int val; - - val = phy_read(phydev, reg); - if (val < 0) - return val; - - return phy_write(phydev, reg, val | set); -} - static int brcm_fet_config_init(struct phy_device *phydev) { int reg, err, err2, brcmtest; @@ -689,15 +678,15 @@ static int brcm_fet_config_init(struct phy_device *phydev) goto done; /* Enable auto MDIX */ - err = brcm_phy_setbits(phydev, MII_BRCM_FET_SHDW_MISCCTRL, - MII_BRCM_FET_SHDW_MC_FAME); + err = phy_set_bits(phydev, MII_BRCM_FET_SHDW_MISCCTRL, + MII_BRCM_FET_SHDW_MC_FAME); if (err < 0) goto done; if (phydev->dev_flags & PHY_BRCM_AUTO_PWRDWN_ENABLE) { /* Enable auto power down */ - err = brcm_phy_setbits(phydev, MII_BRCM_FET_SHDW_AUXSTAT2, - MII_BRCM_FET_SHDW_AS2_APDE); + err = phy_set_bits(phydev, MII_BRCM_FET_SHDW_AUXSTAT2, + MII_BRCM_FET_SHDW_AS2_APDE); } done: