[PATCH v2] media: rc: gpio-ir-recv: add support for device tree parsing

Sylwester Nawrocki sylvester.nawrocki at gmail.com
Sat Feb 9 08:52:32 EST 2013


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.


More information about the devicetree-discuss mailing list