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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 BB352C31E40 for ; Tue, 6 Aug 2019 07:22:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9889D20665 for ; Tue, 6 Aug 2019 07:22:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731867AbfHFHWv (ORCPT ); Tue, 6 Aug 2019 03:22:51 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:44668 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731735AbfHFHWv (ORCPT ); Tue, 6 Aug 2019 03:22:51 -0400 Received: by mail-ot1-f65.google.com with SMTP id b7so39926692otl.11; Tue, 06 Aug 2019 00:22:50 -0700 (PDT) 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=thaFZP7CFw87PdGBAS/x5P7euY9O7a6MADouBJzdobA=; b=Fb+zwMYtYvsQMRaFQG2I9Nj3NTNqArMnK+39/JMMzxOnKoKWeQU/zqBwYQ6XjhWWzo kAzmpClBPLzW/vfpUn1Bvjw9OG2uyeeOaxsvdbHfGotwphxYCjSdT9te+216Rt+CX/EW h7yBEJ65QplQfT3eFDCR2lZJILlTImAE32xEuM/u4rgsqPcDfdWWnAypPyQ41MIne2f7 Vg9LAfegda8+VsyxSYiIYQIqXlXNqxpugG1bVhQ2twVjIq6/k6LUYVWjbFsQT/36GNYq cJf6hnY/BHzO5Vab5dega+E9NdvZF8+ospRn4vNf3/GlCppIYuAL8RRPbkP9tSq3loHu 1ivg== X-Gm-Message-State: APjAAAUdM5BhoJ3d7FRCf4oWKcY3sMz8lsH2Kned0ZP816msxX9HXR1b 14wc3Au4HHzbC1qlbuH8nVzauTTXfq+APqcRL88= X-Google-Smtp-Source: APXvYqw0qhnYdCkCrJv4CVIkE6TUfK9Pkw2Y8ea4/DHFvGNdwc0gdv51OB9qMX+Fu5ypV74krTuV4kZlkx8+LHxm2Hc= X-Received: by 2002:a9d:5c11:: with SMTP id o17mr1687245otk.107.1565076170034; Tue, 06 Aug 2019 00:22:50 -0700 (PDT) MIME-Version: 1.0 References: <20190710193918.31135-1-kieran.bingham+renesas@ideasonboard.com> <0e1b6e0b-1c94-4b00-7fda-c2a303ee3816@redhat.com> <20190731194419.GB4084@kunai> In-Reply-To: From: Geert Uytterhoeven Date: Tue, 6 Aug 2019 09:22:39 +0200 Message-ID: Subject: Re: [PATCH RFC] modpost: Support I2C Aliases from OF tables To: Javier Martinez Canillas Cc: Wolfram Sang , Kieran Bingham , Masahiro Yamada , Michal Marek , linux-kbuild , open list , Linux-Renesas , Lee Jones , Alexandre Belloni , Andy Shevchenko , Mark Brown Content-Type: text/plain; charset="UTF-8" Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org 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. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds