linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javier@osg.samsung.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Wolfram Sang <wsa@the-dreams.de>,
	linux-i2c@vger.kernel.org
Subject: Re: [PATCH 4/4] eeprom: at24: Add OF device ID table
Date: Tue, 14 Mar 2017 21:15:39 -0300	[thread overview]
Message-ID: <8e233f15-4f91-b495-5270-5a7f982b31be@osg.samsung.com> (raw)
In-Reply-To: <CAHp75Vf5=E37Ccrc2zMo8xOWmA-A_FZL7d57q7Rxk07M-V5mhg@mail.gmail.com>

Hello Andy,

On 03/14/2017 07:59 PM, Andy Shevchenko wrote:
> On Tue, Mar 14, 2017 at 5:16 PM, Javier Martinez Canillas
> <javier@osg.samsung.com> wrote:
>> The driver doesn't have a struct of_device_id table but supported devices
>> are registered via Device Trees. This is working on the assumption that a
>> I2C device registered via OF will always match a legacy I2C device ID and
>> that the MODALIAS reported will always be of the form i2c:<device>.
>>
>> But this could change in the future so the correct approach is to have an
>> OF device ID table if the devices are registered via OF.
> 
> I'm bot sure this patch does something useful right now. Can we
> survive without it? I think we may.
> 

Yes, we can survive without it for now. But the problem is that with current
I2C core, DT-only I2C drivers must have an I2C device table in order to have
module auto-load working. That's because the core always reports as modalias
i2c:<foo> regardless if the device was registered via DT or legacy mechanism.

And some maintainers don't accept patches doing this duplication and instead
ask for the core to be fixed, i.e [0]. But to make sure that fixing the core
won't add regressions in drivers that are relying in the current behavior,
patches like $SUBJECT are needed.

So there isn't an agreement if is better to just rely in the current behavior
(and have a superfluous I2C device ID table) or fix the I2C core (and need a
OF device ID table). I personally prefer the latter since that means that an
DT-only driver will only need a OF table, and only drivers that supports both
will need both tables.

>>  drivers/misc/eeprom/at24.c | 189 ++++++++++++++++++++++++++++++++++++++++++++-
>>  1 file changed, 188 insertions(+), 1 deletion(-)
> 
> It's a huge! It will increase not only driver code base but memory
> footprint for almost no benefit.
>

Indeed, but these all are compatible strings used by DTS in mainline and so
should be in the OF device ID table in order to be matched and the proper
modalias reported (once the I2C core is fixed).

One option is to add #ifdef CONFIG_OF guards for the OF device table definition
but again there's no agreement on that one since some maintainers say the it is
better to always build the OF ID table than having #ifdefery in C code...

[0]: https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1321026.html

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America

  reply	other threads:[~2017-03-15  0:15 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-14 15:16 [PATCH 0/4] misc: Add OF device table to I2C drivers that are missing it Javier Martinez Canillas
2017-03-14 15:16 ` [PATCH 1/4] misc: tsl2550: Add OF device ID table Javier Martinez Canillas
2017-03-14 20:53   ` Arnd Bergmann
2017-03-14 15:16 ` [PATCH 2/4] misc: ds1682: " Javier Martinez Canillas
2017-03-14 20:46   ` Arnd Bergmann
2017-03-15  0:38     ` Javier Martinez Canillas
2017-03-15  3:26       ` Javier Martinez Canillas
2017-03-14 15:16 ` [PATCH 3/4] eeprom: idt_89hpesx: " Javier Martinez Canillas
2017-03-14 15:16 ` [PATCH 4/4] eeprom: at24: " Javier Martinez Canillas
2017-03-14 22:59   ` Andy Shevchenko
2017-03-15  0:15     ` Javier Martinez Canillas [this message]
2017-03-15  7:58       ` Wolfram Sang
2017-03-15 10:58         ` Javier Martinez Canillas
2017-03-15 11:21           ` Andy Shevchenko
2017-03-15 11:39             ` Javier Martinez Canillas
2017-03-15 22:43               ` Andy Shevchenko
2017-03-16 12:28                 ` Javier Martinez Canillas
2017-03-16 13:07           ` Wolfram Sang
2017-03-16 13:13             ` Javier Martinez Canillas
2017-03-16 13:36               ` Wolfram Sang
2017-03-16 14:07                 ` Javier Martinez Canillas
2017-03-16 15:05                   ` Wolfram Sang
2017-03-16 15:39                     ` Javier Martinez Canillas
2017-03-20 16:45                       ` Javier Martinez Canillas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e233f15-4f91-b495-5270-5a7f982b31be@osg.samsung.com \
    --to=javier@osg.samsung.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).