[PATCH 0/2] Re-use DEFINE_SHOW_ATTRIBUTE() macro

2018-06-12 Thread Peng Donglin
...instead of open coding file operations followed by custom ->open()
callbacks per each attribute.

Peng Donglin (2):
  ARM: dump: Convert to use DEFINE_SHOW_ATTRIBUTE macro
  ARM64: dump: Convert to use DEFINE_SHOW_ATTRIBUTE macro

 arch/arm/mm/ptdump_debugfs.c   | 13 +
 arch/arm64/mm/ptdump_debugfs.c | 13 +
 2 files changed, 2 insertions(+), 24 deletions(-)

-- 
2.7.4



[PATCH 2/2] ARM64: dump: Convert to use DEFINE_SHOW_ATTRIBUTE macro

2018-06-12 Thread Peng Donglin
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Peng Donglin 
---
 arch/arm64/mm/ptdump_debugfs.c | 13 +
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/arch/arm64/mm/ptdump_debugfs.c b/arch/arm64/mm/ptdump_debugfs.c
index 02b18f8..24d786f 100644
--- a/arch/arm64/mm/ptdump_debugfs.c
+++ b/arch/arm64/mm/ptdump_debugfs.c
@@ -10,18 +10,7 @@ static int ptdump_show(struct seq_file *m, void *v)
ptdump_walk_pgd(m, info);
return 0;
 }
