Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754720Ab3EFO7q (ORCPT ); Mon, 6 May 2013 10:59:46 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:54869 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753997Ab3EFO7n (ORCPT ); Mon, 6 May 2013 10:59:43 -0400 MIME-Version: 1.0 In-Reply-To: <201305031634.39129.arnd@arndb.de> References: <1367563919-2880-1-git-send-email-prabhakar.csengg@gmail.com> <201305031634.39129.arnd@arndb.de> From: Prabhakar Lad Date: Mon, 6 May 2013 20:29:22 +0530 Message-ID: Subject: Re: [PATCH RFC v3] media: i2c: mt9p031: add OF support To: Arnd Bergmann , Laurent Pinchart , Sascha Hauer Cc: LMML , Mauro Carvalho Chehab , DLOS , Hans Verkuil , Guennadi Liakhovetski , LKML , Sakari Ailus , Sylwester Nawrocki , Grant Likely , Rob Herring , Rob Landley , devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1656 Lines: 47 Hi Arnd, On Fri, May 3, 2013 at 8:04 PM, Arnd Bergmann 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. Laurent, Sascha what do you suggest ? Regards, --Prabhakar Lad -- 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/