From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Torokhov Subject: Re: [PATCH RESEND] input: gpio_keys_polled: convert to dt Date: Mon, 25 Jun 2012 01:03:48 -0700 Message-ID: <20120625080348.GI13876@core.coreip.homeip.net> References: <1340192062-10565-1-git-send-email-aletes.xgr@gmail.com> <20120621091833.GH2193@core.coreip.homeip.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mail-pz0-f46.google.com ([209.85.210.46]:61955 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751275Ab2FYID5 (ORCPT ); Mon, 25 Jun 2012 04:03:57 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Alexandre Pereira da Silva Cc: Grant Likely , Rob Herring , JJ Ding , Roland Stigge , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree-discuss@lists.ozlabs.org On Thu, Jun 21, 2012 at 08:37:18AM -0300, Alexandre Pereira da Silva wr= ote: > On Thu, Jun 21, 2012 at 6:18 AM, Dmitry Torokhov > wrote: > >> @@ -38,7 +40,7 @@ struct gpio_keys_button_data { > >> =A0struct gpio_keys_polled_dev { > >> =A0 =A0 =A0 struct input_polled_dev *poll_dev; > >> =A0 =A0 =A0 struct device *dev; > >> - =A0 =A0 struct gpio_keys_platform_data *pdata; > >> + =A0 =A0 struct gpio_keys_platform_data pdata; > > > > I am not sure why this change is needed. Also it seems that the dri= ver > > leaks DT-created pdata on unload. >=20 > 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... >=20 > I could kzalloc and kfree gpio_keys_polled_dev independently instead, > to avoid all those pointer changes if you think it's better. >=20 > 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. >=20 > >> + > >> +#define gpio_keys_polled_of_match NULL > > > > Please use of_match_ptr() instead. >=20 > Thanks for the suggestion, I will implement that. --=20 Dmitry -- To unsubscribe from this list: send the line "unsubscribe linux-input" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html