Custom Search

Re: [PATCH RESEND] input: gpio_keys_polled: convert to dt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On Thu, Jun 21, 2012 at 08:37:18AM -0300, Alexandre Pereira da Silva wrote:
> On Thu, Jun 21, 2012 at 6:18 AM, Dmitry Torokhov
> <dmitry.torokhov@xxxxxxxxx> wrote:
> >> @@ -38,7 +40,7 @@ struct gpio_keys_button_data {
> >>  struct gpio_keys_polled_dev {
> >>       struct input_polled_dev *poll_dev;
> >>       struct device *dev;
> >> -     struct gpio_keys_platform_data *pdata;
> >> +     struct gpio_keys_platform_data pdata;
> >
> > I am not sure why this change is needed. Also it seems that the driver
> > leaks DT-created pdata on unload.
> 
> Pdata is now a member of gpio_keys_polled_dev now and that one is
> kzalloc'ed at probe and kfree'd at the removal and errors. I see no
> leaks there.

Ah, I missed that you used on-stack instance to hold parsed DT data...

> 
> I could kzalloc and kfree gpio_keys_polled_dev independently instead,
> to avoid all those pointer changes if you think it's better.
> 
> This is mostly a clone from the dt handling in gpio_keys, and
> comparing both now,
> I see that it will leak on pdata->buttons, so I will fix that.
> 
> >> +
> >> +#define gpio_keys_polled_of_match NULL
> >
> > Please use of_match_ptr() instead.
> 
> Thanks for the suggestion, I will implement that.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux