RE: [PATCH 5/7] ASoC: fsl: convert pcm030-audio-fabric to a platform-driver

2012-09-19 Thread Eric Millbrandt
On 2012-09-18 Mark Brown wrote:
 On Thu, Sep 13, 2012 at 05:43:14PM -0400, Eric Millbrandt wrote:

 +static int __devexit pcm030_fabric_remove(struct platform_device *op)
 +{ + struct platform_device *pdev = platform_get_drvdata(op); +
 +platform_device_unregister(pdev); + +   return 0; +}

 This seems really confused...  why is a platform device registering
 another platform device?  Do you mean to convert to
 snd_soc_register_card()?

That was an artifact of me splitting the changes to pcm030-audio-fabric.c
into multiple patches.  I changed the driver to a platform device in this
patch and converted to snd_soc_register_card() in the next patch.  I can
merge the two patches back together if you think that is cleaner and
easier to understand.

Thanks
Eric


-DISCLAIMER: an automatically appended disclaimer may follow. By posting-
-to a public e-mail mailing list I hereby grant permission to distribute-
-and copy this message.-

This e-mail and the information, including any attachments, it contains are 
intended to be a confidential communication only to the person or entity to 
whom it is addressed and may contain information that is privileged. If the 
reader of this message is not the intended recipient, you are hereby notified 
that any dissemination, distribution or copying of this communication is 
strictly prohibited. If you have received this communication in error, please 
immediately notify the sender and destroy the original message.

Thank you.

Please consider the environment before printing this email.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 5/7] ASoC: fsl: convert pcm030-audio-fabric to a platform-driver

2012-09-19 Thread Mark Brown
On Wed, Sep 19, 2012 at 10:35:45AM -0400, Eric Millbrandt wrote:

 That was an artifact of me splitting the changes to pcm030-audio-fabric.c
 into multiple patches.  I changed the driver to a platform device in this
 patch and converted to snd_soc_register_card() in the next patch.  I can
 merge the two patches back together if you think that is cleaner and
 easier to understand.

Yes, please.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 5/7] ASoC: fsl: convert pcm030-audio-fabric to a platform-driver

2012-09-18 Thread Mark Brown
On Thu, Sep 13, 2012 at 05:43:14PM -0400, Eric Millbrandt wrote:

 +static int __devexit pcm030_fabric_remove(struct platform_device *op)
 +{
 + struct platform_device *pdev = platform_get_drvdata(op);
 +
 + platform_device_unregister(pdev);
 +
 + return 0;
 +}

This seems really confused...  why is a platform device registering
another platform device?  Do you mean to convert to
snd_soc_register_card()?
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 5/7] ASoC: fsl: convert pcm030-audio-fabric to a platform-driver

2012-09-13 Thread Eric Millbrandt
This patch converts the pcm030-audio-fabric driver to a platform-driver and
adds a remove function.

Signed-off-by: Eric Millbrandt emillbra...@dekaresearch.com

diff --git a/sound/soc/fsl/pcm030-audio-fabric.c 
b/sound/soc/fsl/pcm030-audio-fabric.c
index 1353e8f..5c8e2d6 100644
--- a/sound/soc/fsl/pcm030-audio-fabric.c
+++ b/sound/soc/fsl/pcm030-audio-fabric.c
@@ -48,7 +48,7 @@ static struct snd_soc_card card = {
.num_links = ARRAY_SIZE(pcm030_fabric_dai),
 };
 
-static __init int pcm030_fabric_init(void)
+static int __init pcm030_fabric_probe(struct platform_device *op)
 {
struct platform_device *pdev;
int rc;
@@ -62,6 +62,7 @@ static __init int pcm030_fabric_init(void)
return -ENODEV;
}
 
+   platform_set_drvdata(op, pdev);
platform_set_drvdata(pdev, card);
 
rc = platform_device_add(pdev);
@@ -73,7 +74,32 @@ static __init int pcm030_fabric_init(void)
return 0;
 }
 
-module_init(pcm030_fabric_init);
+static int __devexit pcm030_fabric_remove(struct platform_device *op)
+{
+   struct platform_device *pdev = platform_get_drvdata(op);
+
+   platform_device_unregister(pdev);
+
+   return 0;
+}
+
+static struct of_device_id pcm030_audio_match[] = {
+   { .compatible = phytec,pcm030-audio-fabric, },
+   {}
+};
+MODULE_DEVICE_TABLE(of, pcm030_audio_match);
+
+static struct platform_driver pcm030_fabric_driver = {
+   .probe  = pcm030_fabric_probe,
+   .remove = __devexit_p(pcm030_fabric_remove),
+   .driver = {
+   .name   = DRV_NAME,
+   .owner  = THIS_MODULE,
+   .of_match_table= pcm030_audio_match,
+   },
+};
+
+module_platform_driver(pcm030_fabric_driver);
 
 
 MODULE_AUTHOR(Jon Smirl jonsm...@gmail.com);
-- 
1.7.2.5

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev