Re: [PATCH] leds/leds-s3c24xx: use devm_gpio_request

2012-07-12 Thread devendra.aaru
On Fri, Jul 13, 2012 at 9:12 AM, Bryan Wu  wrote:
> On Wed, Jul 11, 2012 at 5:50 PM, Devendra Naga  
> wrote:
>> Bryan,
>>
>> This patch is not even compile tested, since my machine crashed, and
>> didn't have the ARM toolchain, sorry ..
>>
>
> Thanks, I built it successfully. It looks fine to me. I will apply
> this to my for-next branch.
>
> -Bryan
>
Thank Bryan, I  will set up my cross-toolchain soon.. sorry for not
compiling it.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] leds/leds-s3c24xx: use devm_gpio_request

2012-07-12 Thread Bryan Wu
On Wed, Jul 11, 2012 at 5:50 PM, Devendra Naga  wrote:
> why?
> because if the led_classdev_register fails we wont do gpio free
> because using devm_ functions, there is no need for error paths
>
> Signed-off-by: Devendra Naga 
> ---
> Bryan,
>
> This patch is not even compile tested, since my machine crashed, and
> didn't have the ARM toolchain, sorry ..
>

Thanks, I built it successfully. It looks fine to me. I will apply
this to my for-next branch.

-Bryan

> And i think this patch is legit not as that pci_set_drvdata one :(
>  drivers/leds/leds-s3c24xx.c |3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/leds/leds-s3c24xx.c b/drivers/leds/leds-s3c24xx.c
> index e120640..942f0ea 100644
> --- a/drivers/leds/leds-s3c24xx.c
> +++ b/drivers/leds/leds-s3c24xx.c
> @@ -65,7 +65,6 @@ static int s3c24xx_led_remove(struct platform_device *dev)
> struct s3c24xx_gpio_led *led = pdev_to_gpio(dev);
>
> led_classdev_unregister(>cdev);
> -   gpio_free(led->pdata->gpio);
>
> return 0;
>  }
> @@ -92,7 +91,7 @@ static int s3c24xx_led_probe(struct platform_device *dev)
>
> led->pdata = pdata;
>
> -   ret = gpio_request(pdata->gpio, "S3C24XX_LED");
> +   ret = devm_gpio_request(>dev, pdata->gpio, "S3C24XX_LED");
> if (ret < 0)
> return ret;
>
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-leds" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Bryan Wu 
Kernel Developer+86.186-168-78255 Mobile
Canonical Ltd.  www.canonical.com
Ubuntu - Linux for human beings | www.ubuntu.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] leds/leds-s3c24xx: use devm_gpio_request

2012-07-12 Thread Bryan Wu
On Wed, Jul 11, 2012 at 5:50 PM, Devendra Naga devendra.a...@gmail.com wrote:
 why?
 because if the led_classdev_register fails we wont do gpio free
 because using devm_ functions, there is no need for error paths

 Signed-off-by: Devendra Naga devendra.a...@gmail.com
 ---
 Bryan,

 This patch is not even compile tested, since my machine crashed, and
 didn't have the ARM toolchain, sorry ..


Thanks, I built it successfully. It looks fine to me. I will apply
this to my for-next branch.

-Bryan

 And i think this patch is legit not as that pci_set_drvdata one :(
  drivers/leds/leds-s3c24xx.c |3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

 diff --git a/drivers/leds/leds-s3c24xx.c b/drivers/leds/leds-s3c24xx.c
 index e120640..942f0ea 100644
 --- a/drivers/leds/leds-s3c24xx.c
 +++ b/drivers/leds/leds-s3c24xx.c
 @@ -65,7 +65,6 @@ static int s3c24xx_led_remove(struct platform_device *dev)
 struct s3c24xx_gpio_led *led = pdev_to_gpio(dev);

 led_classdev_unregister(led-cdev);
 -   gpio_free(led-pdata-gpio);

 return 0;
  }
 @@ -92,7 +91,7 @@ static int s3c24xx_led_probe(struct platform_device *dev)

 led-pdata = pdata;

 -   ret = gpio_request(pdata-gpio, S3C24XX_LED);
 +   ret = devm_gpio_request(dev-dev, pdata-gpio, S3C24XX_LED);
 if (ret  0)
 return ret;

 --
 1.7.9.5

 --
 To unsubscribe from this list: send the line unsubscribe linux-leds in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Bryan Wu bryan...@canonical.com
