mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>,
	linux-kernel@vger.kernel.org,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Subject: Re: [PATCH] extcon: max77693: Use resource managed interrupt line
Date: Mon, 22 Sep 2014 15:59:34 +0900	[thread overview]
Message-ID: <541FC8D6.7020403@samsung.com> (raw)
In-Reply-To: <1410527797-14027-1-git-send-email-k.kozlowski@samsung.com>

On 09/12/2014 10:16 PM, Krzysztof Kozlowski wrote:
> Use resource managed interrupt line devm_request_threaded_irq() to
> simplify a little cleanup paths:
>  - no goto to cleanup label,
>  - simpler remove function.
> 
> Overall the driver size is decreased by 11 line of code.
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Applied.

Thanks,
Chanwoo Choi

> ---
>  drivers/extcon/extcon-max77693.c | 25 +++++++------------------
>  1 file changed, 7 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c
> index 77460f2c1ca1..0574154a94a9 100644
> --- a/drivers/extcon/extcon-max77693.c
> +++ b/drivers/extcon/extcon-max77693.c
> @@ -1155,13 +1155,11 @@ static int max77693_muic_probe(struct platform_device *pdev)
>  
>  		virq = regmap_irq_get_virq(max77693->irq_data_muic,
>  					muic_irq->irq);
> -		if (!virq) {
> -			ret = -EINVAL;
> -			goto err_irq;
> -		}
> +		if (!virq)
> +			return -EINVAL;
>  		muic_irq->virq = virq;
>  
> -		ret = request_threaded_irq(virq, NULL,
> +		ret = devm_request_threaded_irq(&pdev->dev, virq, NULL,
>  				max77693_muic_irq_handler,
>  				IRQF_NO_SUSPEND,
>  				muic_irq->name, info);
> @@ -1170,7 +1168,7 @@ static int max77693_muic_probe(struct platform_device *pdev)
>  				"failed: irq request (IRQ: %d,"
>  				" error :%d)\n",
>  				muic_irq->irq, ret);
> -			goto err_irq;
> +			return ret;
>  		}
>  	}
>  
> @@ -1179,15 +1177,14 @@ static int max77693_muic_probe(struct platform_device *pdev)
>  					      max77693_extcon_cable);
>  	if (IS_ERR(info->edev)) {
>  		dev_err(&pdev->dev, "failed to allocate memory for extcon\n");
> -		ret = -ENOMEM;
> -		goto err_irq;
> +		return -ENOMEM;
>  	}
>  	info->edev->name = DEV_NAME;
>  
>  	ret = devm_extcon_dev_register(&pdev->dev, info->edev);
>  	if (ret) {
>  		dev_err(&pdev->dev, "failed to register extcon device\n");
> -		goto err_irq;
> +		return ret;
>  	}
>  
>  	/* Initialize MUIC register by using platform data or default data */
> @@ -1265,7 +1262,7 @@ static int max77693_muic_probe(struct platform_device *pdev)
>  			MAX77693_MUIC_REG_ID, &id);
>  	if (ret < 0) {
>  		dev_err(&pdev->dev, "failed to read revision number\n");
> -		goto err_irq;
> +		return ret;
>  	}
>  	dev_info(info->dev, "device ID : 0x%x\n", id);
>  
> @@ -1285,20 +1282,12 @@ static int max77693_muic_probe(struct platform_device *pdev)
>  			delay_jiffies);
>  
>  	return ret;
> -
> -err_irq:
> -	while (--i >= 0)
> -		free_irq(muic_irqs[i].virq, info);
> -	return ret;
>  }
>  
>  static int max77693_muic_remove(struct platform_device *pdev)
>  {
>  	struct max77693_muic_info *info = platform_get_drvdata(pdev);
> -	int i;
>  
> -	for (i = 0; i < ARRAY_SIZE(muic_irqs); i++)
> -		free_irq(muic_irqs[i].virq, info);
>  	cancel_work_sync(&info->irq_work);
>  	input_unregister_device(info->dock);
>  
> 


      reply	other threads:[~2014-09-22  6:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12 13:16 Krzysztof Kozlowski
2014-09-22  6:59 ` Chanwoo Choi [this message]

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=541FC8D6.7020403@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=k.kozlowski@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=myungjoo.ham@samsung.com \
    /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

Powered by JetHome