Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3252134ybb; Mon, 13 Apr 2020 04:10:23 -0700 (PDT) X-Google-Smtp-Source: APiQypIXh0QQf59QCSkq7wn0T7THUkL45bK+E+xRmRAx2zfsfNzB/jvFhisGYDqu+PYdwGu6B3Qc X-Received: by 2002:aa7:c309:: with SMTP id l9mr11979100edq.6.1586776223603; Mon, 13 Apr 2020 04:10:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586776223; cv=none; d=google.com; s=arc-20160816; b=ya78gvYX9NgT0w/49R8rpVasAGb7pFmaSkH3nceYRDL0d7M1tTORAAE6OOj1zqNRgn sZF0rgx/165Ub158XyaXBzV/gI7kb+OO53CWoN38xmSccFegKIEJcXUKe3/++Arr9vTh ZVpdB6vJABYANlZG66/XGuexri6Rl70k7VyBPqC73mO5UwaQz97tgcNhlb/fwUg5yJk8 hXmAyBpZPOFPhVV2X/tI2hBz+G7U/6BWJyx3hT0azXyjsyIoT2lAnKhUl9RrIh/C0yDv vsHz5yaRr7VQTbcAhM5IEm7sEFeMeEeFVbZwWft9WpTHtGMqt97UQK1remnPdzH1zPNv eBnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=49srz2nh2HMzJ18vctV5Rl0rvpsSZf9ivXDFfCzIADU=; b=OTYju9W+xTLgIukm8CjjaMMG95dRDUupLfNV4sifp/xNnqUYgbx3V06HeeG1JKPJrC wJ24eVLX+K3X74a+5/XiUX56CAJbC7ZuN8FPz1ziHUJCWTxKUO1YaoRgxNaYeDLyecku kIB/A0ybYP5HrFLBtYar54qej7NW0yTcjQvralnIHTjMOQDENQ83FcjZzDSncVoIS2ya t7iCx/kpjZ732+yGzrBDhmYfJs2REkBLvyCEnyAuQptzs4VKROGdN73wFPkbn5fQGJJ8 jH/NgI1/cfgL/zUDDNNWHVUUpZ5F+AEvwM1++UTmhOodUTzRL8ok5w0G7xljwmUL7CFR sBaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w28si6214783edl.601.2020.04.13.04.09.47; Mon, 13 Apr 2020 04:10:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728487AbgDMJzU (ORCPT + 99 others); Mon, 13 Apr 2020 05:55:20 -0400 Received: from hostingweb31-40.netsons.net ([89.40.174.40]:42414 "EHLO hostingweb31-40.netsons.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727793AbgDMJzT (ORCPT ); Mon, 13 Apr 2020 05:55:19 -0400 Received: from [5.157.111.77] (port=45414 helo=[192.168.77.66]) by hostingweb31.netsons.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1jNvo9-00A9CE-It; Mon, 13 Apr 2020 11:55:13 +0200 Subject: Re: [RFC PATCH v2 5/6] i2c: of: mark a whole array of regs as reserved To: Wolfram Sang , linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, linux-i3c@lists.infradead.org, Kieran Bingham , =?UTF-8?Q?Niklas_S=c3=b6derlund?= , Jacopo Mondi , Laurent Pinchart , Vladimir Zapolskiy , linux-kernel@vger.kernel.org References: <20200318150059.21714-1-wsa+renesas@sang-engineering.com> <20200318150059.21714-6-wsa+renesas@sang-engineering.com> From: Luca Ceresoli Message-ID: Date: Mon, 13 Apr 2020 11:55:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200318150059.21714-6-wsa+renesas@sang-engineering.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hostingweb31.netsons.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lucaceresoli.net X-Get-Message-Sender-Via: hostingweb31.netsons.net: authenticated_id: luca@lucaceresoli.net X-Authenticated-Sender: hostingweb31.netsons.net: luca@lucaceresoli.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 18/03/20 16:00, Wolfram Sang wrote: > Back then, 'reg' properties in I2C DT bindings only contained one > address and this address was assigned a device and, thus, blocked. > Meanwhile, chips using multiple addresses are common and the 'reg' > property can be an array described by 'reg-names'. This code enhances > I2C DT parsing, so it will reserve all addresses described in an array. > They will be bound to the 'dummy' driver as 'reserved' iff the first > address can be assigned successfully. If that is not the case, the array > is not further considered. If one later address of the array can not be > assigned, it will be reported but we don't bail out. The driver has to > decide if that address is critical or not. > > Signed-off-by: Wolfram Sang > --- > drivers/i2c/i2c-core-of.c | 70 +++++++++++++++++++++++++-------------- > 1 file changed, 46 insertions(+), 24 deletions(-) > > diff --git a/drivers/i2c/i2c-core-of.c b/drivers/i2c/i2c-core-of.c > index f2d09ea0d336..67eb2cd305cf 100644 > --- a/drivers/i2c/i2c-core-of.c > +++ b/drivers/i2c/i2c-core-of.c > @@ -16,25 +16,18 @@ > #include > #include > #include > +#include > #include > #include > > #include "i2c-core.h" > > -int of_i2c_get_board_info(struct device_node *node, struct i2c_board_info *info) > +static void of_i2c_decode_board_info(struct device_node *node, u32 addr, > + bool first_addr, struct i2c_board_info *info) While I confirm the patch looks generally OK, let me add the name of this function is not quite self-explaining. The difference between "get" and "decode" has nothing to do with the different actions these functions do, i.e. the new function gets (or: decodes) info about a single address that is passed, the old "get" function gets the info for the first address. I'd suggest the new function be named of_i2c_get_board_info_one_addr or similar. Not super nice, a bit long, but self-explanatory. -- Luca