lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+V-a8sfPSEWJz1XAuGv7aPTWDjUpPTmU_Z8372tqjS8O0CCWQ@mail.gmail.com>
Date:	Wed, 8 May 2013 18:13:03 +0530
From:	Prabhakar Lad <prabhakar.csengg@...il.com>
To:	Laurent Pinchart <laurent.pinchart@...asonboard.com>
Cc:	Arnd Bergmann <arnd@...db.de>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	LMML <linux-media@...r.kernel.org>,
	Mauro Carvalho Chehab <mchehab@...hat.com>,
	DLOS <davinci-linux-open-source@...ux.davincidsp.com>,
	Hans Verkuil <hans.verkuil@...co.com>,
	Guennadi Liakhovetski <g.liakhovetski@....de>,
	LKML <linux-kernel@...r.kernel.org>,
	Sakari Ailus <sakari.ailus@....fi>,
	Sylwester Nawrocki <s.nawrocki@...sung.com>,
	Grant Likely <grant.likely@...retlab.ca>,
	Rob Herring <rob.herring@...xeda.com>,
	Rob Landley <rob@...dley.net>,
	devicetree-discuss@...ts.ozlabs.org, linux-doc@...r.kernel.org
Subject: Re: [PATCH RFC v3] media: i2c: mt9p031: add OF support

Hi Laurent,

On Wed, May 8, 2013 at 4:07 PM, Laurent Pinchart
<laurent.pinchart@...asonboard.com> wrote:
> Hi Prabhakar,
>
> On Wednesday 08 May 2013 10:19:57 Prabhakar Lad wrote:
>> On Wed, May 8, 2013 at 7:32 AM, Laurent Pinchart wrote:
>> > On Tuesday 07 May 2013 15:10:36 Prabhakar Lad wrote:
>> >> On Mon, May 6, 2013 at 8:29 PM, Prabhakar Lad wrote:
>> >> > On Fri, May 3, 2013 at 8:04 PM, Arnd Bergmann <arnd@...db.de> wrote:
>> >> >> On Friday 03 May 2013, Prabhakar Lad wrote:
>> >> > [snip]
>> >> >
>> >> >>> +}
>> >> >>
>> >> >> Ok, good.
>> >> >>
>> >> >>> @@ -955,7 +998,17 @@ static int mt9p031_probe(struct i2c_client
>> >> >>> *client,
>> >> >>>
>> >> >>>         mt9p031->pdata = pdata;
>> >> >>>         mt9p031->output_control = MT9P031_OUTPUT_CONTROL_DEF;
>> >> >>>         mt9p031->mode2 = MT9P031_READ_MODE_2_ROW_BLC;
>> >> >>>
>> >> >>> -       mt9p031->model = did->driver_data;
>> >> >>> +
>> >> >>> +       if (!client->dev.of_node) {
>> >> >>> +               mt9p031->model = (enum
>> >> >>> mt9p031_model)did->driver_data;
>> >> >>> +       } else {
>> >> >>> +               const struct of_device_id *of_id;
>> >> >>> +
>> >> >>> +               of_id =
>> >> >>> of_match_device(of_match_ptr(mt9p031_of_match),
>> >> >>> +                                       &client->dev);
>> >> >>> +               if (of_id)
>> >> >>> +                       mt9p031->model = (enum
>> >> >>> mt9p031_model)of_id->data;
>> >> >>> +       }
>> >> >>>
>> >> >>>         mt9p031->reset = -1;
>> >> >>
>> >> >> Is this actually required? I thought the i2c core just compared the
>> >> >> part of the "compatible" value after the first comma to the string, so
>> >> >> "mt9p031->model = (enum mt9p031_model)did->driver_data" should work
>> >> >> in both cases.
>> >> >
>> >> > I am OK with "mt9p031->model = (enum mt9p031_model)did->driver_data"
>> >> > but I see still few drivers doing this, I am not sure for what reason.
>> >> > If everyone is OK with it I can drop the above change.
>> >>
>> >> My bad, while booting with DT the i2c_device_id ie did in this case will
>> >> be NULL, so the above changes are required :-)
>> >
>> > I've just tested your patch, and did isn't NULL when booting my
>> > Beagleboard with DT (on v3.9-rc5).
>>
>> I am pretty much sure you tested it compatible property as "aptina,mt9p031"
>> if the compatible property is set to "aptina,mt9p031m" the did will be NULL.
>
> I've tested both :-)
>
Thanks for the testing :-) I'll remove this changes in the next version.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