public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: "Ivan T. Ivanov" <iivanov@mm-sol.com>
Cc: <balbi@ti.com>, <gregkh@linuxfoundation.org>,
	<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-msm@vger.kernel.org>
Subject: Re: [PATCH v2 2/7] usb: phy: msm: Migrate to Managed Device Resource allocation
Date: Wed, 24 Jul 2013 15:38:22 +0300	[thread overview]
Message-ID: <20130724123822.GH17962@radagast> (raw)
In-Reply-To: <1373384833-18077-3-git-send-email-iivanov@mm-sol.com>

[-- Attachment #1: Type: text/plain, Size: 1553 bytes --]

Hi,

On Tue, Jul 09, 2013 at 06:47:08PM +0300, Ivan T. Ivanov wrote:
> From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
> 
> Use managed device resources to clean up the probe/remove
> and get DT support for free.
> 
> Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
> ---
>  drivers/usb/phy/phy-msm-usb.c |   78 +++++++++++------------------------------
>  1 file changed, 20 insertions(+), 58 deletions(-)
> 
> diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
> index ab1b880..cc37f5e 100644
> --- a/drivers/usb/phy/phy-msm-usb.c
> +++ b/drivers/usb/phy/phy-msm-usb.c
> @@ -1458,30 +1455,27 @@ static int __init msm_otg_probe(struct platform_device *pdev)
>  	 * clock is introduced to remove the dependency on AXI
>  	 * bus frequency.
>  	 */
> -	motg->core_clk = clk_get(&pdev->dev, "usb_hs_core_clk");
> +	motg->core_clk = devm_clk_get(&pdev->dev, "usb_hs_core_clk");
>  	if (IS_ERR(motg->core_clk))
>  		motg->core_clk = NULL;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	if (!res) {

no need to check for the resource when using devm_ioremap_resource()

>  		dev_err(&pdev->dev, "failed to get platform resource mem\n");
> -		ret = -ENODEV;
> -		goto put_core_clk;
> +		return -ENODEV;
>  	}
>  
> -	motg->regs = ioremap(res->start, resource_size(res));
> +	motg->regs = devm_ioremap_resource(&pdev->dev, res);
>  	if (!motg->regs) {
>  		dev_err(&pdev->dev, "ioremap failed\n");

don't print error messages when using devm_ioremap_resource()

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-07-24 12:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09 15:47 [PATCH v2 0/7] usb: phy: msm: Fixes and cleanups Ivan T. Ivanov
2013-07-09 15:47 ` [PATCH v2 1/7] usb: phy: msm: Move mach depndend code to platform data Ivan T. Ivanov
2013-07-24 12:34   ` Felipe Balbi
2013-07-24 12:36     ` Felipe Balbi
2013-07-09 15:47 ` [PATCH v2 2/7] usb: phy: msm: Migrate to Managed Device Resource allocation Ivan T. Ivanov
2013-07-24 12:38   ` Felipe Balbi [this message]
2013-07-25 13:42     ` Ivan T. Ivanov
2013-07-09 15:47 ` [PATCH v2 3/7] usb: phy: msm: Move regulator usage to managed resource allocation Ivan T. Ivanov
2013-07-24 12:39   ` Felipe Balbi
2013-07-25 13:43     ` Ivan T. Ivanov
2013-07-26 12:31       ` Ivan T. Ivanov
2013-07-26 20:28         ` Felipe Balbi
2013-07-27  6:54           ` Ivan T. Ivanov
2013-07-09 15:47 ` [PATCH v2 4/7] usb: phy: msm: Remove unnecessarily check for valid regulators Ivan T. Ivanov
2013-07-09 15:47 ` [PATCH v2 5/7] usb: phy: msm: Fix WARNING: quoted string split across lines Ivan T. Ivanov
2013-07-09 15:47 ` [PATCH v2 6/7] usb: phy: msm: Fix WARNING: Prefer seq_puts to seq_printf Ivan T. Ivanov
2013-07-09 15:47 ` [PATCH v2 7/7] usb: phy: msm: Lindent the code Ivan T. Ivanov
2013-07-16 11:25 ` [PATCH v2 0/7] usb: phy: msm: Fixes and cleanups Ivan T. Ivanov

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=20130724123822.GH17962@radagast \
    --to=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=iivanov@mm-sol.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox