Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5825745rwl; Tue, 11 Apr 2023 10:26:25 -0700 (PDT) X-Google-Smtp-Source: AKy350bcf0AJAeWTJg+BwXRugOCDB8X/bssEOzC2rxOWFqBF9aUUI/ylW3H3b6ZBPvYDdx8u6zOk X-Received: by 2002:a05:6a20:6d23:b0:c2:f930:45e8 with SMTP id fv35-20020a056a206d2300b000c2f93045e8mr13537451pzb.46.1681233985262; Tue, 11 Apr 2023 10:26:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681233985; cv=none; d=google.com; s=arc-20160816; b=pmWrPCPwpTd7k1LcEvzjgeNqOkmcuMhvPWi+v9FxBn2QT+Kl+IvyA/haxBVK3VVMI2 nuV/ViC7oeo4czTZ07n7f5Qrl7e3JkuvAjcHIocebrBxkJAFHdfvGo+qrqtqAzgY70TK 1/T7YtLCYcpuhosCU9DUa6lCsOqj4vyJH4Cl6SwoseejFQgTp9he7ge7eTBifk+x0nJS hO0yXEqx/14HR58EzquP4snnXKlesNBpc8oLUbBQFrM9/4cpenXGDCsZZYtG1Ny5PjXs 2n4Mikd1QXc7LxfalevtHtvXtAEt18BmCmFBAidl/puimzVi0VJgPJv8SoaKytJBCUDj R9Mw== 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; bh=nk/MQvXb+wyY69cH+KxNjJCq1/1/jVik5rH4bzGVG/Q=; b=xqz6cM1Wmh7y9NxOZuSYdY5bpg9HrdoBMqYAb+QXTcQT9m/TO+4kYWMnh3tISly7Zf irS089lRY5r3YZO2EmGkZz+VvOq60I/MweRsUAMXGBYamb8lbrJjll0DysVACWRVvO7R +1x8XG+jAWlax3dlEJtTGcuwjziWiYJJtxvvZbhTCwPtjQQX8KsRaewz3p6Ay3zVBv/S t+t6/rGHySvEw+CrYBuMmSte87OEnJ+lbSBzON7qMgrDelMzX5Ezt/Ngz8ZuPE6LNO06 pPiTqBm0wk7DpDNR2bUc61nOl9z/uegA5CP+32xgJIK8LyGrdxyPYedlfNdj9+9bdDXb cFqQ== 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 j16-20020a63e750000000b0051384f6edf2si13752651pgk.640.2023.04.11.10.26.12; Tue, 11 Apr 2023 10:26:25 -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 S230098AbjDKRZS (ORCPT + 99 others); Tue, 11 Apr 2023 13:25:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230002AbjDKRZO (ORCPT ); Tue, 11 Apr 2023 13:25:14 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 551461FD0 for ; Tue, 11 Apr 2023 10:25:12 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pmHjp-0001ym-9L; Tue, 11 Apr 2023 19:25:01 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pmHjn-00AYPv-4r; Tue, 11 Apr 2023 19:24:59 +0200 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pmHjm-00CbE7-8O; Tue, 11 Apr 2023 19:24:58 +0200 From: Oleksij Rempel To: "David S. Miller" , Andrew Lunn , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Paolo Abeni , Vladimir Oltean , Woojung Huh , Arun Ramadoss Cc: Oleksij Rempel , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com Subject: [PATCH net-next v1 1/2] net: dsa: microchip: rework ksz_prmw8 Date: Tue, 11 Apr 2023 19:24:54 +0200 Message-Id: <20230411172456.3003003-2-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230411172456.3003003-1-o.rempel@pengutronix.de> References: <20230411172456.3003003-1-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 This patch modifies the ksz_prmw8() function in the ksz_common.h file to return the error value and reuse already existing ksz_rmw8() function. Signed-off-by: Oleksij Rempel --- drivers/net/dsa/microchip/ksz_common.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h index 8abecaf6089e..69c9a19aa4c3 100644 --- a/drivers/net/dsa/microchip/ksz_common.h +++ b/drivers/net/dsa/microchip/ksz_common.h @@ -549,12 +549,11 @@ static inline int ksz_pwrite32(struct ksz_device *dev, int port, int offset, data); } -static inline void ksz_prmw8(struct ksz_device *dev, int port, int offset, +static inline int ksz_prmw8(struct ksz_device *dev, int port, int offset, u8 mask, u8 val) { - regmap_update_bits(dev->regmap[0], - dev->dev_ops->get_port_addr(port, offset), - mask, val); + return ksz_rmw8(dev, dev->dev_ops->get_port_addr(port, offset), mask, + val); } static inline void ksz_regmap_lock(void *__mtx) -- 2.39.2