Re: [PATCH V5 2/2] mfd: stmpe: Update DT support in stmpe driver

From: Grant Likely
Date: Fri Dec 07 2012 - 08:37:00 EST


On Thu, 6 Dec 2012 07:28:22 +0530, Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
> First of all, thanks for explaining :)
>
> On 6 December 2012 04:12, Grant Likely <grant.likely@xxxxxxxxxxxx> wrote:
> > On Sat, 1 Dec 2012 00:33:46 +0530, Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
> >> This first tries to match the table my patch added, _BUT_ the string will
> >> never match as we had "st,stmpe810" in table and "stmpe810" in dev.
> >
> > of_driver_match_device() matches against the compatible list in
> > dev->of_node, not against the device name. So, if the compatible
> > property has a string that is in the table, then it really should match
> > against it.
>
> How could i misread it? Yes you are correct.
>
> >> static int i2c_device_probe(struct device *dev)
> >> {
> >> .....
> >> status = driver->probe(client, i2c_match_id(driver->id_table, client));
> >
> > Here things are a bit wonky. Even if matched against the table, it is
>
> table means of_device_id table ?

yes

>
> > possible that it also matches against i2c_match_id() and that data is
> > passed to the driver.
>
> It is a possibility or guarantee ? And so whatever device name we got from
> modalias routine, should match with the names in driver->id_table.

possibility. If the generated alias name does match something in
driver->id_table, then that pointer will be returned here.

> > But regardless, it is the responsiblity of the probe function to go and
> > look if of_driver_match_device() matches against anything if it cares
> > about the of_match_table entries (for instance, if there is extra data
> > attached).
>
> Ok, so filling .data field in of_device_id[] is not required for our case as
> we aren't doing anything special in our drivers.

As long as things are simple, correct.

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