From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9644017C61; Mon, 28 Oct 2024 12:15:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730117754; cv=none; b=GYhePQWtxL4iVlCBoDeex/dBkLsSYzoOC1CQJnMoN4xEUzvU4e6rgonz6DeBBREhRpVW8FUtm9BCqreJwRrG9TdFRuAzzvMhDWJz3T8HYY7hIC4wcVF+nXw2EnIDtSt7fsWqvgF0N6z9fKI587KuKzVfrOZ03/hRfB63EsBEev4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730117754; c=relaxed/simple; bh=O2LI6GeA7bzWum/HwFra02rf1RZdoj9wHSd/1i5tG8w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VF35owyp/xw0OSxvFOMUryWIqNkvDOG7qxTHuZTX+AJx27WX2+Hk4sc7x1o6iGN70SuWqJPDfJg2aoinu+saD7NG9O0Aee0Rtl3cpk0MfJCVyYrWtgYtM7J5MTPBhfPVNUpxwfFZnBPQyy1ijlPnjWrrzpRu2UYOcBH5V+XRXAs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=1UgOiFca; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="1UgOiFca" 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=bc8wK16jbYKvsClA+UMWH5S2LIjpv7VI3qWUGCUGwD8=; b=1UgOiFcajg15LCQ9mREvnXk7um jD03OyPm5yFSJMy/zMRL3kLI1y3VOtTs7z5vyByxQHBP9LsKfePnpOGcrIUbuCptIQ/o4VwbYwEhc NeynBQZTwLaqdKhIWL9INlT7DBNpkhPoYffOHAfxTYsSvjMYc95iRbNWiOxgQW2bAju0=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1t5Oes-00BRTp-1E; Mon, 28 Oct 2024 13:15:42 +0100 Date: Mon, 28 Oct 2024 13:15:42 +0100 From: Andrew Lunn To: Oleksij Rempel Cc: "David S. Miller" , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Paolo Abeni , Vladimir Oltean , Woojung Huh , Arun Ramadoss , Conor Dooley , Krzysztof Kozlowski , Rob Herring , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com, "Russell King (Oracle)" , devicetree@vger.kernel.org Subject: Re: [PATCH net-next v1 5/5] net: dsa: microchip: add support for side MDIO interface in LAN937x Message-ID: <20c0ed0f-712d-46d4-8a49-e92835f47f9e@lunn.ch> References: <20241026063538.2506143-1-o.rempel@pengutronix.de> <20241026063538.2506143-6-o.rempel@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241026063538.2506143-6-o.rempel@pengutronix.de> > +static const u8 lan9370_phy_addr[] = { > + [0] = 2, /* Port 1, T1 AFE0 */ > + [1] = 3, /* Port 2, T1 AFE1 */ > + [2] = 5, /* Port 3, T1 AFE3 */ > + [3] = 6, /* Port 4, T1 AFE4 */ > + [4] = U8_MAX, /* Port 5, RGMII 2 */ > +}; I think it would be good to add a #define for U8_MAX which gives a hint at its meaning. > + for (i = 0; i < dev->info->port_cnt; i++) { > + if (phy_addr_map[i] == U8_MAX) > + dev->phy_addr_map[i] = phy_addr_map[i]; > + else > + dev->phy_addr_map[i] = phy_addr_map[i] + offset; > + } My first guess was that U8_MAX means the PHY is external, so could be on any address depending on strapping. Looking at this code, i'm not sure it does actually mean that. Andrew --- pw-bot: cr