lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <A4887BF146CD57468F700B415D2F470158327B@DBDE01.ent.ti.com>
Date:	Thu, 7 Feb 2013 03:02:47 +0000
From:	"Vishwanathrao Badarkhe, Manish" <manishv.b@...com>
To:	Sergei Shtylyov <sshtylyov@...sta.com>
CC:	"linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>,
	"davinci-linux-open-source@...ux.davincidsp.com" 
	<davinci-linux-open-source@...ux.davincidsp.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"w.sang@...gutronix.de" <w.sang@...gutronix.de>,
	"ben-linux@...ff.org" <ben-linux@...ff.org>
Subject: RE: [PATCH V2] i2c: davinci: update to devm_* API

Hi Sergei,

On Wed, Feb 06, 2013 at 17:21:36, Sergei Shtylyov wrote:
> Hello.
> 
> On 06-02-2013 15:22, Vishwanathrao Badarkhe, Manish wrote:
> 
> > Update the code to use devm_* API so that driver core will manage 
> > resources.
> 
> > Signed-off-by: Vishwanathrao Badarkhe, Manish <manishv.b@...com>
> > ---
> > Changes since V1:
> >    - Rebase on top of v3.8-rc6 of linus tree.
> >    - Apply devm operation on clk_get.
> 
> > :100644 100644 6a0a553... da4e218... M	drivers/i2c/busses/i2c-davinci.c
> >   drivers/i2c/busses/i2c-davinci.c |   45 +++++++++++---------------------------
> >   1 files changed, 13 insertions(+), 32 deletions(-)
> 
> > diff --git a/drivers/i2c/busses/i2c-davinci.c 
> > b/drivers/i2c/busses/i2c-davinci.c
> > index 6a0a553..da4e218 100644
> > --- a/drivers/i2c/busses/i2c-davinci.c
> > +++ b/drivers/i2c/busses/i2c-davinci.c
> [...]
> > @@ -699,22 +693,24 @@ static int davinci_i2c_probe(struct platform_device *pdev)
> >   		dev->pdata = &davinci_i2c_platform_data_default;
> >   	}
> >
> > -	dev->clk = clk_get(&pdev->dev, NULL);
> > +	dev->clk = devm_clk_get(&pdev->dev, NULL);
> >   	if (IS_ERR(dev->clk)) {
> >   		r = -ENODEV;
> >   		goto err_free_mem;
> >   	}
> >   	clk_prepare_enable(dev->clk);
> >
> > -	dev->base = ioremap(mem->start, resource_size(mem));
> > +	dev->base = devm_request_and_ioremap(&pdev->dev, mem);
> >   	if (!dev->base) {
> >   		r = -EBUSY;
> 
>     Comment to devm_request_and_ioremap() suggests returning -EADDRNOTAVAIL on failure. -EBUSY wasn't the right code even before this change, should have been -ENOMEM.

Oh, you are right. I will change this to -EADDRNOTAVAIL. Thanks for 
pointing this out.

Thanks, 
Manish Badarkhe
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