summaryrefslogtreecommitdiffstats
path: root/sound/soc/omap
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2017-06-09 15:06:54 +0300
committerMark Brown <broonie@kernel.org>2017-06-09 18:38:35 +0100
commit69beca69d68b69b38c2610b8b5fd2e27a40d441b (patch)
tree38bcccacfc0a7388bf67c217b2069853be0d0dbb /sound/soc/omap
parent2ea659a9ef488125eb46da6eb571de5eae5c43f6 (diff)
downloadlinux-69beca69d68b69b38c2610b8b5fd2e27a40d441b.tar.bz2
ASoC: omap-mcbsp: Use sysfs_match_string() helper
Use sysfs_match_string() helper instead of open coded variant. Cc: Peter Ujfalusi <peter.ujfalusi@ti.com> Cc: Jarkko Nikula <jarkko.nikula@bitmer.com> Cc: Mark Brown <broonie@kernel.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/omap')
-rw-r--r--sound/soc/omap/mcbsp.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c
index 06fec5699cc8..7a54e3083203 100644
--- a/sound/soc/omap/mcbsp.c
+++ b/sound/soc/omap/mcbsp.c
@@ -835,15 +835,11 @@ static ssize_t dma_op_mode_store(struct device *dev,
const char *buf, size_t size)
{
struct omap_mcbsp *mcbsp = dev_get_drvdata(dev);
- const char * const *s;
- int i = 0;
-
- for (s = &dma_op_modes[i]; i < ARRAY_SIZE(dma_op_modes); s++, i++)
- if (sysfs_streq(buf, *s))
- break;
+ int i;
- if (i == ARRAY_SIZE(dma_op_modes))
- return -EINVAL;
+ i = sysfs_match_string(dma_op_modes, buf);
+ if (i < 0)
+ return i;
spin_lock_irq(&mcbsp->lock);
if (!mcbsp->free) {