All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org>
To: "Vishwanathrao Badarkhe,
	Manish" <manishv.b-l0cyMroinI0@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org
Subject: Re: [PATCH V2] i2c: davinci: update to devm_* API
Date: Wed, 06 Feb 2013 15:51:36 +0400	[thread overview]
Message-ID: <511243C8.8060400@mvista.com> (raw)
In-Reply-To: <1360149736-32523-1-git-send-email-manishv.b-l0cyMroinI0@public.gmane.org>

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-l0cyMroinI0@public.gmane.org>
> ---
> 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.

WBR, Sergei

WARNING: multiple messages have this Message-ID (diff)
From: Sergei Shtylyov <sshtylyov@mvista.com>
To: "Vishwanathrao Badarkhe, Manish" <manishv.b@ti.com>
Cc: linux-i2c@vger.kernel.org,
	davinci-linux-open-source@linux.davincidsp.com,
	linux-kernel@vger.kernel.org, w.sang@pengutronix.de,
	ben-linux@fluff.org
Subject: Re: [PATCH V2] i2c: davinci: update to devm_* API
Date: Wed, 06 Feb 2013 15:51:36 +0400	[thread overview]
Message-ID: <511243C8.8060400@mvista.com> (raw)
In-Reply-To: <1360149736-32523-1-git-send-email-manishv.b@ti.com>

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@ti.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.

WBR, Sergei


  parent reply	other threads:[~2013-02-06 11:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-06 11:22 [PATCH V2] i2c: davinci: update to devm_* API Vishwanathrao Badarkhe, Manish
2013-02-06 11:22 ` Vishwanathrao Badarkhe, Manish
     [not found] ` <1360149736-32523-1-git-send-email-manishv.b-l0cyMroinI0@public.gmane.org>
2013-02-06 11:51   ` Sergei Shtylyov [this message]
2013-02-06 11:51     ` Sergei Shtylyov
     [not found]     ` <511243C8.8060400-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org>
2013-02-07  3:02       ` Vishwanathrao Badarkhe, Manish
2013-02-07  3:02         ` Vishwanathrao Badarkhe, Manish

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=511243C8.8060400@mvista.com \
    --to=sshtylyov-igf4poytycdqt0dzr+alfa@public.gmane.org \
    --cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
    --cc=davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=manishv.b-l0cyMroinI0@public.gmane.org \
    --cc=w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.