Re: [PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-13 Thread Evgeniy Polyakov
On Fri, Dec 07, 2012 at 12:15:24AM +0100, Julia Lawall (julia.law...@lip6.fr) wrote: > From: Julia Lawall > > The various devm_ functions allocate memory that is released when a driver > detaches. This patch uses these functions for data that is allocated in > the probe function of a platform

Re: [PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-13 Thread Evgeniy Polyakov
On Thu, Dec 13, 2012 at 12:39:38PM +0300, Dan Carpenter (dan.carpen...@oracle.com) wrote: > On Wed, Dec 12, 2012 at 01:25:56AM +0400, Evgeniy Polyakov wrote: > > I suppose mdev will be automatically freed, but who will release > > mdev->clk and other private members of mdev structure? > > +

Re: [PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-13 Thread Julia Lawall
On Thu, 13 Dec 2012, Dan Carpenter wrote: > On Thu, Dec 13, 2012 at 11:18:53AM +0100, Julia Lawall wrote: > > On Thu, 13 Dec 2012, Dan Carpenter wrote: > > > > > On Wed, Dec 12, 2012 at 01:25:56AM +0400, Evgeniy Polyakov wrote: > > > > I suppose mdev will be automatically freed, but who will

Re: [PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-13 Thread Dan Carpenter
On Thu, Dec 13, 2012 at 11:18:53AM +0100, Julia Lawall wrote: > On Thu, 13 Dec 2012, Dan Carpenter wrote: > > > On Wed, Dec 12, 2012 at 01:25:56AM +0400, Evgeniy Polyakov wrote: > > > I suppose mdev will be automatically freed, but who will release > > > mdev->clk and other private members of

Re: [PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-13 Thread Julia Lawall
On Thu, 13 Dec 2012, Dan Carpenter wrote: > On Wed, Dec 12, 2012 at 01:25:56AM +0400, Evgeniy Polyakov wrote: > > I suppose mdev will be automatically freed, but who will release > > mdev->clk and other private members of mdev structure? > > + mdev->clk = devm_clk_get(>dev, NULL); > > ->clk is

Re: [PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-13 Thread Dan Carpenter
On Wed, Dec 12, 2012 at 01:25:56AM +0400, Evgeniy Polyakov wrote: > I suppose mdev will be automatically freed, but who will release > mdev->clk and other private members of mdev structure? + mdev->clk = devm_clk_get(>dev, NULL); ->clk is now a devm pointer as well. regards, dan carpenter --

Re: [PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-13 Thread Dan Carpenter
On Wed, Dec 12, 2012 at 01:25:56AM +0400, Evgeniy Polyakov wrote: I suppose mdev will be automatically freed, but who will release mdev-clk and other private members of mdev structure? + mdev-clk = devm_clk_get(pdev-dev, NULL); -clk is now a devm pointer as well. regards, dan carpenter --

Re: [PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-13 Thread Julia Lawall
On Thu, 13 Dec 2012, Dan Carpenter wrote: On Wed, Dec 12, 2012 at 01:25:56AM +0400, Evgeniy Polyakov wrote: I suppose mdev will be automatically freed, but who will release mdev-clk and other private members of mdev structure? + mdev-clk = devm_clk_get(pdev-dev, NULL); -clk is now a

Re: [PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-13 Thread Dan Carpenter
On Thu, Dec 13, 2012 at 11:18:53AM +0100, Julia Lawall wrote: On Thu, 13 Dec 2012, Dan Carpenter wrote: On Wed, Dec 12, 2012 at 01:25:56AM +0400, Evgeniy Polyakov wrote: I suppose mdev will be automatically freed, but who will release mdev-clk and other private members of mdev

Re: [PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-13 Thread Julia Lawall
On Thu, 13 Dec 2012, Dan Carpenter wrote: On Thu, Dec 13, 2012 at 11:18:53AM +0100, Julia Lawall wrote: On Thu, 13 Dec 2012, Dan Carpenter wrote: On Wed, Dec 12, 2012 at 01:25:56AM +0400, Evgeniy Polyakov wrote: I suppose mdev will be automatically freed, but who will release

Re: [PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-13 Thread Evgeniy Polyakov
On Thu, Dec 13, 2012 at 12:39:38PM +0300, Dan Carpenter (dan.carpen...@oracle.com) wrote: On Wed, Dec 12, 2012 at 01:25:56AM +0400, Evgeniy Polyakov wrote: I suppose mdev will be automatically freed, but who will release mdev-clk and other private members of mdev structure? + mdev-clk =

Re: [PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-13 Thread Evgeniy Polyakov
On Fri, Dec 07, 2012 at 12:15:24AM +0100, Julia Lawall (julia.law...@lip6.fr) wrote: From: Julia Lawall julia.law...@lip6.fr The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function

Re: [PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-11 Thread Evgeniy Polyakov
Hi On Fri, Dec 07, 2012 at 12:15:24AM +0100, Julia Lawall (julia.law...@lip6.fr) wrote: > + mdev = devm_kzalloc(>dev, sizeof(struct mxc_w1_device), > + GFP_KERNEL); > if (!mdev) > return -ENOMEM; > > - mdev->clk = clk_get(>dev, NULL); > -

Re: [PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-11 Thread Evgeniy Polyakov
Hi On Fri, Dec 07, 2012 at 12:15:24AM +0100, Julia Lawall (julia.law...@lip6.fr) wrote: + mdev = devm_kzalloc(pdev-dev, sizeof(struct mxc_w1_device), + GFP_KERNEL); if (!mdev) return -ENOMEM; - mdev-clk = clk_get(pdev-dev, NULL); -

[PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-06 Thread Julia Lawall
From: Julia Lawall The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. At the same time, this fixes two faults.

[PATCH 1/2] drivers/w1/masters/mxc_w1.c: use devm_ functions

2012-12-06 Thread Julia Lawall
From: Julia Lawall julia.law...@lip6.fr The various devm_ functions allocate memory that is released when a driver detaches. This patch uses these functions for data that is allocated in the probe function of a platform device and is only freed in the remove function. At the same time, this