Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1280652pxb; Fri, 22 Jan 2021 11:21:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJyeR4L8sy9x5rZvcNfKzm7irsvKzpfZXes7hRAxLeSATpHqoAXTZd/DmBCOt5IVHL7xNBVI X-Received: by 2002:aa7:cb10:: with SMTP id s16mr534835edt.304.1611343289979; Fri, 22 Jan 2021 11:21:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611343289; cv=none; d=google.com; s=arc-20160816; b=06Zc4WphNK3lhBdkxIX8hCa6GKYfpi3eV7x0ADlfm3AorhbLNYdxoxsvcCmJpeDlr3 2zd6R3vltoB3tOrl2rY2hDuSL8ySjNo0rDYOn2cJAfydByLJh0/ZC9wFbeB6an3/YlDD 6dOa4rb/BQOMdCL4dC4FIryymPeoGox8qiPHHfd+O12c7flGpMZeenccgLwTNn2mKUiO CFsymSjmyXzi8RCXnKPXHkV/06gED2zG42hZd9ESPbCZuYJW3DoGFKyaK3O0Id935x2P KOyaim8e0a3XOVqwwvOWmLWh84zsQXgr3S0nay8VafJpKazuBBQDxPGRv8i8kKSzwRHI K8dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=V/EFH6Ql65NSSTaEnUgoWWm4SDFIF3z/84dTt3kf2To=; b=bgIY7TrouaVxfWL0t297OEnvfA00QL5yfmtprDm+THpVv84CdnNaZzANFKkOAjUo0l zkH9jdHYRsqg/WvndXgl3MMSwNwduhFCJY2gjxmiKMTEUcDKcOy9o7Kl2/5kocCiVe7M 16BRJikVZ07P0lNime1tS30vgHql/MVS9lULNksgSVPNsiizwwysshYWCpC5fLrv96Hm XL9FeD+gHxnmSZc2AmGN9RZnuOATRP8Hjt+Ex9TOn82Mq4JX7RGuIv0cjvDO4C6NZeA7 PqjuoH2KFMBwvOytahDxjdW33fwTlcUx6VjhVmrCZMw16WxVHw/UGNZVGVVGsJvYxbIR lscg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j15si3989349edw.310.2021.01.22.11.21.05; Fri, 22 Jan 2021 11:21:29 -0800 (PST) Received-SPF: pass (google.com: 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: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729624AbhAVSms (ORCPT + 99 others); Fri, 22 Jan 2021 13:42:48 -0500 Received: from mail-ot1-f51.google.com ([209.85.210.51]:36049 "EHLO mail-ot1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729674AbhAVSWg (ORCPT ); Fri, 22 Jan 2021 13:22:36 -0500 Received: by mail-ot1-f51.google.com with SMTP id v21so5993741otj.3; Fri, 22 Jan 2021 10:22:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=V/EFH6Ql65NSSTaEnUgoWWm4SDFIF3z/84dTt3kf2To=; b=N9d+8dg3mPcCMaYquRiCE23GTgyP/Qdg116Qc46dHvUxbWaiH16JgwOSktclGitwuH 8YCRqPgMmUHymNjKa9Br8CUcoxPz5wb+u44JqSfYChLjo1TbuHG9C5atbSCWwOq8s41d w3FM0SoKDENuvlLqX6mCH7bNModBQt01GoyW6bBZe040O+8Qs4GKIAKe9dmqYrPgmfgV sezJ58Ifje7haOJN6GsUyLD13hVk2U5hqwl+1ygSKyk3mykOhaL+Ptd28+SQrBz9CAL1 WmEkiW8TsyLB7iYAxGsOfqppLfl0K0lJ5VEl+JoGLCf/7AFnEH8VjU+D23QJ/yprdB/V y/Ng== X-Gm-Message-State: AOAM533Izbtbx6aPle8vDCSSO8O5MDEuclFLT3hsoEwk34jd2KeL4w9t XkcN1aGRw8UWJjYwwOd027LVvMoyn0c5BjojfPQ= X-Received: by 2002:a9d:1710:: with SMTP id i16mr4274123ota.260.1611339715790; Fri, 22 Jan 2021 10:21:55 -0800 (PST) MIME-Version: 1.0 References: <20210122154300.7628-1-calvin.johnson@oss.nxp.com> <20210122154300.7628-10-calvin.johnson@oss.nxp.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Fri, 22 Jan 2021 19:21:44 +0100 Message-ID: Subject: Re: [net-next PATCH v4 09/15] device property: Introduce fwnode_get_id() To: Andy Shevchenko Cc: Calvin Johnson , Grant Likely , Jeremy Linton , Andrew Lunn , Florian Fainelli , Russell King - ARM Linux admin , Cristi Sovaiala , Florin Laurentiu Chiculita , Ioana Ciornei , Madalin Bucur , Heikki Krogerus , Marcin Wojtas , Pieter Jansen Van Vuuren , Jon , Saravana Kannan , Randy Dunlap , "linux.cj" , Diana Madalina Craciun , ACPI Devel Maling List , Linux ARM , Linux Kernel Mailing List , netdev , Laurentiu Tudor , Bartosz Golaszewski , Greg Kroah-Hartman , Kieran Bingham , Laurent Pinchart Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 22, 2021 at 7:11 PM Rafael J. Wysocki wrote: > > On Fri, Jan 22, 2021 at 6:12 PM Andy Shevchenko > wrote: > > > > On Fri, Jan 22, 2021 at 05:40:41PM +0100, Rafael J. Wysocki wrote: > > > On Fri, Jan 22, 2021 at 4:46 PM Calvin Johnson > > > wrote: > > > > > > > > Using fwnode_get_id(), get the reg property value for DT node > > > > or get the _ADR object value for ACPI node. > > > > > > So I'm not really sure if this is going to be generically useful. > > > > > > First of all, the meaning of the _ADR return value is specific to a > > > given bus type (e.g. the PCI encoding of it is different from the I2C > > > encoding of it) and it just happens to be matching the definition of > > > the "reg" property for this particular binding. > > > > > IOW, not everyone may expect the "reg" property and the _ADR return > > > value to have the same encoding and belong to the same set of values, > > > > I have counted three or even four attempts to open code exact this scenario > > in the past couple of years. And I have no idea where to put a common base for > > them so they will not duplicate this in each case. > > In that case it makes sense to have it in the core, but calling the > _ADR return value an "id" generically is a stretch to put it lightly. > > It may be better to call the function something like > fwnode_get_local_bus_id() Or fwnode_get_local_address() for that matter.