From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Dooks Subject: Re: [PATCH 1/2] i2c-s3c2410: Convert to devm_kzalloc() Date: Mon, 13 Feb 2012 23:38:08 +0000 Message-ID: <20120213233808.GL2999@freya.fluff.org> References: <1327152527-11364-1-git-send-email-broonie@opensource.wolfsonmicro.com> <4F1AE36E.3070403@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <4F1AE36E.3070403-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Sender: linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Sylwester Nawrocki Cc: Mark Brown , Ben Dooks , linux-samsung-soc , linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-i2c@vger.kernel.org On Sat, Jan 21, 2012 at 05:10:22PM +0100, Sylwester Nawrocki wrote: > On 01/21/2012 02:28 PM, Mark Brown wrote: > > Saves remembering to call kfree(). There's some kfree()s used by the > > resource still, these will be removed in 3.3 using the newly added > > devm_request_and_ioremap(). > > > > Signed-off-by: Mark Brown Mark Brown > > --- > > drivers/i2c/busses/i2c-s3c2410.c | 4 +--- > > 1 files changed, 1 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c > > index 4c17180..e6f982b 100644 > > --- a/drivers/i2c/busses/i2c-s3c2410.c > > +++ b/drivers/i2c/busses/i2c-s3c2410.c > > @@ -890,7 +890,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) > > } > > } > > > > - i2c = kzalloc(sizeof(struct s3c24xx_i2c), GFP_KERNEL); > > + i2c = devm_kzalloc(&pdev->dev, sizeof(struct s3c24xx_i2c), GFP_KERNEL); > > Just in case you are resending the patch for any other reason, it might be worth > to change to sizeof(*i2c) for consistency. Yuck.