From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sylwester Nawrocki Subject: Re: [PATCH 1/2] i2c-s3c2410: Convert to devm_kzalloc() Date: Sat, 21 Jan 2012 17:10:22 +0100 Message-ID: <4F1AE36E.3070403@gmail.com> References: <1327152527-11364-1-git-send-email-broonie@opensource.wolfsonmicro.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1327152527-11364-1-git-send-email-broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org> Sender: linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Mark Brown Cc: Ben Dooks , linux-samsung-soc , linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-i2c@vger.kernel.org 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.