-
-static int ptdump_open(struct inode *inode, struct file *file)
-{
-   return single_open(file, ptdump_show, inode->i_private);
-}
-
-static const struct file_operations ptdump_fops = {
-   .open   = ptdump_open,
-   .read   = seq_read,
-   .llseek = seq_lseek,
-   .release= single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(ptdump);
 
 int ptdump_debugfs_register(struct ptdump_info *info, const char *name)
 {
-- 
2.7.4



[PATCH 0/2] Re-use DEFINE_SHOW_ATTRIBUTE() macro

2018-06-12 Thread Peng Donglin
...instead of open coding file operations followed by custom ->open()
callbacks per each attribute.

Peng Donglin (2):
  ARM: dump: Convert to use DEFINE_SHOW_ATTRIBUTE macro
  ARM64: dump: Convert to use DEFINE_SHOW_ATTRIBUTE macro

 arch/arm/mm/ptdump_debugfs.c   | 13 +
 arch/arm64/mm/ptdump_debugfs.c | 13 +
 2 files changed, 2 insertions(+), 24 deletions(-)

-- 
2.7.4



[PATCH 2/2] ARM64: dump: Convert to use DEFINE_SHOW_ATTRIBUTE macro

2018-06-12 Thread Peng Donglin
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Peng Donglin 
---
 arch/arm64/mm/ptdump_debugfs.c | 13 +
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/arch/arm64/mm/ptdump_debugfs.c b/arch/arm64/mm/ptdump_debugfs.c
index 02b18f8..24d786f 100644
--- a/arch/arm64/mm/ptdump_debugfs.c
+++ b/arch/arm64/mm/ptdump_debugfs.c
@@ -10,18 +10,7 @@ static int ptdump_show(struct seq_file *m, void *v)
ptdump_walk_pgd(m, info);
return 0;
 }
-
-static int ptdump_open(struct inode *inode, struct file *file)
-{
-   return single_open(file, ptdump_show, inode->i_private);
-}
-
-static const struct file_operations ptdump_fops = {
-   .open   = ptdump_open,
-   .read   = seq_read,
-   .llseek = seq_lseek,
-   .release= single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(ptdump);
 
 int ptdump_debugfs_register(struct ptdump_info *info, const char *name)
 {
-- 
2.7.4



[PATCH 1/2] ARM: dump: Convert to use DEFINE_SHOW_ATTRIBUTE macro

2018-06-12 Thread Peng Donglin
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Peng Donglin 
---
 arch/arm/mm/ptdump_debugfs.c | 13 +
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/arch/arm/mm/ptdump_debugfs.c b/arch/arm/mm/ptdump_debugfs.c
index be8d87b..79002fe 100644
--- a/arch/arm/mm/ptdump_debugfs.c
+++ b/arch/arm/mm/ptdump_debugfs.c
@@ -11,18 +11,7 @@ static int ptdump_show(struct seq_file *m, void *v)
ptdump_walk_pgd(m, info);
return 0;
 }
-
-static int ptdump_open(struct inode *inode, struct file *file)
-{
-   return single_open(file, ptdump_show, inode->i_private);
-}
-
-static const struct file_operations ptdump_fops = {
-   .open   = ptdump_open,
-   .read   = seq_read,
-   .llseek = seq_lseek,
-   .release= single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(ptdump);
 
 int ptdump_debugfs_register(struct ptdump_info *info, const char *name)
 {
-- 
2.7.4



[PATCH 1/2] ARM: dump: Convert to use DEFINE_SHOW_ATTRIBUTE macro

2018-06-12 Thread Peng Donglin
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Peng Donglin 
---
 arch/arm/mm/ptdump_debugfs.c | 13 +
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/arch/arm/mm/ptdump_debugfs.c b/arch/arm/mm/ptdump_debugfs.c
index be8d87b..79002fe 100644
--- a/arch/arm/mm/ptdump_debugfs.c
+++ b/arch/arm/mm/ptdump_debugfs.c
@@ -11,18 +11,7 @@ static int ptdump_show(struct seq_file *m, void *v)
ptdump_walk_pgd(m, info);
return 0;
 }
-
-static int ptdump_open(struct inode *inode, struct file *file)
-{
-   return single_open(file, ptdump_show, inode->i_private);
-}
-
-static const struct file_operations ptdump_fops = {
-   .open   = ptdump_open,
-   .read   = seq_read,
-   .llseek = seq_lseek,
-   .release= single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(ptdump);
 
 int ptdump_debugfs_register(struct ptdump_info *info, const char *name)
 {
-- 
2.7.4



[PATCH v4] ASoC: use DEFINE_SHOW_ATTRIBUTE() to decrease code duplication

2018-02-14 Thread Peng Donglin
There is some duplicate code in soc-core.c, and the kernel provides
DEFINE_SHOW_ATTRIBUTE() helper macro to decrease it in seq_file.h.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevche...@gmail.com>
---
v4:
 * resend patch using outlook email, because I can't disable gmail
   word wrap in plain text mode

v3: [addressed comments from Andy]
 * add missing tag

v2: [addressed comments from Andy]
 * modify code change description
 * do not rename m -> s

---
 sound/soc/soc-core.c | 45 ++---
 1 file changed, 6 insertions(+), 39 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 96c44f6..f372f34 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -349,7 +349,7 @@ static void soc_init_codec_debugfs(struct snd_soc_component 
*component)
"ASoC: Failed to create codec register debugfs file\n");
 }
 
-static int codec_list_seq_show(struct seq_file *m, void *v)
+static int codec_list_show(struct seq_file *m, void *v)
 {
struct snd_soc_codec *codec;
 
@@ -362,20 +362,9 @@ static int codec_list_seq_show(struct seq_file *m, void *v)
 
return 0;
 }
+DEFINE_SHOW_ATTRIBUTE(codec_list);
 
-static int codec_list_seq_open(struct inode *inode, struct file *file)
-{
-   return single_open(file, codec_list_seq_show, NULL);
-}
-
-static const struct file_operations codec_list_fops = {
-   .open = codec_list_seq_open,
-   .read = seq_read,
-   .llseek = seq_lseek,
-   .release = single_release,
-};
-
-static int dai_list_seq_show(struct seq_file *m, void *v)
+static int dai_list_show(struct seq_file *m, void *v)
 {
struct snd_soc_component *component;
struct snd_soc_dai *dai;
@@ -390,20 +379,9 @@ static int dai_list_seq_show(struct seq_file *m, void *v)
 
return 0;
 }
+DEFINE_SHOW_ATTRIBUTE(dai_list);
 
-static int dai_list_seq_open(struct inode *inode, struct file *file)
-{
-   return single_open(file, dai_list_seq_show, NULL);
-}
-
-static const struct file_operations dai_list_fops = {
-   .open = dai_list_seq_open,
-   .read = seq_read,
-   .llseek = seq_lseek,
-   .release = single_release,
-};
-
-static int platform_list_seq_show(struct seq_file *m, void *v)
+static int platform_list_show(struct seq_file *m, void *v)
 {
struct snd_soc_platform *platform;
 
@@ -416,18 +394,7 @@ static int platform_list_seq_show(struct seq_file *m, void 
*v)
 
return 0;
 }
-
-static int platform_list_seq_open(struct inode *inode, struct file *file)
-{
-   return single_open(file, platform_list_seq_show, NULL);
-}
-
-static const struct file_operations platform_list_fops = {
-   .open = platform_list_seq_open,
-   .read = seq_read,
-   .llseek = seq_lseek,
-   .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(platform_list);
 
 static void soc_init_card_debugfs(struct snd_soc_card *card)
 {
-- 
2.7.4



[PATCH v4] ASoC: use DEFINE_SHOW_ATTRIBUTE() to decrease code duplication

2018-02-14 Thread Peng Donglin
There is some duplicate code in soc-core.c, and the kernel provides
DEFINE_SHOW_ATTRIBUTE() helper macro to decrease it in seq_file.h.

Signed-off-by: Peng Donglin 
Reviewed-by: Andy Shevchenko 
---
v4:
 * resend patch using outlook email, because I can't disable gmail
   word wrap in plain text mode

v3: [addressed comments from Andy]
 * add missing tag

v2: [addressed comments from Andy]
 * modify code change description
 * do not rename m -> s

---
 sound/soc/soc-core.c | 45 ++---
 1 file changed, 6 insertions(+), 39 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 96c44f6..f372f34 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -349,7 +349,7 @@ static void soc_init_codec_debugfs(struct snd_soc_component 
*component)
"ASoC: Failed to create codec register debugfs file\n");
 }
 
-static int codec_list_seq_show(struct seq_file *m, void *v)
+static int codec_list_show(struct seq_file *m, void *v)
 {
struct snd_soc_codec *codec;
 
@@ -362,20 +362,9 @@ static int codec_list_seq_show(struct seq_file *m, void *v)
 
return 0;
 }
+DEFINE_SHOW_ATTRIBUTE(codec_list);
 
-static int codec_list_seq_open(struct inode *inode, struct file *file)
-{
-   return single_open(file, codec_list_seq_show, NULL);
-}
-
-static const struct file_operations codec_list_fops = {
-   .open = codec_list_seq_open,
-   .read = seq_read,
-   .llseek = seq_lseek,
-   .release = single_release,
-};
-
-static int dai_list_seq_show(struct seq_file *m, void *v)
+static int dai_list_show(struct seq_file *m, void *v)
 {
struct snd_soc_component *component;
struct snd_soc_dai *dai;
@@ -390,20 +379,9 @@ static int dai_list_seq_show(struct seq_file *m, void *v)
 
return 0;
 }
+DEFINE_SHOW_ATTRIBUTE(dai_list);
 
-static int dai_list_seq_open(struct inode *inode, struct file *file)
-{
-   return single_open(file, dai_list_seq_show, NULL);
-}
-
-static const struct file_operations dai_list_fops = {
-   .open = dai_list_seq_open,
-   .read = seq_read,
-   .llseek = seq_lseek,
-   .release = single_release,
-};
-
-static int platform_list_seq_show(struct seq_file *m, void *v)
+static int platform_list_show(struct seq_file *m, void *v)
 {
struct snd_soc_platform *platform;
 
@@ -416,18 +394,7 @@ static int platform_list_seq_show(struct seq_file *m, void 
*v)
 
return 0;
 }
-
-static int platform_list_seq_open(struct inode *inode, struct file *file)
-{
-   return single_open(file, platform_list_seq_show, NULL);
-}
-
-static const struct file_operations platform_list_fops = {
-   .open = platform_list_seq_open,
-   .read = seq_read,
-   .llseek = seq_lseek,
-   .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(platform_list);
 
 static void soc_init_card_debugfs(struct snd_soc_card *card)
 {
-- 
2.7.4



[PATCH] ASoC: use DEFINE_SHOW_ATTRIBUTE() to decrease code duplication

2018-02-08 Thread Peng Donglin
There is some duplicate code in soc-core.c,and the kernel provides
DEFINE_SHOW_ATTRIBUTE() helper macro to decrease it in seq_file.h.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/soc-core.c | 51 +--
 1 file changed, 9 insertions(+), 42 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 96c44f6576c9..cb52d1e8e0b9 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -349,33 +349,22 @@ static void soc_init_codec_debugfs(struct 
snd_soc_component *component)
"ASoC: Failed to create codec register debugfs file\n");
 }
 
-static int codec_list_seq_show(struct seq_file *m, void *v)
+static int codec_list_show(struct seq_file *s, void *v)
 {
struct snd_soc_codec *codec;
 
mutex_lock(_mutex);
 
list_for_each_entry(codec, _list, list)
-   seq_printf(m, "%s\n", codec->component.name);
+   seq_printf(s, "%s\n", codec->component.name);
 
mutex_unlock(_mutex);
 
return 0;
 }
+DEFINE_SHOW_ATTRIBUTE(codec_list);
 
-static int codec_list_seq_open(struct inode *inode, struct file *file)
-{
-   return single_open(file, codec_list_seq_show, NULL);
-}
-
-static const struct file_operations codec_list_fops = {
-   .open = codec_list_seq_open,
-   .read = seq_read,
-   .llseek = seq_lseek,
-   .release = single_release,
-};
-
-static int dai_list_seq_show(struct seq_file *m, void *v)
+static int dai_list_show(struct seq_file *s, void *v)
 {
struct snd_soc_component *component;
struct snd_soc_dai *dai;
@@ -384,50 +373,28 @@ static int dai_list_seq_show(struct seq_file *m, void *v)
 
list_for_each_entry(component, _list, list)
list_for_each_entry(dai, >dai_list, list)
-   seq_printf(m, "%s\n", dai->name);
+   seq_printf(s, "%s\n", dai->name);
 
mutex_unlock(_mutex);
 
return 0;
 }
+DEFINE_SHOW_ATTRIBUTE(dai_list);
 
-static int dai_list_seq_open(struct inode *inode, struct file *file)
-{
-   return single_open(file, dai_list_seq_show, NULL);
-}
-
-static const struct file_operations dai_list_fops = {
-   .open = dai_list_seq_open,
-   .read = seq_read,
-   .llseek = seq_lseek,
-   .release = single_release,
-};
-
-static int platform_list_seq_show(struct seq_file *m, void *v)
+static int platform_list_show(struct seq_file *s, void *v)
 {
struct snd_soc_platform *platform;
 
mutex_lock(_mutex);
 
list_for_each_entry(platform, _list, list)
-   seq_printf(m, "%s\n", platform->component.name);
+   seq_printf(s, "%s\n", platform->component.name);
 
mutex_unlock(_mutex);
 
return 0;
 }
-
-static int platform_list_seq_open(struct inode *inode, struct file *file)
-{
-   return single_open(file, platform_list_seq_show, NULL);
-}
-
-static const struct file_operations platform_list_fops = {
-   .open = platform_list_seq_open,
-   .read = seq_read,
-   .llseek = seq_lseek,
-   .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(platform_list);
 
 static void soc_init_card_debugfs(struct snd_soc_card *card)
 {
-- 
2.16.1



[PATCH] ASoC: use DEFINE_SHOW_ATTRIBUTE() to decrease code duplication

2018-02-08 Thread Peng Donglin
There is some duplicate code in soc-core.c,and the kernel provides
DEFINE_SHOW_ATTRIBUTE() helper macro to decrease it in seq_file.h.

Signed-off-by: Peng Donglin 
---
 sound/soc/soc-core.c | 51 +--
 1 file changed, 9 insertions(+), 42 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 96c44f6576c9..cb52d1e8e0b9 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -349,33 +349,22 @@ static void soc_init_codec_debugfs(struct 
snd_soc_component *component)
"ASoC: Failed to create codec register debugfs file\n");
 }
 
-static int codec_list_seq_show(struct seq_file *m, void *v)
+static int codec_list_show(struct seq_file *s, void *v)
 {
struct snd_soc_codec *codec;
 
mutex_lock(_mutex);
 
list_for_each_entry(codec, _list, list)
-   seq_printf(m, "%s\n", codec->component.name);
+   seq_printf(s, "%s\n", codec->component.name);
 
mutex_unlock(_mutex);
 
return 0;
 }
+DEFINE_SHOW_ATTRIBUTE(codec_list);
 
-static int codec_list_seq_open(struct inode *inode, struct file *file)
-{
-   return single_open(file, codec_list_seq_show, NULL);
-}
-
-static const struct file_operations codec_list_fops = {
-   .open = codec_list_seq_open,
-   .read = seq_read,
-   .llseek = seq_lseek,
-   .release = single_release,
-};
-
-static int dai_list_seq_show(struct seq_file *m, void *v)
+static int dai_list_show(struct seq_file *s, void *v)
 {
struct snd_soc_component *component;
struct snd_soc_dai *dai;
@@ -384,50 +373,28 @@ static int dai_list_seq_show(struct seq_file *m, void *v)
 
list_for_each_entry(component, _list, list)
list_for_each_entry(dai, >dai_list, list)
-   seq_printf(m, "%s\n", dai->name);
+   seq_printf(s, "%s\n", dai->name);
 
mutex_unlock(_mutex);
 
return 0;
 }
+DEFINE_SHOW_ATTRIBUTE(dai_list);
 
-static int dai_list_seq_open(struct inode *inode, struct file *file)
-{
-   return single_open(file, dai_list_seq_show, NULL);
-}
-
-static const struct file_operations dai_list_fops = {
-   .open = dai_list_seq_open,
-   .read = seq_read,
-   .llseek = seq_lseek,
-   .release = single_release,
-};
-
-static int platform_list_seq_show(struct seq_file *m, void *v)
+static int platform_list_show(struct seq_file *s, void *v)
 {
struct snd_soc_platform *platform;
 
mutex_lock(_mutex);
 
list_for_each_entry(platform, _list, list)
-   seq_printf(m, "%s\n", platform->component.name);
+   seq_printf(s, "%s\n", platform->component.name);
 
mutex_unlock(_mutex);
 
return 0;
 }
-
-static int platform_list_seq_open(struct inode *inode, struct file *file)
-{
-   return single_open(file, platform_list_seq_show, NULL);
-}
-
-static const struct file_operations platform_list_fops = {
-   .open = platform_list_seq_open,
-   .read = seq_read,
-   .llseek = seq_lseek,
-   .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(platform_list);
 
 static void soc_init_card_debugfs(struct snd_soc_card *card)
 {
-- 
2.16.1



[PATCH] ASoC: use seq_file to dump the contents of dai_list, platoform_list and codec_list

2018-01-17 Thread Peng Donglin
Now the debugfs files dais/codecs/platforms have a size limit PAGE_SIZE and
the user can not see the whole contents of dai_list/platform_list/codec_list
when they are larger than this limit.

This patch uses seq_file instead to make sure dais/platforms/codecs show the
full contents of dai_list/platform_list/codec_list.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/soc-core.c | 111 +--
 1 file changed, 37 insertions(+), 74 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index c0edac8..7b58211 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -349,120 +349,84 @@ static void soc_init_codec_debugfs(struct 
snd_soc_component *component)
"ASoC: Failed to create codec register debugfs file\n");
 }
 
-static ssize_t codec_list_read_file(struct file *file, char __user *user_buf,
-   size_t count, loff_t *ppos)
+static int codec_list_seq_show(struct seq_file *m, void *v)
 {
-   char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
-   ssize_t len, ret = 0;
struct snd_soc_codec *codec;
 
-   if (!buf)
-   return -ENOMEM;
-
mutex_lock(_mutex);
 
-   list_for_each_entry(codec, _list, list) {
-   len = snprintf(buf + ret, PAGE_SIZE - ret, "%s\n",
-  codec->component.name);
-   if (len >= 0)
-   ret += len;
-   if (ret > PAGE_SIZE) {
-   ret = PAGE_SIZE;
-   break;
-   }
-   }
+   list_for_each_entry(codec, _list, list)
+   seq_printf(m, "%s\n", codec->component.name);
 
mutex_unlock(_mutex);
 
-   if (ret >= 0)
-   ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
-
-   kfree(buf);
+   return 0;
+}
 
-   return ret;
+static int codec_list_seq_open(struct inode *inode, struct file *file)
+{
+   return single_open(file, codec_list_seq_show, NULL);
 }
 
 static const struct file_operations codec_list_fops = {
-   .read = codec_list_read_file,
-   .llseek = default_llseek,/* read accesses f_pos */
+   .open = codec_list_seq_open,
+   .read = seq_read,
+   .llseek = seq_lseek,
+   .release = single_release,
 };
 
-static ssize_t dai_list_read_file(struct file *file, char __user *user_buf,
- size_t count, loff_t *ppos)
+static int dai_list_seq_show(struct seq_file *m, void *v)
 {
-   char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
-   ssize_t len, ret = 0;
struct snd_soc_component *component;
struct snd_soc_dai *dai;
 
-   if (!buf)
-   return -ENOMEM;
-
mutex_lock(_mutex);
 
-   list_for_each_entry(component, _list, list) {
-   list_for_each_entry(dai, >dai_list, list) {
-   len = snprintf(buf + ret, PAGE_SIZE - ret, "%s\n",
-   dai->name);
-   if (len >= 0)
-   ret += len;
-   if (ret > PAGE_SIZE) {
-   ret = PAGE_SIZE;
-   break;
-   }
-   }
-   }
+   list_for_each_entry(component, _list, list)
+   list_for_each_entry(dai, >dai_list, list)
+   seq_printf(m, "%s\n", dai->name);
 
mutex_unlock(_mutex);
 
-   ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
-
-   kfree(buf);
+   return 0;
+}
 
-   return ret;
+static int dai_list_seq_open(struct inode *inode, struct file *file)
+{
+   return single_open(file, dai_list_seq_show, NULL);
 }
 
 static const struct file_operations dai_list_fops = {
-   .read = dai_list_read_file,
-   .llseek = default_llseek,/* read accesses f_pos */
+   .open = dai_list_seq_open,
+   .read = seq_read,
+   .llseek = seq_lseek,
+   .release = single_release,
 };
 
-static ssize_t platform_list_read_file(struct file *file,
-  char __user *user_buf,
-  size_t count, loff_t *ppos)
+static int platform_list_seq_show(struct seq_file *m, void *v)
 {
-   char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
-   ssize_t len, ret = 0;
struct snd_soc_platform *platform;
 
-   if (!buf)
-   return -ENOMEM;
-
mutex_lock(_mutex);
 
-   list_for_each_entry(platform, _list, list) {
-   len = snprintf(buf + ret, PAGE_SIZE - ret, "%s\n",
-  platform->component.name);
-   if (len >= 0)
-   ret += len;
-   if (ret > PAGE_SIZE) {
-   ret = PAGE_SIZE;
-   break;
-   

[PATCH] ASoC: use seq_file to dump the contents of dai_list, platoform_list and codec_list

2018-01-17 Thread Peng Donglin
Now the debugfs files dais/codecs/platforms have a size limit PAGE_SIZE and
the user can not see the whole contents of dai_list/platform_list/codec_list
when they are larger than this limit.

This patch uses seq_file instead to make sure dais/platforms/codecs show the
full contents of dai_list/platform_list/codec_list.

Signed-off-by: Peng Donglin 
---
 sound/soc/soc-core.c | 111 +--
 1 file changed, 37 insertions(+), 74 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index c0edac8..7b58211 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -349,120 +349,84 @@ static void soc_init_codec_debugfs(struct 
snd_soc_component *component)
"ASoC: Failed to create codec register debugfs file\n");
 }
 
-static ssize_t codec_list_read_file(struct file *file, char __user *user_buf,
-   size_t count, loff_t *ppos)
+static int codec_list_seq_show(struct seq_file *m, void *v)
 {
-   char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
-   ssize_t len, ret = 0;
struct snd_soc_codec *codec;
 
-   if (!buf)
-   return -ENOMEM;
-
mutex_lock(_mutex);
 
-   list_for_each_entry(codec, _list, list) {
-   len = snprintf(buf + ret, PAGE_SIZE - ret, "%s\n",
-  codec->component.name);
-   if (len >= 0)
-   ret += len;
-   if (ret > PAGE_SIZE) {
-   ret = PAGE_SIZE;
-   break;
-   }
-   }
+   list_for_each_entry(codec, _list, list)
+   seq_printf(m, "%s\n", codec->component.name);
 
mutex_unlock(_mutex);
 
-   if (ret >= 0)
-   ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
-
-   kfree(buf);
+   return 0;
+}
 
-   return ret;
+static int codec_list_seq_open(struct inode *inode, struct file *file)
+{
+   return single_open(file, codec_list_seq_show, NULL);
 }
 
 static const struct file_operations codec_list_fops = {
-   .read = codec_list_read_file,
-   .llseek = default_llseek,/* read accesses f_pos */
+   .open = codec_list_seq_open,
+   .read = seq_read,
+   .llseek = seq_lseek,
+   .release = single_release,
 };
 
-static ssize_t dai_list_read_file(struct file *file, char __user *user_buf,
- size_t count, loff_t *ppos)
+static int dai_list_seq_show(struct seq_file *m, void *v)
 {
-   char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
-   ssize_t len, ret = 0;
struct snd_soc_component *component;
struct snd_soc_dai *dai;
 
-   if (!buf)
-   return -ENOMEM;
-
mutex_lock(_mutex);
 
-   list_for_each_entry(component, _list, list) {
-   list_for_each_entry(dai, >dai_list, list) {
-   len = snprintf(buf + ret, PAGE_SIZE - ret, "%s\n",
-   dai->name);
-   if (len >= 0)
-   ret += len;
-   if (ret > PAGE_SIZE) {
-   ret = PAGE_SIZE;
-   break;
-   }
-   }
-   }
+   list_for_each_entry(component, _list, list)
+   list_for_each_entry(dai, >dai_list, list)
+   seq_printf(m, "%s\n", dai->name);
 
mutex_unlock(_mutex);
 
-   ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
-
-   kfree(buf);
+   return 0;
+}
 
-   return ret;
+static int dai_list_seq_open(struct inode *inode, struct file *file)
+{
+   return single_open(file, dai_list_seq_show, NULL);
 }
 
 static const struct file_operations dai_list_fops = {
-   .read = dai_list_read_file,
-   .llseek = default_llseek,/* read accesses f_pos */
+   .open = dai_list_seq_open,
+   .read = seq_read,
+   .llseek = seq_lseek,
+   .release = single_release,
 };
 
-static ssize_t platform_list_read_file(struct file *file,
-  char __user *user_buf,
-  size_t count, loff_t *ppos)
+static int platform_list_seq_show(struct seq_file *m, void *v)
 {
-   char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
-   ssize_t len, ret = 0;
struct snd_soc_platform *platform;
 
-   if (!buf)
-   return -ENOMEM;
-
mutex_lock(_mutex);
 
-   list_for_each_entry(platform, _list, list) {
-   len = snprintf(buf + ret, PAGE_SIZE - ret, "%s\n",
-  platform->component.name);
-   if (len >= 0)
-   ret += len;
-   if (ret > PAGE_SIZE) {
-   ret = PAGE_SIZE;
-   break;
-   }
-

[PATCH] ASoC: dapm: Fix typos in comment

2017-09-27 Thread Peng Donglin
Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/soc-dapm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index dcef67a..0867eaa 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -4167,7 +4167,7 @@ void snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime 
*rtd, int stream,
  * @dapm: DAPM context
  * @pin: pin name
  *
- * Enables input/output pin and its parents or children widgets iff there is
+ * Enables input/output pin and its parents or children widgets if there is
  * a valid audio route and active audio stream.
  *
  * Requires external locking.
@@ -4187,7 +4187,7 @@ int snd_soc_dapm_enable_pin_unlocked(struct 
snd_soc_dapm_context *dapm,
  * @dapm: DAPM context
  * @pin: pin name
  *
- * Enables input/output pin and its parents or children widgets iff there is
+ * Enables input/output pin and its parents or children widgets if there is
  * a valid audio route and active audio stream.
  *
  * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to
-- 
1.9.1



[PATCH] ASoC: dapm: Fix typos in comment

2017-09-27 Thread Peng Donglin
Signed-off-by: Peng Donglin 
---
 sound/soc/soc-dapm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index dcef67a..0867eaa 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -4167,7 +4167,7 @@ void snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime 
*rtd, int stream,
  * @dapm: DAPM context
  * @pin: pin name
  *
- * Enables input/output pin and its parents or children widgets iff there is
+ * Enables input/output pin and its parents or children widgets if there is
  * a valid audio route and active audio stream.
  *
  * Requires external locking.
@@ -4187,7 +4187,7 @@ int snd_soc_dapm_enable_pin_unlocked(struct 
snd_soc_dapm_context *dapm,
  * @dapm: DAPM context
  * @pin: pin name
  *
- * Enables input/output pin and its parents or children widgets iff there is
+ * Enables input/output pin and its parents or children widgets if there is
  * a valid audio route and active audio stream.
  *
  * NOTE: snd_soc_dapm_sync() needs to be called after this for DAPM to
-- 
1.9.1



[PATCH v2 10/10] ASoC: ux500: Remove unnecessary function call

2017-08-23 Thread Peng Donglin
The work of the function platform_set_drvdata is done by
devm_snd_soc_register_card.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/ux500/mop500.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/ux500/mop500.c b/sound/soc/ux500/mop500.c
index ba9fc099cf67..070a6880980e 100644
--- a/sound/soc/ux500/mop500.c
+++ b/sound/soc/ux500/mop500.c
@@ -115,7 +115,6 @@ static int mop500_probe(struct platform_device *pdev)
 
dev_dbg(>dev, "%s: Card %s: Set platform drvdata.\n",
__func__, mop500_card.name);
-   platform_set_drvdata(pdev, _card);
 
snd_soc_card_set_drvdata(_card, NULL);
 
-- 
2.14.1



[PATCH v2 10/10] ASoC: ux500: Remove unnecessary function call

2017-08-23 Thread Peng Donglin
The work of the function platform_set_drvdata is done by
devm_snd_soc_register_card.

Signed-off-by: Peng Donglin 
---
 sound/soc/ux500/mop500.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/ux500/mop500.c b/sound/soc/ux500/mop500.c
index ba9fc099cf67..070a6880980e 100644
--- a/sound/soc/ux500/mop500.c
+++ b/sound/soc/ux500/mop500.c
@@ -115,7 +115,6 @@ static int mop500_probe(struct platform_device *pdev)
 
dev_dbg(>dev, "%s: Card %s: Set platform drvdata.\n",
__func__, mop500_card.name);
-   platform_set_drvdata(pdev, _card);
 
snd_soc_card_set_drvdata(_card, NULL);
 
-- 
2.14.1



[PATCH v2 09/10] ASoC: tegra: Remove unnecessary function call

2017-08-23 Thread Peng Donglin
The work of the function platform_set_drvdata is done by
devm_snd_soc_register_card.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/tegra/tegra_alc5632.c  | 1 -
 sound/soc/tegra/tegra_max98090.c | 1 -
 sound/soc/tegra/tegra_rt5640.c   | 1 -
 sound/soc/tegra/tegra_rt5677.c   | 1 -
 sound/soc/tegra/tegra_sgtl5000.c | 1 -
 sound/soc/tegra/tegra_wm8753.c   | 1 -
 sound/soc/tegra/tegra_wm8903.c   | 1 -
 sound/soc/tegra/tegra_wm9712.c   | 1 -
 sound/soc/tegra/trimslice.c  | 1 -
 9 files changed, 9 deletions(-)

diff --git a/sound/soc/tegra/tegra_alc5632.c b/sound/soc/tegra/tegra_alc5632.c
index 0509902512cc..053fe4c5ed4c 100644
--- a/sound/soc/tegra/tegra_alc5632.c
+++ b/sound/soc/tegra/tegra_alc5632.c
@@ -173,7 +173,6 @@ static int tegra_alc5632_probe(struct platform_device *pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, alc5632);
 
alc5632->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0);
diff --git a/sound/soc/tegra/tegra_max98090.c b/sound/soc/tegra/tegra_max98090.c
index c34a54d6e812..41feee9beb12 100644
--- a/sound/soc/tegra/tegra_max98090.c
+++ b/sound/soc/tegra/tegra_max98090.c
@@ -229,7 +229,6 @@ static int tegra_max98090_probe(struct platform_device 
*pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
machine->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0);
diff --git a/sound/soc/tegra/tegra_rt5640.c b/sound/soc/tegra/tegra_rt5640.c
index 93a356802345..02f27fe14324 100644
--- a/sound/soc/tegra/tegra_rt5640.c
+++ b/sound/soc/tegra/tegra_rt5640.c
@@ -174,7 +174,6 @@ static int tegra_rt5640_probe(struct platform_device *pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
machine->gpio_hp_det = of_get_named_gpio_flags(
diff --git a/sound/soc/tegra/tegra_rt5677.c b/sound/soc/tegra/tegra_rt5677.c
index ebf58d0e0f10..3dbf0e1350c1 100644
--- a/sound/soc/tegra/tegra_rt5677.c
+++ b/sound/soc/tegra/tegra_rt5677.c
@@ -222,7 +222,6 @@ static int tegra_rt5677_probe(struct platform_device *pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
machine->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0);
diff --git a/sound/soc/tegra/tegra_sgtl5000.c b/sound/soc/tegra/tegra_sgtl5000.c
index 6dda01f69983..45a4aa9d2a47 100644
--- a/sound/soc/tegra/tegra_sgtl5000.c
+++ b/sound/soc/tegra/tegra_sgtl5000.c
@@ -124,7 +124,6 @@ static int tegra_sgtl5000_driver_probe(struct 
platform_device *pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
ret = snd_soc_of_parse_card_name(card, "nvidia,model");
diff --git a/sound/soc/tegra/tegra_wm8753.c b/sound/soc/tegra/tegra_wm8753.c
index d0ab0026a4cd..23a810e3bacc 100644
--- a/sound/soc/tegra/tegra_wm8753.c
+++ b/sound/soc/tegra/tegra_wm8753.c
@@ -132,7 +132,6 @@ static int tegra_wm8753_driver_probe(struct platform_device 
*pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
ret = snd_soc_of_parse_card_name(card, "nvidia,model");
diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c
index dbfb49298ae8..d4a4a2be8b42 100644
--- a/sound/soc/tegra/tegra_wm8903.c
+++ b/sound/soc/tegra/tegra_wm8903.c
@@ -252,7 +252,6 @@ static int tegra_wm8903_driver_probe(struct platform_device 
*pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
machine->gpio_spkr_en = of_get_named_gpio(np, "nvidia,spkr-en-gpios",
diff --git a/sound/soc/tegra/tegra_wm9712.c b/sound/soc/tegra/tegra_wm9712.c
index c9cd22432627..864a3345972e 100644
--- a/sound/soc/tegra/tegra_wm9712.c
+++ b/sound/soc/tegra/tegra_wm9712.c
@@ -81,7 +81,6 @@ static int tegra_wm9712_driver_probe(struct platform_device 
*pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
machine->codec = platform_device_alloc("wm9712-codec", -1);
diff --git a/sound/soc/tegra/trimslice.c b/sound/soc/tegra/trimslice.c
index c9dcad9bb931..99bcdd979eb2 100644
--- a/sound/soc/tegra/trimslice.c
+++ b/sound/soc/tegra/trimslice.c
@@ -127,7 +127,6 @@ static int tegra_snd_trimslice_probe(struct platform_device 
*pdev)

[PATCH v2 09/10] ASoC: tegra: Remove unnecessary function call

2017-08-23 Thread Peng Donglin
The work of the function platform_set_drvdata is done by
devm_snd_soc_register_card.

Signed-off-by: Peng Donglin 
---
 sound/soc/tegra/tegra_alc5632.c  | 1 -
 sound/soc/tegra/tegra_max98090.c | 1 -
 sound/soc/tegra/tegra_rt5640.c   | 1 -
 sound/soc/tegra/tegra_rt5677.c   | 1 -
 sound/soc/tegra/tegra_sgtl5000.c | 1 -
 sound/soc/tegra/tegra_wm8753.c   | 1 -
 sound/soc/tegra/tegra_wm8903.c   | 1 -
 sound/soc/tegra/tegra_wm9712.c   | 1 -
 sound/soc/tegra/trimslice.c  | 1 -
 9 files changed, 9 deletions(-)

diff --git a/sound/soc/tegra/tegra_alc5632.c b/sound/soc/tegra/tegra_alc5632.c
index 0509902512cc..053fe4c5ed4c 100644
--- a/sound/soc/tegra/tegra_alc5632.c
+++ b/sound/soc/tegra/tegra_alc5632.c
@@ -173,7 +173,6 @@ static int tegra_alc5632_probe(struct platform_device *pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, alc5632);
 
alc5632->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0);
diff --git a/sound/soc/tegra/tegra_max98090.c b/sound/soc/tegra/tegra_max98090.c
index c34a54d6e812..41feee9beb12 100644
--- a/sound/soc/tegra/tegra_max98090.c
+++ b/sound/soc/tegra/tegra_max98090.c
@@ -229,7 +229,6 @@ static int tegra_max98090_probe(struct platform_device 
*pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
machine->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0);
diff --git a/sound/soc/tegra/tegra_rt5640.c b/sound/soc/tegra/tegra_rt5640.c
index 93a356802345..02f27fe14324 100644
--- a/sound/soc/tegra/tegra_rt5640.c
+++ b/sound/soc/tegra/tegra_rt5640.c
@@ -174,7 +174,6 @@ static int tegra_rt5640_probe(struct platform_device *pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
machine->gpio_hp_det = of_get_named_gpio_flags(
diff --git a/sound/soc/tegra/tegra_rt5677.c b/sound/soc/tegra/tegra_rt5677.c
index ebf58d0e0f10..3dbf0e1350c1 100644
--- a/sound/soc/tegra/tegra_rt5677.c
+++ b/sound/soc/tegra/tegra_rt5677.c
@@ -222,7 +222,6 @@ static int tegra_rt5677_probe(struct platform_device *pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
machine->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0);
diff --git a/sound/soc/tegra/tegra_sgtl5000.c b/sound/soc/tegra/tegra_sgtl5000.c
index 6dda01f69983..45a4aa9d2a47 100644
--- a/sound/soc/tegra/tegra_sgtl5000.c
+++ b/sound/soc/tegra/tegra_sgtl5000.c
@@ -124,7 +124,6 @@ static int tegra_sgtl5000_driver_probe(struct 
platform_device *pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
ret = snd_soc_of_parse_card_name(card, "nvidia,model");
diff --git a/sound/soc/tegra/tegra_wm8753.c b/sound/soc/tegra/tegra_wm8753.c
index d0ab0026a4cd..23a810e3bacc 100644
--- a/sound/soc/tegra/tegra_wm8753.c
+++ b/sound/soc/tegra/tegra_wm8753.c
@@ -132,7 +132,6 @@ static int tegra_wm8753_driver_probe(struct platform_device 
*pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
ret = snd_soc_of_parse_card_name(card, "nvidia,model");
diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c
index dbfb49298ae8..d4a4a2be8b42 100644
--- a/sound/soc/tegra/tegra_wm8903.c
+++ b/sound/soc/tegra/tegra_wm8903.c
@@ -252,7 +252,6 @@ static int tegra_wm8903_driver_probe(struct platform_device 
*pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
machine->gpio_spkr_en = of_get_named_gpio(np, "nvidia,spkr-en-gpios",
diff --git a/sound/soc/tegra/tegra_wm9712.c b/sound/soc/tegra/tegra_wm9712.c
index c9cd22432627..864a3345972e 100644
--- a/sound/soc/tegra/tegra_wm9712.c
+++ b/sound/soc/tegra/tegra_wm9712.c
@@ -81,7 +81,6 @@ static int tegra_wm9712_driver_probe(struct platform_device 
*pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
machine->codec = platform_device_alloc("wm9712-codec", -1);
diff --git a/sound/soc/tegra/trimslice.c b/sound/soc/tegra/trimslice.c
index c9dcad9bb931..99bcdd979eb2 100644
--- a/sound/soc/tegra/trimslice.c
+++ b/sound/soc/tegra/trimslice.c
@@ -127,7 +127,6 @@ static int tegra_snd_trimslice_probe(struct platform_device 
*pdev)
  

[PATCH v2 08/10] ASoC: sun4i-codec: Remove unnecessary function call

2017-08-23 Thread Peng Donglin
The work of the function platform_set_drvdata is done by
devm_snd_soc_register_card.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/sunxi/sun4i-codec.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index 150069987c0c..82beeae8edc5 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -1655,7 +1655,6 @@ static int sun4i_codec_probe(struct platform_device *pdev)
goto err_unregister_codec;
}
 
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, scodec);
 
ret = snd_soc_register_card(card);
-- 
2.14.1



[PATCH v2 08/10] ASoC: sun4i-codec: Remove unnecessary function call

2017-08-23 Thread Peng Donglin
The work of the function platform_set_drvdata is done by
devm_snd_soc_register_card.

Signed-off-by: Peng Donglin 
---
 sound/soc/sunxi/sun4i-codec.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index 150069987c0c..82beeae8edc5 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -1655,7 +1655,6 @@ static int sun4i_codec_probe(struct platform_device *pdev)
goto err_unregister_codec;
}
 
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, scodec);
 
ret = snd_soc_register_card(card);
-- 
2.14.1



[PATCH v2 07/10] ASoC: qcom: Remove useless function call

2017-08-23 Thread Peng Donglin
The work of the function platform_set_drvdata is done by
devm_snd_soc_register_card.

Acked-by: Banajit Goswami <bgosw...@codeaurora.org>
Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/qcom/apq8016_sbc.c | 1 -
 sound/soc/qcom/storm.c   | 1 -
 2 files changed, 2 deletions(-)

diff --git a/sound/soc/qcom/apq8016_sbc.c b/sound/soc/qcom/apq8016_sbc.c
index d084d7468299..52925919267b 100644
--- a/sound/soc/qcom/apq8016_sbc.c
+++ b/sound/soc/qcom/apq8016_sbc.c
@@ -191,7 +191,6 @@ static int apq8016_sbc_platform_probe(struct 
platform_device *pdev)
if (IS_ERR(data->spkr_iomux))
return PTR_ERR(data->spkr_iomux);
 
-   platform_set_drvdata(pdev, data);
snd_soc_card_set_drvdata(card, data);
 
return devm_snd_soc_register_card(>dev, card);
diff --git a/sound/soc/qcom/storm.c b/sound/soc/qcom/storm.c
index c5207af14104..a9fa972466ad 100644
--- a/sound/soc/qcom/storm.c
+++ b/sound/soc/qcom/storm.c
@@ -99,7 +99,6 @@ static int storm_platform_probe(struct platform_device *pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = snd_soc_of_parse_card_name(card, "qcom,model");
if (ret) {
-- 
2.14.1



[PATCH v2 07/10] ASoC: qcom: Remove useless function call

2017-08-23 Thread Peng Donglin
The work of the function platform_set_drvdata is done by
devm_snd_soc_register_card.

Acked-by: Banajit Goswami 
Signed-off-by: Peng Donglin 
---
 sound/soc/qcom/apq8016_sbc.c | 1 -
 sound/soc/qcom/storm.c   | 1 -
 2 files changed, 2 deletions(-)

diff --git a/sound/soc/qcom/apq8016_sbc.c b/sound/soc/qcom/apq8016_sbc.c
index d084d7468299..52925919267b 100644
--- a/sound/soc/qcom/apq8016_sbc.c
+++ b/sound/soc/qcom/apq8016_sbc.c
@@ -191,7 +191,6 @@ static int apq8016_sbc_platform_probe(struct 
platform_device *pdev)
if (IS_ERR(data->spkr_iomux))
return PTR_ERR(data->spkr_iomux);
 
-   platform_set_drvdata(pdev, data);
snd_soc_card_set_drvdata(card, data);
 
return devm_snd_soc_register_card(>dev, card);
diff --git a/sound/soc/qcom/storm.c b/sound/soc/qcom/storm.c
index c5207af14104..a9fa972466ad 100644
--- a/sound/soc/qcom/storm.c
+++ b/sound/soc/qcom/storm.c
@@ -99,7 +99,6 @@ static int storm_platform_probe(struct platform_device *pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = snd_soc_of_parse_card_name(card, "qcom,model");
if (ret) {
-- 
2.14.1



[PATCH v2 06/10] ASoC: mxs-sgtl5000: Remove unnecessary function call

2017-08-23 Thread Peng Donglin
The work of the function platform_set_drvdata is done by
devm_snd_soc_register_card.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/mxs/mxs-sgtl5000.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/sound/soc/mxs/mxs-sgtl5000.c b/sound/soc/mxs/mxs-sgtl5000.c
index a96276e77332..90ca6f9131a1 100644
--- a/sound/soc/mxs/mxs-sgtl5000.c
+++ b/sound/soc/mxs/mxs-sgtl5000.c
@@ -140,16 +140,13 @@ static int mxs_sgtl5000_probe(struct platform_device 
*pdev)
}
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = devm_snd_soc_register_card(>dev, card);
-   if (ret) {
+   if (ret)
dev_err(>dev, "snd_soc_register_card failed (%d)\n",
ret);
-   return ret;
-   }
 
-   return 0;
+   return ret;
 }
 
 static int mxs_sgtl5000_remove(struct platform_device *pdev)
-- 
2.14.1



[PATCH v2 06/10] ASoC: mxs-sgtl5000: Remove unnecessary function call

2017-08-23 Thread Peng Donglin
The work of the function platform_set_drvdata is done by
devm_snd_soc_register_card.

Signed-off-by: Peng Donglin 
---
 sound/soc/mxs/mxs-sgtl5000.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/sound/soc/mxs/mxs-sgtl5000.c b/sound/soc/mxs/mxs-sgtl5000.c
index a96276e77332..90ca6f9131a1 100644
--- a/sound/soc/mxs/mxs-sgtl5000.c
+++ b/sound/soc/mxs/mxs-sgtl5000.c
@@ -140,16 +140,13 @@ static int mxs_sgtl5000_probe(struct platform_device 
*pdev)
}
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = devm_snd_soc_register_card(>dev, card);
-   if (ret) {
+   if (ret)
dev_err(>dev, "snd_soc_register_card failed (%d)\n",
ret);
-   return ret;
-   }
 
-   return 0;
+   return ret;
 }
 
 static int mxs_sgtl5000_remove(struct platform_device *pdev)
-- 
2.14.1



[PATCH v2 05/10] ASoC: rockchip: Remove unnecessary function call

2017-08-23 Thread Peng Donglin
The work of the function platform_set_drvdata is done by
devm_snd_soc_register_card.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/rockchip/rk3288_hdmi_analog.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/sound/soc/rockchip/rk3288_hdmi_analog.c 
b/sound/soc/rockchip/rk3288_hdmi_analog.c
index dbc53e48c52c..cf5bbd8b6ebc 100644
--- a/sound/soc/rockchip/rk3288_hdmi_analog.c
+++ b/sound/soc/rockchip/rk3288_hdmi_analog.c
@@ -266,13 +266,9 @@ static int snd_rk_mc_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_card(>dev, card);
if (ret == -EPROBE_DEFER)
return -EPROBE_DEFER;
-   if (ret) {
+   if (ret)
dev_err(>dev,
"Soc register card failed %d\n", ret);
-   return ret;
-   }
-
-   platform_set_drvdata(pdev, card);
 
return ret;
 }
-- 
2.14.1



[PATCH v2 05/10] ASoC: rockchip: Remove unnecessary function call

2017-08-23 Thread Peng Donglin
The work of the function platform_set_drvdata is done by
devm_snd_soc_register_card.

Signed-off-by: Peng Donglin 
---
 sound/soc/rockchip/rk3288_hdmi_analog.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/sound/soc/rockchip/rk3288_hdmi_analog.c 
b/sound/soc/rockchip/rk3288_hdmi_analog.c
index dbc53e48c52c..cf5bbd8b6ebc 100644
--- a/sound/soc/rockchip/rk3288_hdmi_analog.c
+++ b/sound/soc/rockchip/rk3288_hdmi_analog.c
@@ -266,13 +266,9 @@ static int snd_rk_mc_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_card(>dev, card);
if (ret == -EPROBE_DEFER)
return -EPROBE_DEFER;
-   if (ret) {
+   if (ret)
dev_err(>dev,
"Soc register card failed %d\n", ret);
-   return ret;
-   }
-
-   platform_set_drvdata(pdev, card);
 
return ret;
 }
-- 
2.14.1



[PATCH v2 04/10] ASoC: atmel: Remove unnecessary function call

2017-08-23 Thread Peng Donglin
The work of the function platform_set_drvdata is done by
devm_snd_soc_register_card.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/atmel/atmel-classd.c | 1 -
 sound/soc/atmel/atmel-pdmic.c  | 1 -
 2 files changed, 2 deletions(-)

diff --git a/sound/soc/atmel/atmel-classd.c b/sound/soc/atmel/atmel-classd.c
index b7ef8c59b49a..0cd7caaed9c4 100644
--- a/sound/soc/atmel/atmel-classd.c
+++ b/sound/soc/atmel/atmel-classd.c
@@ -652,7 +652,6 @@ static int atmel_classd_probe(struct platform_device *pdev)
}
 
snd_soc_card_set_drvdata(card, dd);
-   platform_set_drvdata(pdev, card);
 
ret = atmel_classd_asoc_card_init(dev, card);
if (ret) {
diff --git a/sound/soc/atmel/atmel-pdmic.c b/sound/soc/atmel/atmel-pdmic.c
index c917df7715d1..8e3d34be9e69 100644
--- a/sound/soc/atmel/atmel-pdmic.c
+++ b/sound/soc/atmel/atmel-pdmic.c
@@ -694,7 +694,6 @@ static int atmel_pdmic_probe(struct platform_device *pdev)
}
 
snd_soc_card_set_drvdata(card, dd);
-   platform_set_drvdata(pdev, card);
 
ret = atmel_pdmic_asoc_card_init(dev, card);
if (ret) {
-- 
2.14.1



[PATCH v2 04/10] ASoC: atmel: Remove unnecessary function call

2017-08-23 Thread Peng Donglin
The work of the function platform_set_drvdata is done by
devm_snd_soc_register_card.

Signed-off-by: Peng Donglin 
---
 sound/soc/atmel/atmel-classd.c | 1 -
 sound/soc/atmel/atmel-pdmic.c  | 1 -
 2 files changed, 2 deletions(-)

diff --git a/sound/soc/atmel/atmel-classd.c b/sound/soc/atmel/atmel-classd.c
index b7ef8c59b49a..0cd7caaed9c4 100644
--- a/sound/soc/atmel/atmel-classd.c
+++ b/sound/soc/atmel/atmel-classd.c
@@ -652,7 +652,6 @@ static int atmel_classd_probe(struct platform_device *pdev)
}
 
snd_soc_card_set_drvdata(card, dd);
-   platform_set_drvdata(pdev, card);
 
ret = atmel_classd_asoc_card_init(dev, card);
if (ret) {
diff --git a/sound/soc/atmel/atmel-pdmic.c b/sound/soc/atmel/atmel-pdmic.c
index c917df7715d1..8e3d34be9e69 100644
--- a/sound/soc/atmel/atmel-pdmic.c
+++ b/sound/soc/atmel/atmel-pdmic.c
@@ -694,7 +694,6 @@ static int atmel_pdmic_probe(struct platform_device *pdev)
}
 
snd_soc_card_set_drvdata(card, dd);
-   platform_set_drvdata(pdev, card);
 
ret = atmel_pdmic_asoc_card_init(dev, card);
if (ret) {
-- 
2.14.1



[PATCH v2 03/10] ASoC: Intel: Remove unnecessary function call

2017-08-23 Thread Peng Donglin
The work of the function platform_set_drvdata is done by
devm_snd_soc_register_card.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---

Changes in v2:
-add missed occurrences.

 sound/soc/intel/boards/bytcht_da7213.c   | 6 ++
 sound/soc/intel/boards/bytcht_es8316.c   | 6 ++
 sound/soc/intel/boards/bytcht_nocodec.c  | 6 ++
 sound/soc/intel/boards/bytcr_rt5640.c| 7 ++-
 sound/soc/intel/boards/bytcr_rt5651.c| 7 ++-
 sound/soc/intel/boards/cht_bsw_max98090_ti.c | 6 ++
 sound/soc/intel/boards/cht_bsw_rt5645.c  | 6 ++
 sound/soc/intel/boards/cht_bsw_rt5672.c  | 6 ++
 8 files changed, 16 insertions(+), 34 deletions(-)

diff --git a/sound/soc/intel/boards/bytcht_da7213.c 
b/sound/soc/intel/boards/bytcht_da7213.c
index 18873e23f404..f43ced5288af 100644
--- a/sound/soc/intel/boards/bytcht_da7213.c
+++ b/sound/soc/intel/boards/bytcht_da7213.c
@@ -260,12 +260,10 @@ static int bytcht_da7213_probe(struct platform_device 
*pdev)
}
 
ret_val = devm_snd_soc_register_card(>dev, card);
-   if (ret_val) {
+   if (ret_val)
dev_err(>dev,
"snd_soc_register_card failed %d\n", ret_val);
-   return ret_val;
-   }
-   platform_set_drvdata(pdev, card);
+
return ret_val;
 }
 
diff --git a/sound/soc/intel/boards/bytcht_es8316.c 
b/sound/soc/intel/boards/bytcht_es8316.c
index 52635462dac6..c3213f320869 100644
--- a/sound/soc/intel/boards/bytcht_es8316.c
+++ b/sound/soc/intel/boards/bytcht_es8316.c
@@ -278,11 +278,9 @@ static int snd_byt_cht_es8316_mc_probe(struct 
platform_device *pdev)
}
 
ret = devm_snd_soc_register_card(>dev, _cht_es8316_card);
-   if (ret) {
+   if (ret)
dev_err(>dev, "snd_soc_register_card failed %d\n", ret);
-   return ret;
-   }
-   platform_set_drvdata(pdev, _cht_es8316_card);
+
return ret;
 }
 
diff --git a/sound/soc/intel/boards/bytcht_nocodec.c 
b/sound/soc/intel/boards/bytcht_nocodec.c
index 1dd9441806fa..b9adde0e2a9f 100644
--- a/sound/soc/intel/boards/bytcht_nocodec.c
+++ b/sound/soc/intel/boards/bytcht_nocodec.c
@@ -185,12 +185,10 @@ static int snd_bytcht_nocodec_mc_probe(struct 
platform_device *pdev)
 
ret_val = devm_snd_soc_register_card(>dev, _nocodec_card);
 
-   if (ret_val) {
+   if (ret_val)
dev_err(>dev, "devm_snd_soc_register_card failed %d\n",
ret_val);
-   return ret_val;
-   }
-   platform_set_drvdata(pdev, _nocodec_card);
+
return ret_val;
 }
 
diff --git a/sound/soc/intel/boards/bytcr_rt5640.c 
b/sound/soc/intel/boards/bytcr_rt5640.c
index 4a76b099a508..9a5775c89393 100644
--- a/sound/soc/intel/boards/bytcr_rt5640.c
+++ b/sound/soc/intel/boards/bytcr_rt5640.c
@@ -912,13 +912,10 @@ static int snd_byt_rt5640_mc_probe(struct platform_device 
*pdev)
}
 
ret_val = devm_snd_soc_register_card(>dev, _rt5640_card);
-
-   if (ret_val) {
+   if (ret_val)
dev_err(>dev, "devm_snd_soc_register_card failed %d\n",
ret_val);
-   return ret_val;
-   }
-   platform_set_drvdata(pdev, _rt5640_card);
+
return ret_val;
 }
 
diff --git a/sound/soc/intel/boards/bytcr_rt5651.c 
b/sound/soc/intel/boards/bytcr_rt5651.c
index 4a3516b38c2c..c50a3834d0eb 100644
--- a/sound/soc/intel/boards/bytcr_rt5651.c
+++ b/sound/soc/intel/boards/bytcr_rt5651.c
@@ -304,13 +304,10 @@ static int snd_byt_rt5651_mc_probe(struct platform_device 
*pdev)
byt_rt5651_card.dev = >dev;
 
ret_val = devm_snd_soc_register_card(>dev, _rt5651_card);
-
-   if (ret_val) {
+   if (ret_val)
dev_err(>dev, "devm_snd_soc_register_card failed %d\n",
ret_val);
-   return ret_val;
-   }
-   platform_set_drvdata(pdev, _rt5651_card);
+
return ret_val;
 }
 
diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c 
b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
index 20755ecc7f9e..62d45e0badc5 100644
--- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c
+++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
@@ -295,12 +295,10 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
snd_soc_card_cht.dev = >dev;
snd_soc_card_set_drvdata(_soc_card_cht, drv);
ret_val = devm_snd_soc_register_card(>dev, _soc_card_cht);
-   if (ret_val) {
+   if (ret_val)
dev_err(>dev,
"snd_soc_register_card failed %d\n", ret_val);
-   return ret_val;
-   }
-   platform_set_drvdata(pdev, _soc_card_cht);
+
return ret_val;
 }
 
diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c 
b/sound/soc/intel/boards/cht_bsw_rt5645.c
index 5bcde01d15e6..511d4d9b24bf 100644
--- a/sound/soc/

[PATCH v2 03/10] ASoC: Intel: Remove unnecessary function call

2017-08-23 Thread Peng Donglin
The work of the function platform_set_drvdata is done by
devm_snd_soc_register_card.

Signed-off-by: Peng Donglin 
---

Changes in v2:
-add missed occurrences.

 sound/soc/intel/boards/bytcht_da7213.c   | 6 ++
 sound/soc/intel/boards/bytcht_es8316.c   | 6 ++
 sound/soc/intel/boards/bytcht_nocodec.c  | 6 ++
 sound/soc/intel/boards/bytcr_rt5640.c| 7 ++-
 sound/soc/intel/boards/bytcr_rt5651.c| 7 ++-
 sound/soc/intel/boards/cht_bsw_max98090_ti.c | 6 ++
 sound/soc/intel/boards/cht_bsw_rt5645.c  | 6 ++
 sound/soc/intel/boards/cht_bsw_rt5672.c  | 6 ++
 8 files changed, 16 insertions(+), 34 deletions(-)

diff --git a/sound/soc/intel/boards/bytcht_da7213.c 
b/sound/soc/intel/boards/bytcht_da7213.c
index 18873e23f404..f43ced5288af 100644
--- a/sound/soc/intel/boards/bytcht_da7213.c
+++ b/sound/soc/intel/boards/bytcht_da7213.c
@@ -260,12 +260,10 @@ static int bytcht_da7213_probe(struct platform_device 
*pdev)
}
 
ret_val = devm_snd_soc_register_card(>dev, card);
-   if (ret_val) {
+   if (ret_val)
dev_err(>dev,
"snd_soc_register_card failed %d\n", ret_val);
-   return ret_val;
-   }
-   platform_set_drvdata(pdev, card);
+
return ret_val;
 }
 
diff --git a/sound/soc/intel/boards/bytcht_es8316.c 
b/sound/soc/intel/boards/bytcht_es8316.c
index 52635462dac6..c3213f320869 100644
--- a/sound/soc/intel/boards/bytcht_es8316.c
+++ b/sound/soc/intel/boards/bytcht_es8316.c
@@ -278,11 +278,9 @@ static int snd_byt_cht_es8316_mc_probe(struct 
platform_device *pdev)
}
 
ret = devm_snd_soc_register_card(>dev, _cht_es8316_card);
-   if (ret) {
+   if (ret)
dev_err(>dev, "snd_soc_register_card failed %d\n", ret);
-   return ret;
-   }
-   platform_set_drvdata(pdev, _cht_es8316_card);
+
return ret;
 }
 
diff --git a/sound/soc/intel/boards/bytcht_nocodec.c 
b/sound/soc/intel/boards/bytcht_nocodec.c
index 1dd9441806fa..b9adde0e2a9f 100644
--- a/sound/soc/intel/boards/bytcht_nocodec.c
+++ b/sound/soc/intel/boards/bytcht_nocodec.c
@@ -185,12 +185,10 @@ static int snd_bytcht_nocodec_mc_probe(struct 
platform_device *pdev)
 
ret_val = devm_snd_soc_register_card(>dev, _nocodec_card);
 
-   if (ret_val) {
+   if (ret_val)
dev_err(>dev, "devm_snd_soc_register_card failed %d\n",
ret_val);
-   return ret_val;
-   }
-   platform_set_drvdata(pdev, _nocodec_card);
+
return ret_val;
 }
 
