Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp883994rwl; Wed, 29 Mar 2023 09:37:48 -0700 (PDT) X-Google-Smtp-Source: AK7set9eHWIjpz+CRl/Z8E9xWSGW+jA8jiK2iMpLcIj7IXB+szsDv2mYztpU7+zQ4peMEs12OK8c X-Received: by 2002:a05:6a20:2d83:b0:d9:7e82:6cf1 with SMTP id bf3-20020a056a202d8300b000d97e826cf1mr15725450pzb.48.1680107867829; Wed, 29 Mar 2023 09:37:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680107867; cv=none; d=google.com; s=arc-20160816; b=u8l4dZcYjQlKIXV+mgEIAM44R4Ue4JIBYqN6yjvQJnHAFZe8tmOyA2mUnITEjWhOB2 ii0xNnDFXwctlBdjlQBNx8UWz6+hl8cfMi9vMuH6OI3v5QdaAwRdS75vxXUsZLjDLfwi p7mvez+VvAkAnSn0RilU0VTDtFg0gEkBDw9C+31Xje9bfRO6RRl5+0fyIh0pebVSiBQD lcVPFMrhitp/uvrVlM9Vr9OujMstoSswKMFpgz8Lp4KBDxOFSBQuV2acPF9IX/Xv+rkK epfDuqgl/qYq9FjvHt/BilzLzzORLSU50ySPfmgb6xjeJpYcBk4fPy3EmDzRTTty2/FP 4U+g== 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:dkim-signature; bh=tWoMYM5phXzU4e6j6m4FzuuaA8OIJOcaPtVysKi+Wi8=; b=BSGMlDls+cCtIuT1U1KdOsn0WwRQj6TZ2aZmdUNJqq/WUWDNI7jwclolEB+VJi2KVK cnKjZCd/RtFA1tA+fMfNoYoD8Fd4BZm1mm9I3H7i7LKMrVlSu82deR5IPIao2LCpP2J1 Hfj+syNn9EVFK0XRvvBZOr3dGua4Bf2DeVYvdM5290oXrFJLlSpCTrggFg7qGlWZKyx/ qIUMtICvZl6+PtS/ESuo82JyzEbU6pzYPac+lRpQJ5nW0zX00dvNOuDXFQZ7j03Bo+Ef 0a9eMC+vrmllI7oqPAf9dYTrj5Vj2Je7Fv56eFTz1P3FpysKZrBOGVcs/soYiWoSPsMX 5jTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=rPqbIHYB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g4-20020a63e604000000b005133c334fe4si10254057pgh.25.2023.03.29.09.37.35; Wed, 29 Mar 2023 09:37:47 -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=@lunn.ch header.s=20171124 header.b=rPqbIHYB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229861AbjC2QYp (ORCPT + 99 others); Wed, 29 Mar 2023 12:24:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229864AbjC2QYm (ORCPT ); Wed, 29 Mar 2023 12:24:42 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 920016585; Wed, 29 Mar 2023 09:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=tWoMYM5phXzU4e6j6m4FzuuaA8OIJOcaPtVysKi+Wi8=; b=rPqbIHYBvr2qKuT39QG9t5A+nh LoVA9JPJ+af+lEKf3Li6mLRQwqPkod6xDzzeshmBBlBmvIForigitzR7gUYxDOQ5P1qvuY9Zh8cwk 7dZxlfaeOErWT8apIofVUuuNZPCnoqFGvQkhS4OyjgWVbMLlVrX/UtUt9vlNsPPJyvzM=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1phYaz-008mSg-0a; Wed, 29 Mar 2023 18:24:21 +0200 Date: Wed, 29 Mar 2023 18:24:21 +0200 From: Andrew Lunn To: Daniel Golle Cc: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Sean Wang , Landen Chao , DENG Qingfang , Philipp Zabel , Sam Shih , Lorenzo Bianconi , John Crispin , Felix Fietkau Subject: Re: [RFC PATCH net-next v3 03/15] net: dsa: mt7530: use regmap to access switch register space Message-ID: <7eb07ed2-2b1c-44fa-b029-0ecad7872fd2@lunn.ch> References: <754322262cd754aee5916954b8e651989b229a09.1680105013.git.daniel@makrotopia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <754322262cd754aee5916954b8e651989b229a09.1680105013.git.daniel@makrotopia.org> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,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 Thanks for splitting this patchset up. This is much easier to review. > +static u32 > +mt7530_mii_read(struct mt7530_priv *priv, u32 reg) > +{ > + int ret; > + u32 val; > + > + ret = regmap_read(priv->regmap, reg, &val); > + if (ret) { > + dev_err(priv->dev, > + "failed to read mt7530 register\n"); > + return ret; This is a u32 function. ret should be negative on error, which is going to be turned positive in order to return a u32. So you probably want to make this an int function. Andrew