diff mbox

[V2,1/2] ARM: pxa: spitz: register spitz-audio device

Message ID 1413926133-3566-1-git-send-email-dbaryshkov@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dmitry Baryshkov Oct. 21, 2014, 9:15 p.m. UTC
Register spitz-audio device to be used by ASoC driver.

[V2: Removed ifdefs around spitz_audio_init].

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 arch/arm/mach-pxa/spitz.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Arnd Bergmann Oct. 22, 2014, 8:46 a.m. UTC | #1
On Wednesday 22 October 2014 01:15:32 Dmitry Eremin-Solenikov wrote:
> Register spitz-audio device to be used by ASoC driver.
> 
> [V2: Removed ifdefs around spitz_audio_init].
> 
> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
> ---
> 

A more general note about your patch description above: when you
write about the changes between versions, put that below the ---
line under your Signed-off-by. Aside from that, your changelog
entry would actually benefit from more verbosity: explain what the
purpose of this is, not just what it does. 

>  /**************************************************************************
>  ****> 
> + * Audio devices
> +
> ***************************************************************************
> ***/ +static struct platform_device spitz_audio_device = {
> +       .name   = "spitz-audio",
> +       .id     = -1,
> +};
> +
> +static inline void spitz_audio_init(void)
> +{
> +       platform_device_register(&spitz_audio_device);
> +}+

I realize that the file has more of these, but it would be better
for a number of reasons to use 'platform_device_register_simple'
instead of platform_device_register. statically defining platform
devices (or any other device) is not recommended.

	Arnd
Dmitry Baryshkov Oct. 22, 2014, 9:42 a.m. UTC | #2
2014-10-22 12:46 GMT+04:00 Arnd Bergmann <arnd@arndb.de>:
> On Wednesday 22 October 2014 01:15:32 Dmitry Eremin-Solenikov wrote:
>> Register spitz-audio device to be used by ASoC driver.
>>
>> [V2: Removed ifdefs around spitz_audio_init].
>>
>> Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
>> ---
>>
>
> A more general note about your patch description above: when you
> write about the changes between versions, put that below the ---
> line under your Signed-off-by. Aside from that, your changelog
> entry would actually benefit from more verbosity: explain what the
> purpose of this is, not just what it does.

Thanks. I understood your point regarding the changelog.
The commit message seemed pretty much obvious - due to
the second patch. I can redo it - I think those two patches should
go through different trees, so the connection will be lost.

>
>>  /**************************************************************************
>>  ****>
>> + * Audio devices
>> +
>> ***************************************************************************
>> ***/ +static struct platform_device spitz_audio_device = {
>> +       .name   = "spitz-audio",
>> +       .id     = -1,
>> +};
>> +
>> +static inline void spitz_audio_init(void)
>> +{
>> +       platform_device_register(&spitz_audio_device);
>> +}+
>
> I realize that the file has more of these, but it would be better
> for a number of reasons to use 'platform_device_register_simple'
> instead of platform_device_register. statically defining platform
> devices (or any other device) is not recommended.

Ack. I did not want to use approach different from the rest of
spitz.c, but it looks it is time to change. Will send V3 later today,
after (hopefully)  receiving feedback from ASoC team.
diff mbox

Patch

diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 840c3a4..af1dea3 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -924,6 +924,19 @@  static inline void spitz_i2c_init(void) {}
 #endif
 
 /******************************************************************************
+ * Audio devices
+ ******************************************************************************/
+static struct platform_device spitz_audio_device = {
+	.name	= "spitz-audio",
+	.id	= -1,
+};
+
+static inline void spitz_audio_init(void)
+{
+	platform_device_register(&spitz_audio_device);
+}
+
+/******************************************************************************
  * Machine init
  ******************************************************************************/
 static void spitz_poweroff(void)
@@ -970,6 +983,7 @@  static void __init spitz_init(void)
 	spitz_nor_init();
 	spitz_nand_init();
 	spitz_i2c_init();
+	spitz_audio_init();
 }
 
 static void __init spitz_fixup(struct tag *tags, char **cmdline)