diff --git a/sound/soc/intel/boards/bytcr_rt5640.c 
b/sound/soc/intel/boards/bytcr_rt5640.c
index 4a76b099a508..9a5775c89393 100644
--- a/sound/soc/intel/boards/bytcr_rt5640.c
+++ b/sound/soc/intel/boards/bytcr_rt5640.c
@@ -912,13 +912,10 @@ static int snd_byt_rt5640_mc_probe(struct platform_device 
*pdev)
}
 
ret_val = devm_snd_soc_register_card(>dev, _rt5640_card);
-
-   if (ret_val) {
+   if (ret_val)
dev_err(>dev, "devm_snd_soc_register_card failed %d\n",
ret_val);
-   return ret_val;
-   }
-   platform_set_drvdata(pdev, _rt5640_card);
+
return ret_val;
 }
 
diff --git a/sound/soc/intel/boards/bytcr_rt5651.c 
b/sound/soc/intel/boards/bytcr_rt5651.c
index 4a3516b38c2c..c50a3834d0eb 100644
--- a/sound/soc/intel/boards/bytcr_rt5651.c
+++ b/sound/soc/intel/boards/bytcr_rt5651.c
@@ -304,13 +304,10 @@ static int snd_byt_rt5651_mc_probe(struct platform_device 
*pdev)
byt_rt5651_card.dev = >dev;
 
ret_val = devm_snd_soc_register_card(>dev, _rt5651_card);
-
-   if (ret_val) {
+   if (ret_val)
dev_err(>dev, "devm_snd_soc_register_card failed %d\n",
ret_val);
-   return ret_val;
-   }
-   platform_set_drvdata(pdev, _rt5651_card);
+
return ret_val;
 }
 
diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c 
b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
index 20755ecc7f9e..62d45e0badc5 100644
--- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c
+++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
@@ -295,12 +295,10 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
snd_soc_card_cht.dev = >dev;
snd_soc_card_set_drvdata(_soc_card_cht, drv);
ret_val = devm_snd_soc_register_card(>dev, _soc_card_cht);
-   if (ret_val) {
+   if (ret_val)
dev_err(>dev,
"snd_soc_register_card failed %d\n", ret_val);
-   return ret_val;
-   }
-   platform_set_drvdata(pdev, _soc_card_cht);
+
return ret_val;
 }
 
diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c 
b/sound/soc/intel/boards/cht_bsw_rt5645.c
index 5bcde01d15e6..511d4d9b24bf 100644
--- a/sound/soc/intel/boards/cht_bsw_rt5645.c

[PATCH v2 02/10] ASoC: mediatek: Remove unnecessary function call

2017-08-23 Thread Peng Donglin
The work of the function platform_set_drvdata is done by
devm_snd_soc_register_card.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c | 1 -
 sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c | 1 -
 sound/soc/mediatek/mt8173/mt8173-rt5650.c| 1 -
 3 files changed, 3 deletions(-)

diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c 
b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c
index 5e383eb456a4..99c15219dbc8 100644
--- a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c
+++ b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c
@@ -222,7 +222,6 @@ static int mt8173_rt5650_rt5514_dev_probe(struct 
platform_device *pdev)
mt8173_rt5650_rt5514_codecs[1].of_node;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = devm_snd_soc_register_card(>dev, card);
if (ret)
diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c 
b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c
index fed1f15a39c2..42de84ca8c84 100644
--- a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c
+++ b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c
@@ -279,7 +279,6 @@ static int mt8173_rt5650_rt5676_dev_probe(struct 
platform_device *pdev)
}
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = devm_snd_soc_register_card(>dev, card);
if (ret)
diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650.c 
b/sound/soc/mediatek/mt8173/mt8173-rt5650.c
index a78470839b65..e69c141d8ed4 100644
--- a/sound/soc/mediatek/mt8173/mt8173-rt5650.c
+++ b/sound/soc/mediatek/mt8173/mt8173-rt5650.c
@@ -311,7 +311,6 @@ static int mt8173_rt5650_dev_probe(struct platform_device 
*pdev)
return -EINVAL;
}
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = devm_snd_soc_register_card(>dev, card);
if (ret)
-- 
2.14.1



[PATCH v2 02/10] ASoC: mediatek: Remove unnecessary function call

2017-08-23 Thread Peng Donglin
The work of the function platform_set_drvdata is done by
devm_snd_soc_register_card.

Signed-off-by: Peng Donglin 
---
 sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c | 1 -
 sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c | 1 -
 sound/soc/mediatek/mt8173/mt8173-rt5650.c| 1 -
 3 files changed, 3 deletions(-)

diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c 
b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c
index 5e383eb456a4..99c15219dbc8 100644
--- a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c
+++ b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c
@@ -222,7 +222,6 @@ static int mt8173_rt5650_rt5514_dev_probe(struct 
platform_device *pdev)
mt8173_rt5650_rt5514_codecs[1].of_node;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = devm_snd_soc_register_card(>dev, card);
if (ret)
diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c 
b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c
index fed1f15a39c2..42de84ca8c84 100644
--- a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c
+++ b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c
@@ -279,7 +279,6 @@ static int mt8173_rt5650_rt5676_dev_probe(struct 
platform_device *pdev)
}
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = devm_snd_soc_register_card(>dev, card);
if (ret)
diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650.c 
b/sound/soc/mediatek/mt8173/mt8173-rt5650.c
index a78470839b65..e69c141d8ed4 100644
--- a/sound/soc/mediatek/mt8173/mt8173-rt5650.c
+++ b/sound/soc/mediatek/mt8173/mt8173-rt5650.c
@@ -311,7 +311,6 @@ static int mt8173_rt5650_dev_probe(struct platform_device 
*pdev)
return -EINVAL;
}
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = devm_snd_soc_register_card(>dev, card);
if (ret)
-- 
2.14.1



[PATCH v2 01/10] ASoC: s3c24xx_uda134x: Remove unnecessary function call

