Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1237743

Re: [RESEND PATCH v4 0/8] i2c: Relax mandatory I2C ID table passing

From Kieran Bingham <kieranbingham@gmail.com>
Newsgroups linux.kernel
Subject Re: [RESEND PATCH v4 0/8] i2c: Relax mandatory I2C ID table passing
Date 2015-10-01 23:20 +0200
Message-ID <qeTqF-87V-3@gated-at.bofh.it> (permalink)
References (1 earlier) <q9JBD-80u-1@gated-at.bofh.it> <qaEgy-5MM-13@gated-at.bofh.it> <qc9ih-4Qq-3@gated-at.bofh.it> <qci2e-rV-15@gated-at.bofh.it> <qeT7m-7th-41@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Wolfram,

On 1 October 2015 at 21:50, Wolfram Sang <wsa@the-dreams.de> wrote:
>
>> > Yes but that is not true for drivers that support both OF and legacy board
>> > files. For those drivers, there will be a lot of boiler plate code duplicated
>> > that would look something like:
>> >
>> >      unsigned long data;
>> >      struct of_device_id *match;
>> >      struct i2c_devicd_id *id;
>> >
>> >      if (i2c->dev.of_node) {
>> >             match = i2c_of_match_device(of_match_table, i2c);
>> >         if (!match)
>> >                return -EINVAL;
>> >
>> >             data = (unsigned long)match->data;
>> >      } else {
>> >             id = i2c_match_id(id_table, i2c);
>> >         if (!id)
>> >                return -EINVAL;
>> >
>> >             data = id->driver_data;
>> >      }
>
> I said this before: It is not only the additional code, I think it is
> quite unelegant to to do the matching again which has already been done.
> (and DT boottime has already increased, partly due to the excessive
> string matching). Also, I wouldn't like to see an I2C specific solution;
> this problem exists for other subsystems, too.
>
>> I'm fine with a new API for this stuff.  I'm even happy to go ahead
>> and code it up, but it's important to note that this is work which
>> should be based on this set and not a blocker for this set to be
>> accepted.
>
> Is that a promise? :)

Well if Lee doesn't, then I'll be trying to take it on.
I've already written an spatch to help with the conversion of other
drivers to follow on for this series.

Between us I think we've got motivation to make progress.

>> The correct approach is the former.  One of the aims of this set was
>> to bring the I2C .probe() call-back more into line with the majority
>> of the other .probe() calls in the kernel i.e. with only a single
>> parameter.  I'm really not a fan of passing some random void pointer
>
> Yes, I like this about this series.
>
>> in.  Using a look-up call to fetch ACPI/OF/I2C/etc data is the current
>> norm and is a very viable option.
>
> It is the status quo, but that doesn't make it better IMO.
>
>> Wolfram, please (finally :D) take this set.
>
> I tend to give in ;) Maybe we can talk in Dublin a bit about a possible
> next step after this series?

I don't think Lee is coming to Dublin, but I'll be there all week, if
you find time for a chat.
I'll look out for you in the hallway track, or at least on stage for
the final ELCE games :)

>
> Thanks,
>
>    Wolfram
>

--
Regards

Kieran
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [RESEND PATCH v4 0/8] i2c: Relax mandatory I2C ID table passing Javier Martinez Canillas <javier@osg.samsung.com> - 2015-09-24 09:40 +0200
  Re: [RESEND PATCH v4 0/8] i2c: Relax mandatory I2C ID table passing Lee Jones <lee.jones@linaro.org> - 2015-09-24 19:00 +0200
    Re: [RESEND PATCH v4 0/8] i2c: Relax mandatory I2C ID table passing Javier Martinez Canillas <javier@osg.samsung.com> - 2015-09-24 19:40 +0200
    Re: [RESEND PATCH v4 0/8] i2c: Relax mandatory I2C ID table passing Wolfram Sang <wsa@the-dreams.de> - 2015-10-01 23:00 +0200
      Re: [RESEND PATCH v4 0/8] i2c: Relax mandatory I2C ID table passing Kieran Bingham <kieranbingham@gmail.com> - 2015-10-01 23:20 +0200
      Re: [RESEND PATCH v4 0/8] i2c: Relax mandatory I2C ID table passing Lee Jones <lee.jones@linaro.org> - 2015-10-02 11:40 +0200

csiph-web