Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp4363424ybh; Tue, 6 Aug 2019 10:21:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjz548OgoBKjuKIRVQeH+VyAZImNp0lPycivXOD8WAX0sltIqx7WyrrzHBrboHxblPESyh X-Received: by 2002:a17:90a:2190:: with SMTP id q16mr4126229pjc.23.1565112088986; Tue, 06 Aug 2019 10:21:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565112088; cv=none; d=google.com; s=arc-20160816; b=Ol+wJkdfTZ7Lh6gOzc0L+zf5WroZE6AJ5m5/pxNf9RyzlY8uu5P3HcK1iQELYYIP8Y QGTvY2Gd9YKVrhiJcLJ17B04ukMEdt8Z/2I0xrmD1GctduijnjpQkHanQIIHj3QB2ZJM gFg2wubaf11Uf0yl9RvJiVHet115OuE0xXloyeznO6XLlIEAnV158NHWkYxM/a3OXDdq 7xU3HoDoqi3CyDVcCtc/fISnIiRf+3tOIym4An4av1sOyZpPZy9SyJi5ZFH6LxnrNL80 fmwZN24glDL6QT/vxax4jx4JrBpIRkFLT5tpqT7MhW5MQJ58HfxTSZtJYg/EnkVS4TG7 NK/g== 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=5pt7GwViJVcu98WqISKhm+O7h6/+k0pCneC7dXHoksE=; b=j+ujU+KfqnkhzK5PNfAYMTUaOOtNF6XCAACUpfWHujTBNhiumiK5tsqSFGp6/9VqFv BG+fWIErFR3tCUWNYf2ZGWzayU1vpNSqEL3Mj9pvCLFWBfzQKRNIkCydLFbaMyMnkQFL MFW1VcCtXHtertP67iG7QGS/YdgcEjM9T6oMWpiMFhv0OLFZ3g8vxLrwr8ko3NAoevKL J6884a8Jx9MzIXLjtGk0hYUp3TVba7wvx6awWXSANJW3KOgtsuKMBmVMn0q3vdCf7c29 16+ZcBKiYWkSqgDBapHk47dognmEf7qgEa1tPhUIFJbx8gy2wcBt+G1O7qn8jM/9BGCs FySQ== 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 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si14959711plf.410.2019.08.06.10.21.12; Tue, 06 Aug 2019 10:21:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732538AbfHFRMc (ORCPT + 99 others); Tue, 6 Aug 2019 13:12:32 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38719 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728189AbfHFRMb (ORCPT ); Tue, 6 Aug 2019 13:12:31 -0400 Received: by mail-wr1-f66.google.com with SMTP id g17so88647122wrr.5 for ; Tue, 06 Aug 2019 10:12:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5pt7GwViJVcu98WqISKhm+O7h6/+k0pCneC7dXHoksE=; b=eTsJQuTxednVUcxa7b0FpMbtBdOYOhO9LIVud9iig9imJcCOtluHQzgEMZzZgUEI6N xwKmJJQk/mZIjpzXOiHq0TkDCLPhn5Ts6iV1fNQ8ZeBC06MdLKhUnjUTlw1gsRQrIVMN 61zowasVLBSooSjwUwcyrByQNNEXMjyPWBQTVP3rRPp4EDOW3+RpvObq69Uf3BFQd8Bw H6VqPP+msUlEN4qbVwSQA/K29PT0wqiVWbCjfokx5+5jb7B9wZtbANtZ2VrHODXZTq+O Ojnocoib8Fegm0muJo+GVVeJuTUqILLxd2sH6c0Ow+8wogl8idI/cuZxP/l3dGToF9Ct SaFg== X-Gm-Message-State: APjAAAUBRLmS3Bf0G0qopkNG3z/ghJSgI9KTtW9KRIHR/DRIpr9UpTib DAq5ORjxHbEWdLYzCVaeJ/DJ5A== X-Received: by 2002:a5d:6287:: with SMTP id k7mr5550570wru.108.1565111549697; Tue, 06 Aug 2019 10:12:29 -0700 (PDT) Received: from [192.168.0.24] ([181.120.177.224]) by smtp.gmail.com with ESMTPSA id h16sm103858378wrv.88.2019.08.06.10.12.24 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 06 Aug 2019 10:12:29 -0700 (PDT) Subject: Re: [PATCH RFC] modpost: Support I2C Aliases from OF tables To: Geert Uytterhoeven Cc: Wolfram Sang , Kieran Bingham , Masahiro Yamada , Michal Marek , linux-kbuild , open list , Linux-Renesas , Lee Jones , Alexandre Belloni , Andy Shevchenko , Mark Brown References: <20190710193918.31135-1-kieran.bingham+renesas@ideasonboard.com> <0e1b6e0b-1c94-4b00-7fda-c2a303ee3816@redhat.com> <20190731194419.GB4084@kunai> From: Javier Martinez Canillas Message-ID: <51451f89-9193-2be6-e724-e9ca44a25f52@redhat.com> Date: Tue, 6 Aug 2019 19:12:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Geert, On 8/6/19 9:22 AM, Geert Uytterhoeven wrote: > Hi Javier, > > On Tue, Aug 6, 2019 at 12:25 AM Javier Martinez Canillas > wrote: >> On 7/31/19 9:44 PM, Wolfram Sang wrote: >>> Hi Javier, >>>> The other option is to remove i2c_of_match_device() and don't make OF match >>>> to fallback to i2c_of_match_device_sysfs(). This is what happens in the ACPI >>>> case, since i2c_device_match() just calls acpi_driver_match_device() directly >>>> and doesn't have a wrapper function that fallbacks to sysfs matching. >>>> >>>> In this case an I2C device ID table would be required if the devices have to >>>> be instantiated through sysfs. That way the I2C table would be used both for >>>> auto-loading and also to match the device when it doesn't have an of_node. >>> >>> That would probably mean that only a minority of drivers will not add an I2C >>> device ID table because it is easy to add an you get the sysfs feature? >>> >> >> I believe so yes. > >> As Masahiro-san mentioned, this approach will still require to add a new macro >> MODULE_DEVICE_TABLE(i2c_of, bar_of_match) so the OF device table is used twice. >> >> One to expose the "of:N*T*Cfoo,bar" and another one to expose it as "i2c:bar". >> >> I expect that many developers would miss adding this macro for new drivers that >> are DT-only and so sysfs instantiation would not work there. So whatever is the >> approach taken we should clearly document all this so drivers authors are aware. > > You could add a new I2C_MODULE_DEVICE_TABLE() that adds both, right? > Makes it a little bit easier to check/enforce this. > Right, we could add a macro for that. Although it should probably be called I2C_OF_MODULE_DEVICE_TABLE() or something like that since is specific to OF. > Gr{oetje,eeting}s, > > Geert > Best regards, -- Javier Martinez Canillas Software Engineer - Desktop Hardware Enablement Red Hat