2017-08-23 Thread Peng Donglin
The work of the function platform_set_drvdata is done by
devm_snd_soc_register_card.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/samsung/s3c24xx_uda134x.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/samsung/s3c24xx_uda134x.c 
b/sound/soc/samsung/s3c24xx_uda134x.c
index 55538e333cc8..758e46e8061e 100644
--- a/sound/soc/samsung/s3c24xx_uda134x.c
+++ b/sound/soc/samsung/s3c24xx_uda134x.c
@@ -237,7 +237,6 @@ static int s3c24xx_uda134x_probe(struct platform_device 
*pdev)
mutex_init(>clk_lock);
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, priv);
 
ret = devm_snd_soc_register_card(>dev, card);
-- 
2.14.1



[PATCH v2 01/10] ASoC: s3c24xx_uda134x: Remove unnecessary function call

2017-08-23 Thread Peng Donglin
The work of the function platform_set_drvdata is done by
devm_snd_soc_register_card.

Signed-off-by: Peng Donglin 
---
 sound/soc/samsung/s3c24xx_uda134x.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/samsung/s3c24xx_uda134x.c 
b/sound/soc/samsung/s3c24xx_uda134x.c
index 55538e333cc8..758e46e8061e 100644
--- a/sound/soc/samsung/s3c24xx_uda134x.c
+++ b/sound/soc/samsung/s3c24xx_uda134x.c
@@ -237,7 +237,6 @@ static int s3c24xx_uda134x_probe(struct platform_device 
*pdev)
mutex_init(>clk_lock);
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, priv);
 
ret = devm_snd_soc_register_card(>dev, card);
-- 
2.14.1



[PATCH v2 00/10] Remove unnecessary function

2017-08-23 Thread Peng Donglin
When calling the function devm_snd_soc_register_card to
register a sound card,the address of snd_soc_card will be
assigned to dev->driver_data automatically,so there is no
extra need to call platform_set_drvdata.

Peng Donglin (10):
  ASoC: s3c24xx_uda134x: Remove unnecessary function call
  ASoC: mediatek: Remove unnecessary function call
  ASoC: Intel: Remove unnecessary function call
  ASoC: atmel: Remove unnecessary function call
  ASoC: rockchip: Remove unnecessary function call
  ASoC: mxs-sgtl5000: Remove unnecessary function call
  ASoC: qcom: Remove useless function call
  ASoC: sun4i-codec: Remove unnecessary function call
  ASoC: tegra: Remove unnecessary function call
  ASoC: ux500: Remove unnecessary function call

 sound/soc/atmel/atmel-classd.c   | 1 -
 sound/soc/atmel/atmel-pdmic.c| 1 -
 sound/soc/intel/boards/bytcht_da7213.c   | 6 ++
 sound/soc/intel/boards/bytcht_es8316.c   | 6 ++
 sound/soc/intel/boards/bytcht_nocodec.c  | 6 ++
 sound/soc/intel/boards/bytcr_rt5640.c| 7 ++-
 sound/soc/intel/boards/bytcr_rt5651.c| 7 ++-
 sound/soc/intel/boards/cht_bsw_max98090_ti.c | 6 ++
 sound/soc/intel/boards/cht_bsw_rt5645.c  | 6 ++
 sound/soc/intel/boards/cht_bsw_rt5672.c  | 6 ++
 sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c | 1 -
 sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c | 1 -
 sound/soc/mediatek/mt8173/mt8173-rt5650.c| 1 -
 sound/soc/mxs/mxs-sgtl5000.c | 7 ++-
 sound/soc/qcom/apq8016_sbc.c | 1 -
 sound/soc/qcom/storm.c   | 1 -
 sound/soc/rockchip/rk3288_hdmi_analog.c  | 6 +-
 sound/soc/samsung/s3c24xx_uda134x.c  | 1 -
 sound/soc/sunxi/sun4i-codec.c| 1 -
 sound/soc/tegra/tegra_alc5632.c  | 1 -
 sound/soc/tegra/tegra_max98090.c | 1 -
 sound/soc/tegra/tegra_rt5640.c   | 1 -
 sound/soc/tegra/tegra_rt5677.c   | 1 -
 sound/soc/tegra/tegra_sgtl5000.c | 1 -
 sound/soc/tegra/tegra_wm8753.c   | 1 -
 sound/soc/tegra/tegra_wm8903.c   | 1 -
 sound/soc/tegra/tegra_wm9712.c   | 1 -
 sound/soc/tegra/trimslice.c  | 1 -
 sound/soc/ux500/mop500.c | 1 -
 29 files changed, 19 insertions(+), 63 deletions(-)

-- 
2.14.1



[PATCH v2 00/10] Remove unnecessary function

2017-08-23 Thread Peng Donglin
When calling the function devm_snd_soc_register_card to
register a sound card,the address of snd_soc_card will be
assigned to dev->driver_data automatically,so there is no
extra need to call platform_set_drvdata.

Peng Donglin (10):
  ASoC: s3c24xx_uda134x: Remove unnecessary function call
  ASoC: mediatek: Remove unnecessary function call
  ASoC: Intel: Remove unnecessary function call
  ASoC: atmel: Remove unnecessary function call
  ASoC: rockchip: Remove unnecessary function call
  ASoC: mxs-sgtl5000: Remove unnecessary function call
  ASoC: qcom: Remove useless function call
  ASoC: sun4i-codec: Remove unnecessary function call
  ASoC: tegra: Remove unnecessary function call
  ASoC: ux500: Remove unnecessary function call

 sound/soc/atmel/atmel-classd.c   | 1 -
 sound/soc/atmel/atmel-pdmic.c| 1 -
 sound/soc/intel/boards/bytcht_da7213.c   | 6 ++
 sound/soc/intel/boards/bytcht_es8316.c   | 6 ++
 sound/soc/intel/boards/bytcht_nocodec.c  | 6 ++
 sound/soc/intel/boards/bytcr_rt5640.c| 7 ++-
 sound/soc/intel/boards/bytcr_rt5651.c| 7 ++-
 sound/soc/intel/boards/cht_bsw_max98090_ti.c | 6 ++
 sound/soc/intel/boards/cht_bsw_rt5645.c  | 6 ++
 sound/soc/intel/boards/cht_bsw_rt5672.c  | 6 ++
 sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c | 1 -
 sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c | 1 -
 sound/soc/mediatek/mt8173/mt8173-rt5650.c| 1 -
 sound/soc/mxs/mxs-sgtl5000.c | 7 ++-
 sound/soc/qcom/apq8016_sbc.c | 1 -
 sound/soc/qcom/storm.c   | 1 -
 sound/soc/rockchip/rk3288_hdmi_analog.c  | 6 +-
 sound/soc/samsung/s3c24xx_uda134x.c  | 1 -
 sound/soc/sunxi/sun4i-codec.c| 1 -
 sound/soc/tegra/tegra_alc5632.c  | 1 -
 sound/soc/tegra/tegra_max98090.c | 1 -
 sound/soc/tegra/tegra_rt5640.c   | 1 -
 sound/soc/tegra/tegra_rt5677.c   | 1 -
 sound/soc/tegra/tegra_sgtl5000.c | 1 -
 sound/soc/tegra/tegra_wm8753.c   | 1 -
 sound/soc/tegra/tegra_wm8903.c   | 1 -
 sound/soc/tegra/tegra_wm9712.c   | 1 -
 sound/soc/tegra/trimslice.c  | 1 -
 sound/soc/ux500/mop500.c | 1 -
 29 files changed, 19 insertions(+), 63 deletions(-)

-- 
2.14.1



[PATCH 11/12] ASoC: tegra: Remove unnecessary function call

2017-08-20 Thread Peng Donglin
First of all,the address of pdev->dev is assigned to card->dev,then
the function platform_set_drvdata copies the value the variable card
to pdev->dev.driver_data, but when calling snd_soc_register_card,the
function dev_set_drvdata(card->dev, card) will also do the same copy
operation,so i think that the former copy operation can be removed.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/tegra/tegra_alc5632.c  | 1 -
 sound/soc/tegra/tegra_max98090.c | 1 -
 sound/soc/tegra/tegra_rt5640.c   | 1 -
 sound/soc/tegra/tegra_rt5677.c   | 1 -
 sound/soc/tegra/tegra_sgtl5000.c | 1 -
 sound/soc/tegra/tegra_wm8753.c   | 1 -
 sound/soc/tegra/tegra_wm8903.c   | 1 -
 sound/soc/tegra/tegra_wm9712.c   | 1 -
 sound/soc/tegra/trimslice.c  | 1 -
 9 files changed, 9 deletions(-)

diff --git a/sound/soc/tegra/tegra_alc5632.c b/sound/soc/tegra/tegra_alc5632.c
index 0509902..053fe4c 100644
--- a/sound/soc/tegra/tegra_alc5632.c
+++ b/sound/soc/tegra/tegra_alc5632.c
@@ -173,7 +173,6 @@ static int tegra_alc5632_probe(struct platform_device *pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, alc5632);
 
