Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp3398943rwr; Sat, 22 Apr 2023 04:50:38 -0700 (PDT) X-Google-Smtp-Source: AKy350bPjv07dNvS/4KRyOnwO4ZJhg0C+ViVCdLqPUm4UhtdAzhNMRC5PVbr3x3lMVoMGPSnpmFc X-Received: by 2002:a05:6a00:4103:b0:634:c6b9:92e4 with SMTP id bu3-20020a056a00410300b00634c6b992e4mr9647799pfb.0.1682164238054; Sat, 22 Apr 2023 04:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682164238; cv=none; d=google.com; s=arc-20160816; b=JNgcTvnS6Tze7bvF00K+q10GN80PdPb6IJUBzuPtb9eEusgfzJyayplniuiicX6mya B5r4PpYXmuOE9jo79jaMfGPeRWjgOqL9RUtkXSosLgCO9CW5gUS9ekHD7ibSP4YDMwiC vUjsf7xG4uY3f1gxaStFaJhg9wt8BSVSnr2QWSPObYlOhpSx1IU2V0koSqpPA3tDFmZY RiYkxeT7NeASHd0c1Gxo/3gV+hgC3iiIrjy7DgibEORISXdvFLnhKMWgXLY/rMUqcUgS 0QZK1TeOcU/esyf96XLDdny3mvTJAY0nZtzOe/nKqJhnGc2IGm65atYMgTCOBuq1L4RO QWUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Y9hKCZiGJTzdHH6bTMqKZ4wDLV8ZHMWepftXwHd2ktg=; b=OKqZfBfay+dYhLWj0vkPwP64X7CSFSvX0fYZ/leNus299626EJYRYXsroYJsD82vBM zuBoqbXV0Oq7JaXv/hMubOeCxKMzeqMFmUiz7Ax36sFmxQxYGd5xIWnnLzYipNhk7RKN hGenkm46lDEK/tSRVGacy9uu0f9TR9Ml3k5neMyZxeYLnU6kbNLX1z4CkUjF5vJ6HWnQ yKSPq8Kla47hLYY0xJScfUzwOSGagXfa0lQIhALiZd8gs1djb+fn0wPejrsP9v++iqvh UDhzyyZ4Go3CKjetMeBhdgZ5fvWdtjPjzNBXX+/nn6FISan9k1HRY0aOzYK0FgKS2slD sA3A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e70-20020a636949000000b00524f08e1fdbsi1994521pgc.813.2023.04.22.04.50.24; Sat, 22 Apr 2023 04:50:38 -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; 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 S229786AbjDVLta (ORCPT + 99 others); Sat, 22 Apr 2023 07:49:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229791AbjDVLtX (ORCPT ); Sat, 22 Apr 2023 07:49:23 -0400 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D3461FC8; Sat, 22 Apr 2023 04:49:05 -0700 (PDT) Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1pqBjj-00085Z-1c; Sat, 22 Apr 2023 13:49:03 +0200 Date: Sat, 22 Apr 2023 12:48:59 +0100 From: Daniel Golle To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Chen Minqiang , Chukun Pan , Yevhen Kolomeiko , Alexander Couzens Subject: [RFC PATCH net-next 5/8] net: phy: realtek: use phy_read_paged instead of open coding Message-ID: <85eb0791bd614ccfdeccdc6fe39be55e602c521c.1682163424.git.daniel@makrotopia.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,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 Instead of open coding a paged read, use the phy_read_paged function in rtlgen_supports_2_5gbps. Signed-off-by: Daniel Golle --- drivers/net/phy/realtek.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c index f97b5e49fae58..62fb965b6d338 100644 --- a/drivers/net/phy/realtek.c +++ b/drivers/net/phy/realtek.c @@ -735,9 +735,7 @@ static bool rtlgen_supports_2_5gbps(struct phy_device *phydev) { int val; - phy_write(phydev, RTL821x_PAGE_SELECT, 0xa61); - val = phy_read(phydev, 0x13); - phy_write(phydev, RTL821x_PAGE_SELECT, 0); + val = phy_read_paged(phydev, 0xa61, 0x13); return val >= 0 && val & RTL_SUPPORTS_2500FULL; } -- 2.40.0