Kernel Developer+86.186-168-78255 Mobile
Canonical Ltd.  www.canonical.com
Ubuntu - Linux for human beings | www.ubuntu.com
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] leds/leds-s3c24xx: use devm_gpio_request

2012-07-12 Thread devendra.aaru
On Fri, Jul 13, 2012 at 9:12 AM, Bryan Wu bryan...@canonical.com wrote:
 On Wed, Jul 11, 2012 at 5:50 PM, Devendra Naga devendra.a...@gmail.com 
 wrote:
 Bryan,

 This patch is not even compile tested, since my machine crashed, and
 didn't have the ARM toolchain, sorry ..


 Thanks, I built it successfully. It looks fine to me. I will apply
 this to my for-next branch.

 -Bryan

Thank Bryan, I  will set up my cross-toolchain soon.. sorry for not
compiling it.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] leds/leds-s3c24xx: use devm_gpio_request

2012-07-11 Thread Devendra Naga
why?
because if the led_classdev_register fails we wont do gpio free
because using devm_ functions, there is no need for error paths

Signed-off-by: Devendra Naga 
---
Bryan,

This patch is not even compile tested, since my machine crashed, and
didn't have the ARM toolchain, sorry ..

And i think this patch is legit not as that pci_set_drvdata one :(
 drivers/leds/leds-s3c24xx.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/leds/leds-s3c24xx.c b/drivers/leds/leds-s3c24xx.c
index e120640..942f0ea 100644
--- a/drivers/leds/leds-s3c24xx.c
+++ b/drivers/leds/leds-s3c24xx.c
@@ -65,7 +65,6 @@ static int s3c24xx_led_remove(struct platform_device *dev)
struct s3c24xx_gpio_led *led = pdev_to_gpio(dev);
 
led_classdev_unregister(>cdev);
-   gpio_free(led->pdata->gpio);
 
return 0;
 }
@@ -92,7 +91,7 @@ static int s3c24xx_led_probe(struct platform_device *dev)
 
led->pdata = pdata;
 
-   ret = gpio_request(pdata->gpio, "S3C24XX_LED");
+   ret = devm_gpio_request(>dev, pdata->gpio, "S3C24XX_LED");
if (ret < 0)
return ret;
 
-- 
1.7.9.5

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


[PATCH] leds/leds-s3c24xx: use devm_gpio_request

2012-07-11 Thread Devendra Naga
why?
because if the led_classdev_register fails we wont do gpio free
because using devm_ functions, there is no need for error paths

Signed-off-by: Devendra Naga devendra.a...@gmail.com
---
Bryan,

This patch is not even compile tested, since my machine crashed, and
didn't have the ARM toolchain, sorry ..

And i think this patch is legit not as that pci_set_drvdata one :(
 drivers/leds/leds-s3c24xx.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/leds/leds-s3c24xx.c b/drivers/leds/leds-s3c24xx.c
index e120640..942f0ea 100644
--- a/drivers/leds/leds-s3c24xx.c
+++ b/drivers/leds/leds-s3c24xx.c
@@ -65,7 +65,6 @@ static int s3c24xx_led_remove(struct platform_device *dev)
struct s3c24xx_gpio_led *led = pdev_to_gpio(dev);
 
led_classdev_unregister(led-cdev);
-   gpio_free(led-pdata-gpio);
 
return 0;
 }
@@ -92,7 +91,7 @@ static int s3c24xx_led_probe(struct platform_device *dev)
 
led-pdata = pdata;
 
-   ret = gpio_request(pdata-gpio, S3C24XX_LED);
+   ret = devm_gpio_request(dev-dev, pdata-gpio, S3C24XX_LED);
if (ret  0)
return ret;
 
-- 
1.7.9.5

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