From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1947256Ab3BHVwj (ORCPT ); Fri, 8 Feb 2013 16:52:39 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:43129 "EHLO mail-ee0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753754Ab3BHVwi (ORCPT ); Fri, 8 Feb 2013 16:52:38 -0500 Message-ID: <511573A0.1030502@gmail.com> Date: Fri, 08 Feb 2013 22:52:32 +0100 From: Sylwester Nawrocki User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120412 Thunderbird/11.0.1 MIME-Version: 1.0 To: Sebastian Hesselbarth CC: Grant Likely , Rob Herring , Rob Landley , Mauro Carvalho Chehab , Benoit Thebaudeau , David Hardeman , Trilok Soni , Sylwester Nawrocki , Matus Ujhelyi , devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: Re: [PATCH v2] media: rc: gpio-ir-recv: add support for device tree parsing References: <1360137832-13086-1-git-send-email-sebastian.hesselbarth@gmail.com> <1360355887-19973-1-git-send-email-sebastian.hesselbarth@gmail.com> <51156DA3.2080006@gmail.com> <51156FCB.6020401@gmail.com> In-Reply-To: <51156FCB.6020401@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/08/2013 10:36 PM, Sebastian Hesselbarth wrote: >> You could also make it: >> >> #define gpio_ir_recv_get_devtree_pdata (-ENOSYS) > > Hmm, does that also play with parameter passing of the > CONFIG_OF gpio_ir_recv_get_devtree_pdata() ? Oops, should have been: #define gpio_ir_recv_get_devtree_pdata(dev, pd) (-ENOSYS) >> #define gpio_ir_recv_get_devtree_pdata (-ENOSYS) >>> +{ >>> + return ERR_PTR(-ENODEV); >>> +} >>> + >>> +#endif >>> + >>> static irqreturn_t gpio_ir_recv_irq(int irq, void *dev_id) >>> { >>> struct gpio_rc_dev *gpio_dev = dev_id; >>> @@ -66,6 +111,17 @@ static int gpio_ir_recv_probe(struct >>> platform_device *pdev) >>> pdev->dev.platform_data; >>> int rc; >>> >>> + if (pdev->dev.of_node) { >>> + struct gpio_ir_recv_platform_data *dtpdata = >> >> I think you could use pdata here instead, as previously. But I'm fine >> with >> as it is now as well. > > Yeah, but pdata is const and I will change it within _get_devtree_pdata(). > I could cast the const away when passing it to > gpio_ir_recv_get_devtree_pdata() > but it is almost the same amount of code.. and it is cleaner this way. True, let's leave it intact then. S.