alc5632->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0);
diff --git a/sound/soc/tegra/tegra_max98090.c b/sound/soc/tegra/tegra_max98090.c
index c34a54d..41feee9 100644
--- a/sound/soc/tegra/tegra_max98090.c
+++ b/sound/soc/tegra/tegra_max98090.c
@@ -229,7 +229,6 @@ static int tegra_max98090_probe(struct platform_device 
*pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
machine->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0);
diff --git a/sound/soc/tegra/tegra_rt5640.c b/sound/soc/tegra/tegra_rt5640.c
index 93a3568..02f27fe 100644
--- a/sound/soc/tegra/tegra_rt5640.c
+++ b/sound/soc/tegra/tegra_rt5640.c
@@ -174,7 +174,6 @@ static int tegra_rt5640_probe(struct platform_device *pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
machine->gpio_hp_det = of_get_named_gpio_flags(
diff --git a/sound/soc/tegra/tegra_rt5677.c b/sound/soc/tegra/tegra_rt5677.c
index ebf58d0..3dbf0e1 100644
--- a/sound/soc/tegra/tegra_rt5677.c
+++ b/sound/soc/tegra/tegra_rt5677.c
@@ -222,7 +222,6 @@ static int tegra_rt5677_probe(struct platform_device *pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
machine->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0);
diff --git a/sound/soc/tegra/tegra_sgtl5000.c b/sound/soc/tegra/tegra_sgtl5000.c
index 6dda01f..45a4aa9 100644
--- a/sound/soc/tegra/tegra_sgtl5000.c
+++ b/sound/soc/tegra/tegra_sgtl5000.c
@@ -124,7 +124,6 @@ static int tegra_sgtl5000_driver_probe(struct 
platform_device *pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
ret = snd_soc_of_parse_card_name(card, "nvidia,model");
diff --git a/sound/soc/tegra/tegra_wm8753.c b/sound/soc/tegra/tegra_wm8753.c
index d0ab0026..23a810e 100644
--- a/sound/soc/tegra/tegra_wm8753.c
+++ b/sound/soc/tegra/tegra_wm8753.c
@@ -132,7 +132,6 @@ static int tegra_wm8753_driver_probe(struct platform_device 
*pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
ret = snd_soc_of_parse_card_name(card, "nvidia,model");
diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c
index dbfb492..d4a4a2b 100644
--- a/sound/soc/tegra/tegra_wm8903.c
+++ b/sound/soc/tegra/tegra_wm8903.c
@@ -252,7 +252,6 @@ static int tegra_wm8903_driver_probe(struct platform_device 
*pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
machine->gpio_spkr_en = of_get_named_gpio(np, "nvidia,spkr-en-gpios",
diff --git a/sound/soc/tegra/tegra_wm9712.c b/sound/soc/tegra/tegra_wm9712.c
index c9cd224..864a334 100644
--- a/sound/soc/tegra/tegra_wm9712.c
+++ b/sound/soc/tegra/tegra_wm9712.c
@@ -81,7 +81,6 @@ static int tegra_wm9712_driver_probe(struct platform_device 
*pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
machine->codec = platform_device_alloc("wm9712-codec", -1);
diff --git a/sound/soc/tegra/trimslice.c b/sound/soc/tegra/trimslice.c
index c9dcad9..99bcdd9 100644

[PATCH 11/12] ASoC: tegra: Remove unnecessary function call

2017-08-20 Thread Peng Donglin
First of all,the address of pdev->dev is assigned to card->dev,then
the function platform_set_drvdata copies the value the variable card
to pdev->dev.driver_data, but when calling snd_soc_register_card,the
function dev_set_drvdata(card->dev, card) will also do the same copy
operation,so i think that the former copy operation can be removed.

Signed-off-by: Peng Donglin 
---
 sound/soc/tegra/tegra_alc5632.c  | 1 -
 sound/soc/tegra/tegra_max98090.c | 1 -
 sound/soc/tegra/tegra_rt5640.c   | 1 -
 sound/soc/tegra/tegra_rt5677.c   | 1 -
 sound/soc/tegra/tegra_sgtl5000.c | 1 -
 sound/soc/tegra/tegra_wm8753.c   | 1 -
 sound/soc/tegra/tegra_wm8903.c   | 1 -
 sound/soc/tegra/tegra_wm9712.c   | 1 -
 sound/soc/tegra/trimslice.c  | 1 -
 9 files changed, 9 deletions(-)

diff --git a/sound/soc/tegra/tegra_alc5632.c b/sound/soc/tegra/tegra_alc5632.c
index 0509902..053fe4c 100644
--- a/sound/soc/tegra/tegra_alc5632.c
+++ b/sound/soc/tegra/tegra_alc5632.c
@@ -173,7 +173,6 @@ static int tegra_alc5632_probe(struct platform_device *pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, alc5632);
 
alc5632->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0);
diff --git a/sound/soc/tegra/tegra_max98090.c b/sound/soc/tegra/tegra_max98090.c
index c34a54d..41feee9 100644
--- a/sound/soc/tegra/tegra_max98090.c
+++ b/sound/soc/tegra/tegra_max98090.c
@@ -229,7 +229,6 @@ static int tegra_max98090_probe(struct platform_device 
*pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
machine->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0);
diff --git a/sound/soc/tegra/tegra_rt5640.c b/sound/soc/tegra/tegra_rt5640.c
index 93a3568..02f27fe 100644
--- a/sound/soc/tegra/tegra_rt5640.c
+++ b/sound/soc/tegra/tegra_rt5640.c
@@ -174,7 +174,6 @@ static int tegra_rt5640_probe(struct platform_device *pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
machine->gpio_hp_det = of_get_named_gpio_flags(
diff --git a/sound/soc/tegra/tegra_rt5677.c b/sound/soc/tegra/tegra_rt5677.c
index ebf58d0..3dbf0e1 100644
--- a/sound/soc/tegra/tegra_rt5677.c
+++ b/sound/soc/tegra/tegra_rt5677.c
@@ -222,7 +222,6 @@ static int tegra_rt5677_probe(struct platform_device *pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
machine->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0);
diff --git a/sound/soc/tegra/tegra_sgtl5000.c b/sound/soc/tegra/tegra_sgtl5000.c
index 6dda01f..45a4aa9 100644
--- a/sound/soc/tegra/tegra_sgtl5000.c
+++ b/sound/soc/tegra/tegra_sgtl5000.c
@@ -124,7 +124,6 @@ static int tegra_sgtl5000_driver_probe(struct 
platform_device *pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
ret = snd_soc_of_parse_card_name(card, "nvidia,model");
diff --git a/sound/soc/tegra/tegra_wm8753.c b/sound/soc/tegra/tegra_wm8753.c
index d0ab0026..23a810e 100644
--- a/sound/soc/tegra/tegra_wm8753.c
+++ b/sound/soc/tegra/tegra_wm8753.c
@@ -132,7 +132,6 @@ static int tegra_wm8753_driver_probe(struct platform_device 
*pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
ret = snd_soc_of_parse_card_name(card, "nvidia,model");
diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c
index dbfb492..d4a4a2b 100644
--- a/sound/soc/tegra/tegra_wm8903.c
+++ b/sound/soc/tegra/tegra_wm8903.c
@@ -252,7 +252,6 @@ static int tegra_wm8903_driver_probe(struct platform_device 
*pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
machine->gpio_spkr_en = of_get_named_gpio(np, "nvidia,spkr-en-gpios",
diff --git a/sound/soc/tegra/tegra_wm9712.c b/sound/soc/tegra/tegra_wm9712.c
index c9cd224..864a334 100644
--- a/sound/soc/tegra/tegra_wm9712.c
+++ b/sound/soc/tegra/tegra_wm9712.c
@@ -81,7 +81,6 @@ static int tegra_wm9712_driver_probe(struct platform_device 
*pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, machine);
 
machine->codec = platform_device_alloc("wm9712-codec", -1);
diff --git a/sound/soc/tegra/trimslice.c b/sound/soc/tegra/trimslice.c
index c9dcad9..99bcdd9 100644
--- a/sound/soc/tegra/trimslice.c
+++ 

[PATCH 12/12] ASoC: ux500: Remove unnecessary function call

2017-08-20 Thread Peng Donglin
First of all,the address of pdev->dev is assigned to mop500_card.dev,
then the function platform_set_drvdata copies the value the variable
card to pdev->dev.driver_data,but when calling snd_soc_register_card,
the function dev_set_drvdata(card->dev, card) will also do the same
copy operation,so i think that the former copy operation can be removed.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/ux500/mop500.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/ux500/mop500.c b/sound/soc/ux500/mop500.c
index ba9fc09..070a688 100644
--- a/sound/soc/ux500/mop500.c
+++ b/sound/soc/ux500/mop500.c
@@ -115,7 +115,6 @@ static int mop500_probe(struct platform_device *pdev)
 
dev_dbg(>dev, "%s: Card %s: Set platform drvdata.\n",
__func__, mop500_card.name);
-   platform_set_drvdata(pdev, _card);
 
snd_soc_card_set_drvdata(_card, NULL);
 
-- 
1.9.1



[PATCH 12/12] ASoC: ux500: Remove unnecessary function call

2017-08-20 Thread Peng Donglin
First of all,the address of pdev->dev is assigned to mop500_card.dev,
then the function platform_set_drvdata copies the value the variable
card to pdev->dev.driver_data,but when calling snd_soc_register_card,
the function dev_set_drvdata(card->dev, card) will also do the same
copy operation,so i think that the former copy operation can be removed.

Signed-off-by: Peng Donglin 
---
 sound/soc/ux500/mop500.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/ux500/mop500.c b/sound/soc/ux500/mop500.c
index ba9fc09..070a688 100644
--- a/sound/soc/ux500/mop500.c
+++ b/sound/soc/ux500/mop500.c
@@ -115,7 +115,6 @@ static int mop500_probe(struct platform_device *pdev)
 
dev_dbg(>dev, "%s: Card %s: Set platform drvdata.\n",
__func__, mop500_card.name);
-   platform_set_drvdata(pdev, _card);
 
snd_soc_card_set_drvdata(_card, NULL);
 
-- 
1.9.1



[PATCH 10/12] ASoC: sun4i-codec: Remove unnecessary function call

2017-08-19 Thread Peng Donglin
First of all,the address of pdev->dev is assigned to card->dev in
create_card,then the function platform_set_drvdata copies the value
the variable card to pdev->dev.driver_data, but when calling
snd_soc_register_card,the function dev_set_drvdata(card->dev, card)
will also do the same copy operation,so i think that the former copy
operation can be removed.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/sunxi/sun4i-codec.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index 1500699..82beeae 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -1655,7 +1655,6 @@ static int sun4i_codec_probe(struct platform_device *pdev)
goto err_unregister_codec;
}
 
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, scodec);
 
ret = snd_soc_register_card(card);
-- 
1.9.1



[PATCH 10/12] ASoC: sun4i-codec: Remove unnecessary function call

2017-08-19 Thread Peng Donglin
First of all,the address of pdev->dev is assigned to card->dev in
create_card,then the function platform_set_drvdata copies the value
the variable card to pdev->dev.driver_data, but when calling
snd_soc_register_card,the function dev_set_drvdata(card->dev, card)
will also do the same copy operation,so i think that the former copy
operation can be removed.

Signed-off-by: Peng Donglin 
---
 sound/soc/sunxi/sun4i-codec.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index 1500699..82beeae 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -1655,7 +1655,6 @@ static int sun4i_codec_probe(struct platform_device *pdev)
goto err_unregister_codec;
}
 
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, scodec);
 
ret = snd_soc_register_card(card);
-- 
1.9.1



[PATCH 09/12] ASoC: qcom: Remove unnecessary function call

2017-08-19 Thread Peng Donglin
First of all,the address of pdev->dev is assigned to card->dev,then
the function platform_set_drvdata copies the value the variable card
to pdev->dev.driver_data, but when calling snd_soc_register_card,the
function dev_set_drvdata(card->dev, card) will also do the same copy
operation,so i think that the former copy operation can be removed.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/qcom/storm.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/qcom/storm.c b/sound/soc/qcom/storm.c
index c5207af..a9fa972 100644
--- a/sound/soc/qcom/storm.c
+++ b/sound/soc/qcom/storm.c
@@ -99,7 +99,6 @@ static int storm_platform_probe(struct platform_device *pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = snd_soc_of_parse_card_name(card, "qcom,model");
if (ret) {
-- 
1.9.1



[PATCH 09/12] ASoC: qcom: Remove unnecessary function call

2017-08-19 Thread Peng Donglin
First of all,the address of pdev->dev is assigned to card->dev,then
the function platform_set_drvdata copies the value the variable card
to pdev->dev.driver_data, but when calling snd_soc_register_card,the
function dev_set_drvdata(card->dev, card) will also do the same copy
operation,so i think that the former copy operation can be removed.

Signed-off-by: Peng Donglin 
---
 sound/soc/qcom/storm.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/qcom/storm.c b/sound/soc/qcom/storm.c
index c5207af..a9fa972 100644
--- a/sound/soc/qcom/storm.c
+++ b/sound/soc/qcom/storm.c
@@ -99,7 +99,6 @@ static int storm_platform_probe(struct platform_device *pdev)
return -ENOMEM;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = snd_soc_of_parse_card_name(card, "qcom,model");
if (ret) {
-- 
1.9.1



[PATCH 08/12] ASoC: qcom: Remove useless function call

2017-08-19 Thread Peng Donglin
The function platform_set_drvdata(pdev, data) copies the value of
the variable data to pdev->dev.driver_data,but when calling
snd_soc_register_card,the function dev_set_drvdata(card->dev, card)
will override it, so i think that the former copy operation is
useless and can be removed.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/qcom/apq8016_sbc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/qcom/apq8016_sbc.c b/sound/soc/qcom/apq8016_sbc.c
index d084d74..5292591 100644
--- a/sound/soc/qcom/apq8016_sbc.c
+++ b/sound/soc/qcom/apq8016_sbc.c
@@ -191,7 +191,6 @@ static int apq8016_sbc_platform_probe(struct 
platform_device *pdev)
if (IS_ERR(data->spkr_iomux))
return PTR_ERR(data->spkr_iomux);
 
-   platform_set_drvdata(pdev, data);
snd_soc_card_set_drvdata(card, data);
 
return devm_snd_soc_register_card(>dev, card);
-- 
1.9.1



[PATCH 08/12] ASoC: qcom: Remove useless function call

2017-08-19 Thread Peng Donglin
The function platform_set_drvdata(pdev, data) copies the value of
the variable data to pdev->dev.driver_data,but when calling
snd_soc_register_card,the function dev_set_drvdata(card->dev, card)
will override it, so i think that the former copy operation is
useless and can be removed.

Signed-off-by: Peng Donglin 
---
 sound/soc/qcom/apq8016_sbc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/qcom/apq8016_sbc.c b/sound/soc/qcom/apq8016_sbc.c
index d084d74..5292591 100644
--- a/sound/soc/qcom/apq8016_sbc.c
+++ b/sound/soc/qcom/apq8016_sbc.c
@@ -191,7 +191,6 @@ static int apq8016_sbc_platform_probe(struct 
platform_device *pdev)
if (IS_ERR(data->spkr_iomux))
return PTR_ERR(data->spkr_iomux);
 
-   platform_set_drvdata(pdev, data);
snd_soc_card_set_drvdata(card, data);
 
return devm_snd_soc_register_card(>dev, card);
-- 
1.9.1



[PATCH 07/12] ASoC: mxs-sgtl5000: Remove unnecessary function call

2017-08-19 Thread Peng Donglin
First of all,the address of pdev->dev is assigned to card->dev,then
the function platform_set_drvdata copies the value the variable card
to pdev->dev.driver_data, but when calling snd_soc_register_card,the
function dev_set_drvdata(card->dev, card) will also do the same copy
operation,so i think that the former copy operation can be removed.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/mxs/mxs-sgtl5000.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/mxs/mxs-sgtl5000.c b/sound/soc/mxs/mxs-sgtl5000.c
index a96276e..2ed3240 100644
--- a/sound/soc/mxs/mxs-sgtl5000.c
+++ b/sound/soc/mxs/mxs-sgtl5000.c
@@ -140,7 +140,6 @@ static int mxs_sgtl5000_probe(struct platform_device *pdev)
}
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = devm_snd_soc_register_card(>dev, card);
if (ret) {
-- 
1.9.1



[PATCH 07/12] ASoC: mxs-sgtl5000: Remove unnecessary function call

2017-08-19 Thread Peng Donglin
First of all,the address of pdev->dev is assigned to card->dev,then
the function platform_set_drvdata copies the value the variable card
to pdev->dev.driver_data, but when calling snd_soc_register_card,the
function dev_set_drvdata(card->dev, card) will also do the same copy
operation,so i think that the former copy operation can be removed.

Signed-off-by: Peng Donglin 
---
 sound/soc/mxs/mxs-sgtl5000.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/mxs/mxs-sgtl5000.c b/sound/soc/mxs/mxs-sgtl5000.c
index a96276e..2ed3240 100644
--- a/sound/soc/mxs/mxs-sgtl5000.c
+++ b/sound/soc/mxs/mxs-sgtl5000.c
@@ -140,7 +140,6 @@ static int mxs_sgtl5000_probe(struct platform_device *pdev)
}
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = devm_snd_soc_register_card(>dev, card);
if (ret) {
-- 
1.9.1



[PATCH 06/12] ASoC: rockchip: Remove unnecessary function call

2017-08-19 Thread Peng Donglin
First of all,the address of pdev->dev is assigned to card->dev,then
the function platform_set_drvdata copies the value the variable card
to pdev->dev.driver_data, but when calling snd_soc_register_card,the
function dev_set_drvdata(card->dev, card) will also do the same copy
operation,so i think that the former copy operation can be removed.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/rockchip/rk3288_hdmi_analog.c | 2 --
 sound/soc/rockchip/rk3399_gru_sound.c   | 1 -
 2 files changed, 3 deletions(-)

diff --git a/sound/soc/rockchip/rk3288_hdmi_analog.c 
b/sound/soc/rockchip/rk3288_hdmi_analog.c
index dbc53e4..37ef162 100644
--- a/sound/soc/rockchip/rk3288_hdmi_analog.c
+++ b/sound/soc/rockchip/rk3288_hdmi_analog.c
@@ -272,8 +272,6 @@ static int snd_rk_mc_probe(struct platform_device *pdev)
return ret;
}
 
-   platform_set_drvdata(pdev, card);
-
return ret;
 }
 
diff --git a/sound/soc/rockchip/rk3399_gru_sound.c 
b/sound/soc/rockchip/rk3399_gru_sound.c
index 3475c61..70c0908 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -362,7 +362,6 @@ static int rockchip_sound_probe(struct platform_device 
*pdev)
rockchip_dailinks[DAILINK_RT5514_DSP].platform_name = 
kstrdup_const(dev_name(dev), GFP_KERNEL);
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = devm_snd_soc_register_card(>dev, card);
if (ret)
-- 
1.9.1



[PATCH 06/12] ASoC: rockchip: Remove unnecessary function call

2017-08-19 Thread Peng Donglin
First of all,the address of pdev->dev is assigned to card->dev,then
the function platform_set_drvdata copies the value the variable card
to pdev->dev.driver_data, but when calling snd_soc_register_card,the
function dev_set_drvdata(card->dev, card) will also do the same copy
operation,so i think that the former copy operation can be removed.

Signed-off-by: Peng Donglin 
---
 sound/soc/rockchip/rk3288_hdmi_analog.c | 2 --
 sound/soc/rockchip/rk3399_gru_sound.c   | 1 -
 2 files changed, 3 deletions(-)

diff --git a/sound/soc/rockchip/rk3288_hdmi_analog.c 
b/sound/soc/rockchip/rk3288_hdmi_analog.c
index dbc53e4..37ef162 100644
--- a/sound/soc/rockchip/rk3288_hdmi_analog.c
+++ b/sound/soc/rockchip/rk3288_hdmi_analog.c
@@ -272,8 +272,6 @@ static int snd_rk_mc_probe(struct platform_device *pdev)
return ret;
}
 
-   platform_set_drvdata(pdev, card);
-
return ret;
 }
 
diff --git a/sound/soc/rockchip/rk3399_gru_sound.c 
b/sound/soc/rockchip/rk3399_gru_sound.c
index 3475c61..70c0908 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -362,7 +362,6 @@ static int rockchip_sound_probe(struct platform_device 
*pdev)
rockchip_dailinks[DAILINK_RT5514_DSP].platform_name = 
kstrdup_const(dev_name(dev), GFP_KERNEL);
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = devm_snd_soc_register_card(>dev, card);
if (ret)
-- 
1.9.1



[PATCH 05/12] ASoC: atmel: Remove unnecessary function call

2017-08-19 Thread Peng Donglin
The function platform_set_drvdata copies the value the variable
card to card->dev->driver_data, then the address of >dev is
assigned to card->dev in atmel_pdmic_asoc_card_init, but when
calling snd_soc_register_card,the function
dev_set_drvdata(card->dev, card) will do the same copy operation,
so i think that the former copy operation can be removed.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/atmel/atmel-pdmic.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/atmel/atmel-pdmic.c b/sound/soc/atmel/atmel-pdmic.c
index c917df7..8e3d34b 100644
--- a/sound/soc/atmel/atmel-pdmic.c
+++ b/sound/soc/atmel/atmel-pdmic.c
@@ -694,7 +694,6 @@ static int atmel_pdmic_probe(struct platform_device *pdev)
}
 
snd_soc_card_set_drvdata(card, dd);
-   platform_set_drvdata(pdev, card);
 
ret = atmel_pdmic_asoc_card_init(dev, card);
if (ret) {
-- 
1.9.1



[PATCH 05/12] ASoC: atmel: Remove unnecessary function call

2017-08-19 Thread Peng Donglin
The function platform_set_drvdata copies the value the variable
card to card->dev->driver_data, then the address of >dev is
assigned to card->dev in atmel_pdmic_asoc_card_init, but when
calling snd_soc_register_card,the function
dev_set_drvdata(card->dev, card) will do the same copy operation,
so i think that the former copy operation can be removed.

Signed-off-by: Peng Donglin 
---
 sound/soc/atmel/atmel-pdmic.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/atmel/atmel-pdmic.c b/sound/soc/atmel/atmel-pdmic.c
index c917df7..8e3d34b 100644
--- a/sound/soc/atmel/atmel-pdmic.c
+++ b/sound/soc/atmel/atmel-pdmic.c
@@ -694,7 +694,6 @@ static int atmel_pdmic_probe(struct platform_device *pdev)
}
 
snd_soc_card_set_drvdata(card, dd);
-   platform_set_drvdata(pdev, card);
 
ret = atmel_pdmic_asoc_card_init(dev, card);
if (ret) {
-- 
1.9.1



[PATCH 04/12] ASoC: atmel: Remove unnecessary function call

2017-08-19 Thread Peng Donglin
The function platform_set_drvdata copies the value the variable
card to card->dev->driver_data, then the address of >dev is
assigned to card->dev in atmel_classd_asoc_card_init, but when
calling snd_soc_register_card,the function
dev_set_drvdata(card->dev, card) will do the same copy operation,
so i think that the former copy operation can be removed.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/atmel/atmel-classd.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/atmel/atmel-classd.c b/sound/soc/atmel/atmel-classd.c
index b7ef8c5..0cd7caa 100644
--- a/sound/soc/atmel/atmel-classd.c
+++ b/sound/soc/atmel/atmel-classd.c
@@ -652,7 +652,6 @@ static int atmel_classd_probe(struct platform_device *pdev)
}
 
snd_soc_card_set_drvdata(card, dd);
-   platform_set_drvdata(pdev, card);
 
ret = atmel_classd_asoc_card_init(dev, card);
if (ret) {
-- 
1.9.1



[PATCH 04/12] ASoC: atmel: Remove unnecessary function call

2017-08-19 Thread Peng Donglin
The function platform_set_drvdata copies the value the variable
card to card->dev->driver_data, then the address of >dev is
assigned to card->dev in atmel_classd_asoc_card_init, but when
calling snd_soc_register_card,the function
dev_set_drvdata(card->dev, card) will do the same copy operation,
so i think that the former copy operation can be removed.

Signed-off-by: Peng Donglin 
---
 sound/soc/atmel/atmel-classd.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/atmel/atmel-classd.c b/sound/soc/atmel/atmel-classd.c
index b7ef8c5..0cd7caa 100644
--- a/sound/soc/atmel/atmel-classd.c
+++ b/sound/soc/atmel/atmel-classd.c
@@ -652,7 +652,6 @@ static int atmel_classd_probe(struct platform_device *pdev)
}
 
snd_soc_card_set_drvdata(card, dd);
-   platform_set_drvdata(pdev, card);
 
ret = atmel_classd_asoc_card_init(dev, card);
if (ret) {
-- 
1.9.1



[PATCH 03/12] ASoC: Intel: Remove unnecessary function call

2017-08-19 Thread Peng Donglin
First of all,the address of pdev->dev is assigned to card->dev, when
calling snd_soc_register_card,the function dev_set_drvdata(card->dev, card)
copies the value the variable card to card->dev->driver_data.After
that,the function platform_set_drvdata does the same copy operation,
so i think that the latter copy operation can be removed.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/intel/boards/bytcht_da7213.c   | 1 -
 sound/soc/intel/boards/bytcht_es8316.c   | 1 -
 sound/soc/intel/boards/bytcr_rt5651.c| 1 -
 sound/soc/intel/boards/cht_bsw_max98090_ti.c | 1 -
 sound/soc/intel/boards/cht_bsw_rt5645.c  | 1 -
 sound/soc/intel/boards/cht_bsw_rt5672.c  | 1 -
 6 files changed, 6 deletions(-)

diff --git a/sound/soc/intel/boards/bytcht_da7213.c 
b/sound/soc/intel/boards/bytcht_da7213.c
index 18873e2..fbc870b 100644
--- a/sound/soc/intel/boards/bytcht_da7213.c
+++ b/sound/soc/intel/boards/bytcht_da7213.c
@@ -265,7 +265,6 @@ static int bytcht_da7213_probe(struct platform_device *pdev)
"snd_soc_register_card failed %d\n", ret_val);
return ret_val;
}
-   platform_set_drvdata(pdev, card);
return ret_val;
 }
 
diff --git a/sound/soc/intel/boards/bytcht_es8316.c 
b/sound/soc/intel/boards/bytcht_es8316.c
index 5263546..5e6e8e9 100644
--- a/sound/soc/intel/boards/bytcht_es8316.c
+++ b/sound/soc/intel/boards/bytcht_es8316.c
@@ -282,7 +282,6 @@ static int snd_byt_cht_es8316_mc_probe(struct 
platform_device *pdev)
dev_err(>dev, "snd_soc_register_card failed %d\n", ret);
return ret;
}
-   platform_set_drvdata(pdev, _cht_es8316_card);
return ret;
 }
 
diff --git a/sound/soc/intel/boards/bytcr_rt5651.c 
b/sound/soc/intel/boards/bytcr_rt5651.c
index 4a3516b..77702aa 100644
--- a/sound/soc/intel/boards/bytcr_rt5651.c
+++ b/sound/soc/intel/boards/bytcr_rt5651.c
@@ -310,7 +310,6 @@ static int snd_byt_rt5651_mc_probe(struct platform_device 
*pdev)
ret_val);
return ret_val;
}
-   platform_set_drvdata(pdev, _rt5651_card);
return ret_val;
 }
 
diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c 
b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
index 20755ec..8583c0c 100644
--- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c
+++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
@@ -300,7 +300,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
"snd_soc_register_card failed %d\n", ret_val);
return ret_val;
}
-   platform_set_drvdata(pdev, _soc_card_cht);
return ret_val;
 }
 
diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c 
b/sound/soc/intel/boards/cht_bsw_rt5645.c
index 5bcde01..0e6a24c 100644
--- a/sound/soc/intel/boards/cht_bsw_rt5645.c
+++ b/sound/soc/intel/boards/cht_bsw_rt5645.c
@@ -699,7 +699,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
"snd_soc_register_card failed %d\n", ret_val);
return ret_val;
}
-   platform_set_drvdata(pdev, card);
return ret_val;
 }
 
diff --git a/sound/soc/intel/boards/cht_bsw_rt5672.c 
b/sound/soc/intel/boards/cht_bsw_rt5672.c
index bc2a52d..e8bd22b 100644
--- a/sound/soc/intel/boards/cht_bsw_rt5672.c
+++ b/sound/soc/intel/boards/cht_bsw_rt5672.c
@@ -448,7 +448,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
"snd_soc_register_card failed %d\n", ret_val);
return ret_val;
}
-   platform_set_drvdata(pdev, _soc_card_cht);
return ret_val;
 }
 
-- 
1.9.1



[PATCH 03/12] ASoC: Intel: Remove unnecessary function call

2017-08-19 Thread Peng Donglin
First of all,the address of pdev->dev is assigned to card->dev, when
calling snd_soc_register_card,the function dev_set_drvdata(card->dev, card)
copies the value the variable card to card->dev->driver_data.After
that,the function platform_set_drvdata does the same copy operation,
so i think that the latter copy operation can be removed.

Signed-off-by: Peng Donglin 
---
 sound/soc/intel/boards/bytcht_da7213.c   | 1 -
 sound/soc/intel/boards/bytcht_es8316.c   | 1 -
 sound/soc/intel/boards/bytcr_rt5651.c| 1 -
 sound/soc/intel/boards/cht_bsw_max98090_ti.c | 1 -
 sound/soc/intel/boards/cht_bsw_rt5645.c  | 1 -
 sound/soc/intel/boards/cht_bsw_rt5672.c  | 1 -
 6 files changed, 6 deletions(-)

diff --git a/sound/soc/intel/boards/bytcht_da7213.c 
b/sound/soc/intel/boards/bytcht_da7213.c
index 18873e2..fbc870b 100644
--- a/sound/soc/intel/boards/bytcht_da7213.c
+++ b/sound/soc/intel/boards/bytcht_da7213.c
@@ -265,7 +265,6 @@ static int bytcht_da7213_probe(struct platform_device *pdev)
"snd_soc_register_card failed %d\n", ret_val);
return ret_val;
}
-   platform_set_drvdata(pdev, card);
return ret_val;
 }
 
diff --git a/sound/soc/intel/boards/bytcht_es8316.c 
b/sound/soc/intel/boards/bytcht_es8316.c
index 5263546..5e6e8e9 100644
--- a/sound/soc/intel/boards/bytcht_es8316.c
+++ b/sound/soc/intel/boards/bytcht_es8316.c
@@ -282,7 +282,6 @@ static int snd_byt_cht_es8316_mc_probe(struct 
platform_device *pdev)
dev_err(>dev, "snd_soc_register_card failed %d\n", ret);
return ret;
}
-   platform_set_drvdata(pdev, _cht_es8316_card);
return ret;
 }
 
diff --git a/sound/soc/intel/boards/bytcr_rt5651.c 
b/sound/soc/intel/boards/bytcr_rt5651.c
index 4a3516b..77702aa 100644
--- a/sound/soc/intel/boards/bytcr_rt5651.c
+++ b/sound/soc/intel/boards/bytcr_rt5651.c
@@ -310,7 +310,6 @@ static int snd_byt_rt5651_mc_probe(struct platform_device 
*pdev)
ret_val);
return ret_val;
}
-   platform_set_drvdata(pdev, _rt5651_card);
return ret_val;
 }
 
diff --git a/sound/soc/intel/boards/cht_bsw_max98090_ti.c 
b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
index 20755ec..8583c0c 100644
--- a/sound/soc/intel/boards/cht_bsw_max98090_ti.c
+++ b/sound/soc/intel/boards/cht_bsw_max98090_ti.c
@@ -300,7 +300,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
"snd_soc_register_card failed %d\n", ret_val);
return ret_val;
}
-   platform_set_drvdata(pdev, _soc_card_cht);
return ret_val;
 }
 
diff --git a/sound/soc/intel/boards/cht_bsw_rt5645.c 
b/sound/soc/intel/boards/cht_bsw_rt5645.c
index 5bcde01..0e6a24c 100644
--- a/sound/soc/intel/boards/cht_bsw_rt5645.c
+++ b/sound/soc/intel/boards/cht_bsw_rt5645.c
@@ -699,7 +699,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
"snd_soc_register_card failed %d\n", ret_val);
return ret_val;
}
-   platform_set_drvdata(pdev, card);
return ret_val;
 }
 
diff --git a/sound/soc/intel/boards/cht_bsw_rt5672.c 
b/sound/soc/intel/boards/cht_bsw_rt5672.c
index bc2a52d..e8bd22b 100644
--- a/sound/soc/intel/boards/cht_bsw_rt5672.c
+++ b/sound/soc/intel/boards/cht_bsw_rt5672.c
@@ -448,7 +448,6 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
"snd_soc_register_card failed %d\n", ret_val);
return ret_val;
}
-   platform_set_drvdata(pdev, _soc_card_cht);
return ret_val;
 }
 
-- 
1.9.1



[PATCH 01/12] ASoC: s3c24xx_uda134x: Remove unnecessary function call

2017-08-19 Thread Peng Donglin
First of all,the address of pdev->dev is assigned to card->dev,then
the function platform_set_drvdata copies the value the variable card
to pdev->dev.driver_data, but when calling snd_soc_register_card,the
function dev_set_drvdata(card->dev, card) will also do the same copy
operation,so i think that the former copy operation can be removed.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/samsung/s3c24xx_uda134x.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/samsung/s3c24xx_uda134x.c 
b/sound/soc/samsung/s3c24xx_uda134x.c
index 55538e3..758e46e 100644
--- a/sound/soc/samsung/s3c24xx_uda134x.c
+++ b/sound/soc/samsung/s3c24xx_uda134x.c
@@ -237,7 +237,6 @@ static int s3c24xx_uda134x_probe(struct platform_device 
*pdev)
mutex_init(>clk_lock);
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, priv);
 
ret = devm_snd_soc_register_card(>dev, card);
-- 
1.9.1



[PATCH 01/12] ASoC: s3c24xx_uda134x: Remove unnecessary function call

2017-08-19 Thread Peng Donglin
First of all,the address of pdev->dev is assigned to card->dev,then
the function platform_set_drvdata copies the value the variable card
to pdev->dev.driver_data, but when calling snd_soc_register_card,the
function dev_set_drvdata(card->dev, card) will also do the same copy
operation,so i think that the former copy operation can be removed.

Signed-off-by: Peng Donglin 
---
 sound/soc/samsung/s3c24xx_uda134x.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/samsung/s3c24xx_uda134x.c 
b/sound/soc/samsung/s3c24xx_uda134x.c
index 55538e3..758e46e 100644
--- a/sound/soc/samsung/s3c24xx_uda134x.c
+++ b/sound/soc/samsung/s3c24xx_uda134x.c
@@ -237,7 +237,6 @@ static int s3c24xx_uda134x_probe(struct platform_device 
*pdev)
mutex_init(>clk_lock);
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
snd_soc_card_set_drvdata(card, priv);
 
ret = devm_snd_soc_register_card(>dev, card);
-- 
1.9.1



[PATCH 02/12] ASoC: mediatek: Remove unnecessary function call

2017-08-19 Thread Peng Donglin
First of all,the address of pdev->dev is assigned to card->dev,then
the function platform_set_drvdata copies the value the variable card
to pdev->dev.driver_data, but when calling snd_soc_register_card,the
function dev_set_drvdata(card->dev, card) will also do the same copy
operation,so i think that the former copy operation can be removed.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c | 1 -
 sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c | 1 -
 sound/soc/mediatek/mt8173/mt8173-rt5650.c| 1 -
 3 files changed, 3 deletions(-)

diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c 
b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c
index 5e383eb..99c1521 100644
--- a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c
+++ b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c
@@ -222,7 +222,6 @@ static int mt8173_rt5650_rt5514_dev_probe(struct 
platform_device *pdev)
mt8173_rt5650_rt5514_codecs[1].of_node;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = devm_snd_soc_register_card(>dev, card);
if (ret)
diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c 
b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c
index fed1f15..42de84c 100644
--- a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c
+++ b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c
@@ -279,7 +279,6 @@ static int mt8173_rt5650_rt5676_dev_probe(struct 
platform_device *pdev)
}
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = devm_snd_soc_register_card(>dev, card);
if (ret)
diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650.c 
b/sound/soc/mediatek/mt8173/mt8173-rt5650.c
index a784708..e69c141 100644
--- a/sound/soc/mediatek/mt8173/mt8173-rt5650.c
+++ b/sound/soc/mediatek/mt8173/mt8173-rt5650.c
@@ -311,7 +311,6 @@ static int mt8173_rt5650_dev_probe(struct platform_device 
*pdev)
return -EINVAL;
}
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = devm_snd_soc_register_card(>dev, card);
if (ret)
-- 
1.9.1



[PATCH 02/12] ASoC: mediatek: Remove unnecessary function call

2017-08-19 Thread Peng Donglin
First of all,the address of pdev->dev is assigned to card->dev,then
the function platform_set_drvdata copies the value the variable card
to pdev->dev.driver_data, but when calling snd_soc_register_card,the
function dev_set_drvdata(card->dev, card) will also do the same copy
operation,so i think that the former copy operation can be removed.

Signed-off-by: Peng Donglin 
---
 sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c | 1 -
 sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c | 1 -
 sound/soc/mediatek/mt8173/mt8173-rt5650.c| 1 -
 3 files changed, 3 deletions(-)

diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c 
b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c
index 5e383eb..99c1521 100644
--- a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c
+++ b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c
@@ -222,7 +222,6 @@ static int mt8173_rt5650_rt5514_dev_probe(struct 
platform_device *pdev)
mt8173_rt5650_rt5514_codecs[1].of_node;
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = devm_snd_soc_register_card(>dev, card);
if (ret)
diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c 
b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c
index fed1f15..42de84c 100644
--- a/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c
+++ b/sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c
@@ -279,7 +279,6 @@ static int mt8173_rt5650_rt5676_dev_probe(struct 
platform_device *pdev)
}
 
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = devm_snd_soc_register_card(>dev, card);
if (ret)
diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650.c 
b/sound/soc/mediatek/mt8173/mt8173-rt5650.c
index a784708..e69c141 100644
--- a/sound/soc/mediatek/mt8173/mt8173-rt5650.c
+++ b/sound/soc/mediatek/mt8173/mt8173-rt5650.c
@@ -311,7 +311,6 @@ static int mt8173_rt5650_dev_probe(struct platform_device 
*pdev)
return -EINVAL;
}
card->dev = >dev;
-   platform_set_drvdata(pdev, card);
 
ret = devm_snd_soc_register_card(>dev, card);
if (ret)
-- 
1.9.1



[PATCH 00/12] Remove unnecessary function call

2017-08-19 Thread Peng Donglin
First of all,the address of pdev->dev is assigned to card->dev,then
the function platform_set_drvdata copies the value the variable card
to pdev->dev.driver_data, but when calling snd_soc_register_card,the
function dev_set_drvdata(card->dev, card) will also do the same copy
operation,so i think that the former copy operation can be removed.

Peng Donglin (12):
  ASoC: s3c24xx_uda134x: Remove unnecessary function call
  ASoC: mediatek: Remove unnecessary function call
  ASoC: Intel: Remove unnecessary function call
  ASoC: atmel: Remove unnecessary function call
  ASoC: atmel: Remove unnecessary function call
  ASoC: rockchip: Remove unnecessary function call
  ASoC: mxs-sgtl5000: Remove unnecessary function call
  ASoC: qcom: Remove useless function call
  ASoC: qcom: Remove unnecessary function call
  ASoC: sun4i-codec: Remove unnecessary function call
  ASoC: tegra: Remove unnecessary function call
  ASoC: ux500: Remove unnecessary function call

 sound/soc/atmel/atmel-classd.c   | 1 -
 sound/soc/atmel/atmel-pdmic.c| 1 -
 sound/soc/intel/boards/bytcht_da7213.c   | 1 -
 sound/soc/intel/boards/bytcht_es8316.c   | 1 -
 sound/soc/intel/boards/bytcr_rt5651.c| 1 -
 sound/soc/intel/boards/cht_bsw_max98090_ti.c | 1 -
 sound/soc/intel/boards/cht_bsw_rt5645.c  | 1 -
 sound/soc/intel/boards/cht_bsw_rt5672.c  | 1 -
 sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c | 1 -
 sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c | 1 -
 sound/soc/mediatek/mt8173/mt8173-rt5650.c| 1 -
 sound/soc/mxs/mxs-sgtl5000.c | 1 -
 sound/soc/qcom/apq8016_sbc.c | 1 -
 sound/soc/qcom/storm.c   | 1 -
 sound/soc/rockchip/rk3288_hdmi_analog.c  | 2 --
 sound/soc/rockchip/rk3399_gru_sound.c| 1 -
 sound/soc/samsung/s3c24xx_uda134x.c  | 1 -
 sound/soc/sunxi/sun4i-codec.c| 1 -
 sound/soc/tegra/tegra_alc5632.c  | 1 -
 sound/soc/tegra/tegra_max98090.c | 1 -
 sound/soc/tegra/tegra_rt5640.c   | 1 -
 sound/soc/tegra/tegra_rt5677.c   | 1 -
 sound/soc/tegra/tegra_sgtl5000.c | 1 -
 sound/soc/tegra/tegra_wm8753.c   | 1 -
 sound/soc/tegra/tegra_wm8903.c   | 1 -
 sound/soc/tegra/tegra_wm9712.c   | 1 -
 sound/soc/tegra/trimslice.c  | 1 -
 sound/soc/ux500/mop500.c | 1 -
 28 files changed, 29 deletions(-)

