From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.179]) (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 2848F23314C for ; Mon, 13 Jan 2025 08:06:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736755571; cv=none; b=SryCu7ejX/nV9a8Aaqmo9sVWOl3AIPRxdle6csPwaMk8ncHUrOGP9g/STXXZY1RWxBLgY5yigx1DXiBqi1uNhoyZp16p9BDT30J5h2voF+Cz7/G//7adClggESIC3x3/492xYzw7VsCRMO3JEqYMfBIAUyeexHzTcIA4HDID7hs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736755571; c=relaxed/simple; bh=ucfjlokoiM4yL/9+xtO9DJ3OgLN3x7WHiZhI+XJS0rc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=GgJq8khia9CERUSNYaKdYMjGCW8Vzt8SUSzeFb2HPyH+gG1wh06kV7qSvHbsdPghEkOu5G1Z6iScV3FnMvOGXd8O7RZKsAl62gVVMrWhcmNv58OZofG7Ct6i3Wm9j7DBbE+6mN0yUH6cTFqOiUf9Ti9FjHuXyKUdItjgU91eyac= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=X8Hz6+4Q; arc=none smtp.client-ip=91.218.175.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="X8Hz6+4Q" Message-ID: <5d97dd34-f293-4403-b605-c0ae7b5490fd@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1736755559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pcuNFQWJylkhPh7t8gonvzvwWsZ6sN4LnbhC8eusAv0=; b=X8Hz6+4QavDAiS3Ew+4O7uWu/tOuSMl4stek9qSeQKLJAusNsXpq1L88iuACDbzN77VEkg dwdnWW1K6ANumpRwxOSgxq1C3eSzvUt0qkcxWVD99BYd1ErmKtoYhWWYw2jQuObsjnhUpf UnCeBErX+lqVQJ7NUvQ5rjqnRMFbWy4= Date: Mon, 13 Jan 2025 16:05:13 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH net-next 5/5] net: stmmac: stm32: Use syscon_regmap_lookup_by_phandle_args To: Krzysztof Kozlowski , MD Danish Anwar , Roger Quadros , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, imx@lists.linux.dev References: <20250112-syscon-phandle-args-net-v1-0-3423889935f7@linaro.org> <20250112-syscon-phandle-args-net-v1-5-3423889935f7@linaro.org> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yanteng Si In-Reply-To: <20250112-syscon-phandle-args-net-v1-5-3423889935f7@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT 在 2025/1/12 21:32, Krzysztof Kozlowski 写道: > Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over > syscon_regmap_lookup_by_phandle() combined with getting the syscon > argument. Except simpler code this annotates within one line that given > phandle has arguments, so grepping for code would be easier. > > There is also no real benefit in printing errors on missing syscon > argument, because this is done just too late: runtime check on > static/build-time data. Dtschema and Devicetree bindings offer the > static/build-time check for this already. > > Signed-off-by: Krzysztof Kozlowski > --- > drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c > index 1e8bac665cc9bc95c3aa96e87a8e95d9c63ba8e1..1fcb74e9e3ffacdc7581b267febb55d015a83aed 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c > @@ -419,16 +419,11 @@ static int stm32_dwmac_parse_data(struct stm32_dwmac *dwmac, > } > > /* Get mode register */ > - dwmac->regmap = syscon_regmap_lookup_by_phandle(np, "st,syscon"); > + dwmac->regmap = syscon_regmap_lookup_by_phandle_args(np, "st,syscon", > + 1, &dwmac->mode_reg); The network subsystem still requires that the length of each line of code should not exceed 80 characters. So, let's silence the warning: WARNING: line length of 83 exceeds 80 columns #33: FILE: drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c:307: + &dwmac->intf_reg_off); BTW, The other two stmmac patches also need to adjust the code so that each line doesn't exceed 80 characters. Thanks, Yanteng