From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A4E8C2BA19 for ; Mon, 13 Apr 2020 09:55:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2DAFE20731 for ; Mon, 13 Apr 2020 09:55:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IAzK1g97" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2DAFE20731 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lucaceresoli.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=It7f4jTdteJYcTzHV+g6wv6qazd4Lqqb+Wlajl7jXhk=; b=IAzK1g973sQzTD KG2gUMRA34PJhxO7KHU1/YLjg/+C6EfBjGZgbsVL7MpEn2uukZK0/WhK9ILP6/TEFU5wy66c6DOGm Shk3R0OZcpbNmuFUW+nBtvPRftyKmzym678CVywomwOIigjNTG70t4kdrHzjdQ6aJ8xcd+LAdZivK DkzQ3w6r8W49XPjjgpuF+UJjYet2ugOxdb5jGtXv1+7pW3rhY3RDaGt1iKcomq5UYmR4Geyw51x+2 QHen0A04ihKZRXqwC5uZUL+V+SKOfi15j5088yhtVM7y80Vii21vjStjnj76sugisu7dmwUW4W5vh 86bqhj1YnWgnvrOzQxlA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jNvoK-0005yY-8R; Mon, 13 Apr 2020 09:55:24 +0000 Received: from hostingweb31-40.netsons.net ([89.40.174.40]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jNvoG-0005ny-Vg for linux-i3c@lists.infradead.org; Mon, 13 Apr 2020 09:55:22 +0000 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 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-Language: en-US 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 - lists.infradead.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: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200413_025521_194864_8B06FBEB X-CRM114-Status: GOOD ( 13.35 ) X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux I3C List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jacopo Mondi , linux-kernel@vger.kernel.org, Vladimir Zapolskiy , linux-renesas-soc@vger.kernel.org, Kieran Bingham , Laurent Pinchart , =?UTF-8?Q?Niklas_S=c3=b6derlund?= , linux-i3c@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-i3c mailing list linux-i3c@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-i3c