diff mbox

[5/6] ASoC: 88pm860x: Remove redundant platform_set_drvdata()

Message ID 1367572164-19523-5-git-send-email-sachin.kamat@linaro.org
State Accepted
Headers show

Commit Message

Sachin Kamat May 3, 2013, 9:09 a.m. UTC
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
---
 sound/soc/codecs/88pm860x-codec.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Comments

Haojian Zhuang May 7, 2013, 1:53 a.m. UTC | #1
On Fri, May 3, 2013 at 5:09 PM, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
> driver is bound) removes the need to set driver data field to
> NULL.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
> ---
>  sound/soc/codecs/88pm860x-codec.c |    9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/sound/soc/codecs/88pm860x-codec.c b/sound/soc/codecs/88pm860x-codec.c
> index 60159c0..1382f3f 100644
> --- a/sound/soc/codecs/88pm860x-codec.c
> +++ b/sound/soc/codecs/88pm860x-codec.c
> @@ -1444,7 +1444,7 @@ static int pm860x_codec_probe(struct platform_device *pdev)
>                 res = platform_get_resource(pdev, IORESOURCE_IRQ, i);
>                 if (!res) {
>                         dev_err(&pdev->dev, "Failed to get IRQ resources\n");
> -                       goto out;
> +                       return -EINVAL;
>                 }
>                 pm860x->irq[i] = res->start + chip->irq_base;
>                 strncpy(pm860x->name[i], res->name, MAX_NAME_LEN);
> @@ -1454,19 +1454,14 @@ static int pm860x_codec_probe(struct platform_device *pdev)
>                                      pm860x_dai, ARRAY_SIZE(pm860x_dai));
>         if (ret) {
>                 dev_err(&pdev->dev, "Failed to register codec\n");
> -               goto out;
> +               return -EINVAL;
>         }
>         return ret;
> -
> -out:
> -       platform_set_drvdata(pdev, NULL);
> -       return -EINVAL;
>  }
>
>  static int pm860x_codec_remove(struct platform_device *pdev)
>  {
>         snd_soc_unregister_codec(&pdev->dev);
> -       platform_set_drvdata(pdev, NULL);
>         return 0;
>  }
>
> --
> 1.7.9.5
>

Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
diff mbox

Patch

diff --git a/sound/soc/codecs/88pm860x-codec.c b/sound/soc/codecs/88pm860x-codec.c
index 60159c0..1382f3f 100644
--- a/sound/soc/codecs/88pm860x-codec.c
+++ b/sound/soc/codecs/88pm860x-codec.c
@@ -1444,7 +1444,7 @@  static int pm860x_codec_probe(struct platform_device *pdev)
 		res = platform_get_resource(pdev, IORESOURCE_IRQ, i);
 		if (!res) {
 			dev_err(&pdev->dev, "Failed to get IRQ resources\n");
-			goto out;
+			return -EINVAL;
 		}
 		pm860x->irq[i] = res->start + chip->irq_base;
 		strncpy(pm860x->name[i], res->name, MAX_NAME_LEN);
@@ -1454,19 +1454,14 @@  static int pm860x_codec_probe(struct platform_device *pdev)
 				     pm860x_dai, ARRAY_SIZE(pm860x_dai));
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to register codec\n");
-		goto out;
+		return -EINVAL;
 	}
 	return ret;
-
-out:
-	platform_set_drvdata(pdev, NULL);
-	return -EINVAL;
 }
 
 static int pm860x_codec_remove(struct platform_device *pdev)
 {
 	snd_soc_unregister_codec(&pdev->dev);
-	platform_set_drvdata(pdev, NULL);
 	return 0;
 }