Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1662994 > unrolled thread

[PATCH v1] extcon: int3496: Switch to devm_acpi_dev_add_driver_gpios()

Started byAndy Shevchenko <andriy.shevchenko@linux.intel.com>
First post2017-06-10 21:10 +0200
Last post2017-06-12 03:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v1] extcon: int3496: Switch to devm_acpi_dev_add_driver_gpios() Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-06-10 21:10 +0200
    Re: [PATCH v1] extcon: int3496: Switch to  devm_acpi_dev_add_driver_gpios() Chanwoo Choi <cw00.choi@samsung.com> - 2017-06-12 03:10 +0200

#1662994 — [PATCH v1] extcon: int3496: Switch to devm_acpi_dev_add_driver_gpios()

FromAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Date2017-06-10 21:10 +0200
Subject[PATCH v1] extcon: int3496: Switch to devm_acpi_dev_add_driver_gpios()
Message-ID<tQTVM-2TS-5@gated-at.bofh.it>
Switch to use managed variant of acpi_dev_add_driver_gpios() to simplify
error path and fix potentially wrong assingment if ->probe() fails.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/extcon/extcon-intel-int3496.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/extcon/extcon-intel-int3496.c b/drivers/extcon/extcon-intel-int3496.c
index 9d17984bbbd4..d9f9afe45961 100644
--- a/drivers/extcon/extcon-intel-int3496.c
+++ b/drivers/extcon/extcon-intel-int3496.c
@@ -94,8 +94,7 @@ static int int3496_probe(struct platform_device *pdev)
 	struct int3496_data *data;
 	int ret;
 
-	ret = acpi_dev_add_driver_gpios(ACPI_COMPANION(dev),
-					acpi_int3496_default_gpios);
+	ret = devm_acpi_dev_add_driver_gpios(dev, acpi_int3496_default_gpios);
 	if (ret) {
 		dev_err(dev, "can't add GPIO ACPI mapping\n");
 		return ret;
@@ -169,8 +168,6 @@ static int int3496_remove(struct platform_device *pdev)
 	devm_free_irq(&pdev->dev, data->usb_id_irq, data);
 	cancel_delayed_work_sync(&data->work);
 
-	acpi_dev_remove_driver_gpios(ACPI_COMPANION(&pdev->dev));
-
 	return 0;
 }
 
-- 
2.11.0

[toc] | [next] | [standalone]


#1663174 — Re: [PATCH v1] extcon: int3496: Switch to devm_acpi_dev_add_driver_gpios()

FromChanwoo Choi <cw00.choi@samsung.com>
Date2017-06-12 03:10 +0200
SubjectRe: [PATCH v1] extcon: int3496: Switch to devm_acpi_dev_add_driver_gpios()
Message-ID<tRm1I-3S8-5@gated-at.bofh.it>
In reply to#1662994
On 2017년 06월 11일 04:09, Andy Shevchenko wrote:
> Switch to use managed variant of acpi_dev_add_driver_gpios() to simplify
> error path and fix potentially wrong assingment if ->probe() fails.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/extcon/extcon-intel-int3496.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/extcon/extcon-intel-int3496.c b/drivers/extcon/extcon-intel-int3496.c
> index 9d17984bbbd4..d9f9afe45961 100644
> --- a/drivers/extcon/extcon-intel-int3496.c
> +++ b/drivers/extcon/extcon-intel-int3496.c
> @@ -94,8 +94,7 @@ static int int3496_probe(struct platform_device *pdev)
>  	struct int3496_data *data;
>  	int ret;
>  
> -	ret = acpi_dev_add_driver_gpios(ACPI_COMPANION(dev),
> -					acpi_int3496_default_gpios);
> +	ret = devm_acpi_dev_add_driver_gpios(dev, acpi_int3496_default_gpios);
>  	if (ret) {
>  		dev_err(dev, "can't add GPIO ACPI mapping\n");
>  		return ret;
> @@ -169,8 +168,6 @@ static int int3496_remove(struct platform_device *pdev)
>  	devm_free_irq(&pdev->dev, data->usb_id_irq, data);
>  	cancel_delayed_work_sync(&data->work);
>  
> -	acpi_dev_remove_driver_gpios(ACPI_COMPANION(&pdev->dev));
> -
>  	return 0;
>  }
>  
> 

Applied it. Thanks.

-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web