[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <154356140759.88331.15666344779026803117@swboyd.mtv.corp.google.com>
Date: Thu, 29 Nov 2018 23:03:27 -0800
From: Stephen Boyd <sboyd@...nel.org>
To: Rob Herring <robh+dt@...nel.org>
Cc: Michael Turquette <mturquette@...libre.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
<linux-arm-kernel@...ts.infradead.org>,
linux-clk <linux-clk@...r.kernel.org>,
linux-mediatek@...ts.infradead.org, devicetree@...r.kernel.org,
Matthias Brugger <matthias.bgg@...il.com>,
Ryder Lee <ryder.lee@...iatek.com>,
Frank Rowand <frowand.list@...il.com>
Subject: Re: [PATCH 1/4] of/device: Add a way to probe drivers by match data
Quoting Rob Herring (2018-11-29 17:01:54)
> On Thu, Nov 29, 2018 at 6:28 PM Stephen Boyd <sboyd@...nel.org> wrote:
> >
> > Quoting Stephen Boyd (2018-11-07 10:37:31)
> > > appropriate structure with to_platform_device() or to_i2c_client()?
> > >
> > > So the example would become
> > >
> > > struct of_driver_probe_func {
> > > int (*probe)(struct device *dev);
> > > };
> > >
> > > struct of_driver_probe_func mtk_probes[] = {
> > > mtk_probe1,
> > > mtk_probe2,
> > > mtk_probe3,
> > > };
> > >
> > > struct platform_driver mtk_driver = {
> > > .driver = {
> > > .name = "mtk-foo";
> > > .of_match_table = mtk_match_table,
> > > .of_probes = &mtk_probes;
> > > },
> > > };
> > >
> > > And the probe functions might need to container_of() the device pointer
> > > to get the struct they know they need. The probe function could also be
> > > added to of_device_id and then we would have to look and see if that
> > > pointer is populated when the device is matched in generic device code.
> > >
> >
> > I guess I'll go down the path of extending the of_device_id structure?
>
> Unfortunately, I don't think you can change of_device_id as it's part
> of the kernel ABI.
Ok. Then I'll go down the path of making it a parallel array?
Powered by blists - more mailing lists