-- 
1.9.1



[PATCH 00/12] Remove unnecessary function call

2017-08-19 Thread Peng Donglin
First of all,the address of pdev->dev is assigned to card->dev,then
the function platform_set_drvdata copies the value the variable card
to pdev->dev.driver_data, but when calling snd_soc_register_card,the
function dev_set_drvdata(card->dev, card) will also do the same copy
operation,so i think that the former copy operation can be removed.

Peng Donglin (12):
  ASoC: s3c24xx_uda134x: Remove unnecessary function call
  ASoC: mediatek: Remove unnecessary function call
  ASoC: Intel: Remove unnecessary function call
  ASoC: atmel: Remove unnecessary function call
  ASoC: atmel: Remove unnecessary function call
  ASoC: rockchip: Remove unnecessary function call
  ASoC: mxs-sgtl5000: Remove unnecessary function call
  ASoC: qcom: Remove useless function call
  ASoC: qcom: Remove unnecessary function call
  ASoC: sun4i-codec: Remove unnecessary function call
  ASoC: tegra: Remove unnecessary function call
  ASoC: ux500: Remove unnecessary function call

 sound/soc/atmel/atmel-classd.c   | 1 -
 sound/soc/atmel/atmel-pdmic.c| 1 -
 sound/soc/intel/boards/bytcht_da7213.c   | 1 -
 sound/soc/intel/boards/bytcht_es8316.c   | 1 -
 sound/soc/intel/boards/bytcr_rt5651.c| 1 -
 sound/soc/intel/boards/cht_bsw_max98090_ti.c | 1 -
 sound/soc/intel/boards/cht_bsw_rt5645.c  | 1 -
 sound/soc/intel/boards/cht_bsw_rt5672.c  | 1 -
 sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c | 1 -
 sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c | 1 -
 sound/soc/mediatek/mt8173/mt8173-rt5650.c| 1 -
 sound/soc/mxs/mxs-sgtl5000.c | 1 -
 sound/soc/qcom/apq8016_sbc.c | 1 -
 sound/soc/qcom/storm.c   | 1 -
 sound/soc/rockchip/rk3288_hdmi_analog.c  | 2 --
 sound/soc/rockchip/rk3399_gru_sound.c| 1 -
 sound/soc/samsung/s3c24xx_uda134x.c  | 1 -
 sound/soc/sunxi/sun4i-codec.c| 1 -
 sound/soc/tegra/tegra_alc5632.c  | 1 -
 sound/soc/tegra/tegra_max98090.c | 1 -
 sound/soc/tegra/tegra_rt5640.c   | 1 -
 sound/soc/tegra/tegra_rt5677.c   | 1 -
 sound/soc/tegra/tegra_sgtl5000.c | 1 -
 sound/soc/tegra/tegra_wm8753.c   | 1 -
 sound/soc/tegra/tegra_wm8903.c   | 1 -
 sound/soc/tegra/tegra_wm9712.c   | 1 -
 sound/soc/tegra/trimslice.c  | 1 -
 sound/soc/ux500/mop500.c | 1 -
 28 files changed, 29 deletions(-)

-- 
1.9.1



[PATCH] sound: fix some checkpatch errors and warnings.

2017-08-18 Thread Peng Donglin
ERROR: trailing whitespace
WARNING: please, no spaces at the start of a line
ERROR: open brace '{' following struct go on the same line
ERROR: do not initialise statics to 0
ERROR: "foo * bar" should be "foo *bar"
ERROR: spaces required around that '='
ERROR: switch and case should be at the same indent
WARNING: Statements should start on a tabstop
WARNING: Block comments use * on subsequent lines

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/last.c   |   2 +-
 sound/sound_core.c | 163 -
 2 files changed, 76 insertions(+), 89 deletions(-)

diff --git a/sound/last.c b/sound/last.c
index 43f2228..a47bbe0 100644
--- a/sound/last.c
+++ b/sound/last.c
@@ -25,7 +25,7 @@
 static int __init alsa_sound_last_init(void)
 {
int idx, ok = 0;
-   
+
printk(KERN_INFO "ALSA device list:\n");
for (idx = 0; idx < SNDRV_CARDS; idx++)
if (snd_cards[idx] != NULL) {
diff --git a/sound/sound_core.c b/sound/sound_core.c
index 99b73c6..f99bb7a 100644
--- a/sound/sound_core.c
+++ b/sound/sound_core.c
@@ -68,7 +68,7 @@ static void __exit cleanup_soundcore(void)
 #ifdef CONFIG_SOUND_OSS_CORE
 /*
  * OSS sound core handling. Breaks out sound functions to submodules
- * 
+ *
  * Author: Alan Cox <a...@lxorguk.ukuu.org.uk>
  *
  * Fixes:
@@ -80,9 +80,9 @@ static void __exit cleanup_soundcore(void)
  * 2 of the License, or (at your option) any later version.
  *
  * 
- * 
+ *
  * Top level handler for the sound subsystem. Various devices can
- * plug into this. The fact they don't all go via OSS doesn't mean 
+ * plug into this. The fact they don't all go via OSS doesn't mean
  * they don't have to implement the OSS API. There is a lot of logic
  * to keeping much of the OSS weight out of the code in a compatibility
  * module, but it's up to the driver to rember to load it...
@@ -111,8 +111,7 @@ static void __exit cleanup_soundcore(void)
 
 #define SOUND_STEP 16
 
-struct sound_unit
-{
+struct sound_unit {
int unit_minor;
const struct file_operations *unit_fops;
struct sound_unit *next;
@@ -151,15 +150,14 @@ struct sound_unit
 #ifdef CONFIG_SOUND_OSS_CORE_PRECLAIM
 static int preclaim_oss = 1;
 #else
-static int preclaim_oss = 0;
+static int preclaim_oss;
 #endif
 
 module_param(preclaim_oss, int, 0444);
 
 static int soundcore_open(struct inode *, struct file *);
 
-static const struct file_operations soundcore_fops =
-{
+static const struct file_operations soundcore_fops = {
/* We must have an owner or the module locking fails */
.owner  = THIS_MODULE,
.open   = soundcore_open,
@@ -171,70 +169,68 @@ struct sound_unit
  * join into it. Called with the lock asserted
  */
 
-static int __sound_insert_unit(struct sound_unit * s, struct sound_unit 
**list, const struct file_operations *fops, int index, int low, int top)
+static int __sound_insert_unit(struct sound_unit *s, struct sound_unit **list,
+  const struct file_operations *fops, int index,
+  int low, int top)
 {
-   int n=low;
+   int n = low;
 
if (index < 0) {/* first free */
 
-   while (*list && (*list)->unit_minor<n)
-   list=&((*list)->next);
+   while (*list && (*list)->unit_minor < n)
+   list = &((*list)->next);
 
-   while(n<top)
-   {
+   while (n < top) {
/* Found a hole ? */
-   if(*list==NULL || (*list)->unit_minor>n)
+   if (*list == NULL || (*list)->unit_minor > n)
break;
-   list=&((*list)->next);
-   n+=SOUND_STEP;
+   list = &((*list)->next);
+   n += SOUND_STEP;
}
 
-   if(n>=top)
+   if (n >= top)
return -ENOENT;
} else {
n = low+(index*16);
while (*list) {
-   if ((*list)->unit_minor==n)
+   if ((*list)->unit_minor == n)
return -EBUSY;
-   if ((*list)->unit_minor>n)
+   if ((*list)->unit_minor > n)
break;
-   list=&((*list)->next);
+   list = &((*list)->next);
}
-   }   
-   
+   }
+
/*
 *  Fill it in
 */
-
-   s->unit_minor=n;
-   s->unit_fops=fops;
-   
+
+   s->unit_minor = n;
+   s->unit_fo

[PATCH] sound: fix some checkpatch errors and warnings.

2017-08-18 Thread Peng Donglin
ERROR: trailing whitespace
WARNING: please, no spaces at the start of a line
ERROR: open brace '{' following struct go on the same line
ERROR: do not initialise statics to 0
ERROR: "foo * bar" should be "foo *bar"
ERROR: spaces required around that '='
ERROR: switch and case should be at the same indent
WARNING: Statements should start on a tabstop
WARNING: Block comments use * on subsequent lines

Signed-off-by: Peng Donglin 
---
 sound/last.c   |   2 +-
 sound/sound_core.c | 163 -
 2 files changed, 76 insertions(+), 89 deletions(-)

diff --git a/sound/last.c b/sound/last.c
index 43f2228..a47bbe0 100644
--- a/sound/last.c
+++ b/sound/last.c
@@ -25,7 +25,7 @@
 static int __init alsa_sound_last_init(void)
 {
int idx, ok = 0;
-   
+
printk(KERN_INFO "ALSA device list:\n");
for (idx = 0; idx < SNDRV_CARDS; idx++)
if (snd_cards[idx] != NULL) {
diff --git a/sound/sound_core.c b/sound/sound_core.c
index 99b73c6..f99bb7a 100644
--- a/sound/sound_core.c
+++ b/sound/sound_core.c
@@ -68,7 +68,7 @@ static void __exit cleanup_soundcore(void)
 #ifdef CONFIG_SOUND_OSS_CORE
 /*
  * OSS sound core handling. Breaks out sound functions to submodules
- * 
+ *
  * Author: Alan Cox 
  *
  * Fixes:
@@ -80,9 +80,9 @@ static void __exit cleanup_soundcore(void)
  * 2 of the License, or (at your option) any later version.
  *
  * 
- * 
+ *
  * Top level handler for the sound subsystem. Various devices can
- * plug into this. The fact they don't all go via OSS doesn't mean 
+ * plug into this. The fact they don't all go via OSS doesn't mean
  * they don't have to implement the OSS API. There is a lot of logic
  * to keeping much of the OSS weight out of the code in a compatibility
  * module, but it's up to the driver to rember to load it...
@@ -111,8 +111,7 @@ static void __exit cleanup_soundcore(void)
 
 #define SOUND_STEP 16
 
-struct sound_unit
-{
+struct sound_unit {
int unit_minor;
const struct file_operations *unit_fops;
struct sound_unit *next;
@@ -151,15 +150,14 @@ struct sound_unit
 #ifdef CONFIG_SOUND_OSS_CORE_PRECLAIM
 static int preclaim_oss = 1;
 #else
-static int preclaim_oss = 0;
+static int preclaim_oss;
 #endif
 
 module_param(preclaim_oss, int, 0444);
 
 static int soundcore_open(struct inode *, struct file *);
 
-static const struct file_operations soundcore_fops =
-{
+static const struct file_operations soundcore_fops = {
/* We must have an owner or the module locking fails */
.owner  = THIS_MODULE,
.open   = soundcore_open,
@@ -171,70 +169,68 @@ struct sound_unit
  * join into it. Called with the lock asserted
  */
 
-static int __sound_insert_unit(struct sound_unit * s, struct sound_unit 
**list, const struct file_operations *fops, int index, int low, int top)
+static int __sound_insert_unit(struct sound_unit *s, struct sound_unit **list,
+  const struct file_operations *fops, int index,
+  int low, int top)
 {
-   int n=low;
+   int n = low;
 
if (index < 0) {/* first free */
 
-   while (*list && (*list)->unit_minornext);
+   while (*list && (*list)->unit_minor < n)
+   list = &((*list)->next);
 
-   while(nunit_minor>n)
+   if (*list == NULL || (*list)->unit_minor > n)
break;
-   list=&((*list)->next);
-   n+=SOUND_STEP;
+   list = &((*list)->next);
+   n += SOUND_STEP;
}
 
-   if(n>=top)
+   if (n >= top)
return -ENOENT;
} else {
n = low+(index*16);
while (*list) {
-   if ((*list)->unit_minor==n)
+   if ((*list)->unit_minor == n)
return -EBUSY;
-   if ((*list)->unit_minor>n)
+   if ((*list)->unit_minor > n)
break;
-   list=&((*list)->next);
+   list = &((*list)->next);
}
-   }   
-   
+   }
+
/*
 *  Fill it in
 */
-
-   s->unit_minor=n;
-   s->unit_fops=fops;
-   
+
+   s->unit_minor = n;
+   s->unit_fops = fops;
+
/*
 *  Link it
 */
-
-   s->next=*list;
-   *list=s;
-   
-   
+
+   s->next = *list;
+   *list = s;
+
return n;
 }
 
 /*
  * Remove a node from the chain. Called with the lock asserted
  *

[PATCH] ASoC: compress: Set reasonable compress id string

2017-08-16 Thread Peng Donglin
For dynamic compress rtd, the codec_dai may not have any actual
meaning(like snd-soc-dummy-dai), so compress id can just use the
value of dai_link->stream_name. But for others, its codec_dai
has actual meaning, so compress id can include codec_dai name.

Signed-off-by: Peng Donglin <dolinux.p...@gmail.com>
---
 sound/soc/soc-compress.c | 16 ++--
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index 206f36b..b6a0714 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -737,9 +737,6 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, 
int num)
}
 
/* check client and interface hw capabilities */
-   snprintf(new_name, sizeof(new_name), "%s %s-%d",
-   rtd->dai_link->stream_name, codec_dai->name, num);
-
if (codec_dai->driver->playback.channels_min)
playback = 1;
if (codec_dai->driver->capture.channels_min)
@@ -758,7 +755,7 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, 
int num)
return -EINVAL;
}
 
-   if(playback)
+   if (playback)
direction = SND_COMPRESS_PLAYBACK;
else
direction = SND_COMPRESS_CAPTURE;
@@ -797,19 +794,18 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, 
int num)
else if (rtd->dai_link->dpcm_capture)

be_pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->private_data = rtd;
memcpy(compr->ops, _compr_dyn_ops, 
sizeof(soc_compr_dyn_ops));
-   } else
+   } else {
+   snprintf(new_name, sizeof(new_name), "%s %s-%d",
+   rtd->dai_link->stream_name, codec_dai->name, num);
+
memcpy(compr->ops, _compr_ops, sizeof(soc_compr_ops));
+   }
 
/* Add copy callback for not memory mapped DSPs */
if (platform->driver->compr_ops && platform->driver->compr_ops->copy)
compr->ops->copy = soc_compr_copy;
 
mutex_init(>lock);
-
-   snprintf(new_name, sizeof(new_name), "%s %s-%d",
-rtd->dai_link->stream_name,
-rtd->codec_dai->name, num);
-
ret = snd_compress_new(rtd->card->snd_card, num, direction,
new_name, compr);
if (ret < 0) {
-- 
1.9.1



[PATCH] ASoC: compress: Set reasonable compress id string

2017-08-16 Thread Peng Donglin
For dynamic compress rtd, the codec_dai may not have any actual
meaning(like snd-soc-dummy-dai), so compress id can just use the
value of dai_link->stream_name. But for others, its codec_dai
has actual meaning, so compress id can include codec_dai name.

Signed-off-by: Peng Donglin 
---
 sound/soc/soc-compress.c | 16 ++--
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index 206f36b..b6a0714 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -737,9 +737,6 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, 
int num)
}
 
/* check client and interface hw capabilities */
-   snprintf(new_name, sizeof(new_name), "%s %s-%d",
-   rtd->dai_link->stream_name, codec_dai->name, num);
-
if (codec_dai->driver->playback.channels_min)
playback = 1;
if (codec_dai->driver->capture.channels_min)
@@ -758,7 +755,7 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, 
int num)
return -EINVAL;
}
 
-   if(playback)
+   if (playback)
direction = SND_COMPRESS_PLAYBACK;
else
direction = SND_COMPRESS_CAPTURE;
@@ -797,19 +794,18 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, 
int num)
else if (rtd->dai_link->dpcm_capture)

be_pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->private_data = rtd;
memcpy(compr->ops, _compr_dyn_ops, 
sizeof(soc_compr_dyn_ops));
-   } else
+   } else {
+   snprintf(new_name, sizeof(new_name), "%s %s-%d",
+   rtd->dai_link->stream_name, codec_dai->name, num);
+
memcpy(compr->ops, _compr_ops, sizeof(soc_compr_ops));
+   }
 
/* Add copy callback for not memory mapped DSPs */
if (platform->driver->compr_ops && platform->driver->compr_ops->copy)
compr->ops->copy = soc_compr_copy;
 
mutex_init(>lock);
-
-   snprintf(new_name, sizeof(new_name), "%s %s-%d",
-rtd->dai_link->stream_name,
-rtd->codec_dai->name, num);
-
ret = snd_compress_new(rtd->card->snd_card, num, direction,
new_name, compr);
if (ret < 0) {
-- 
1.9.1