Commit 69beca69 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mark Brown

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2ea659a9
...@@ -835,15 +835,11 @@ static ssize_t dma_op_mode_store(struct device *dev, ...@@ -835,15 +835,11 @@ static ssize_t dma_op_mode_store(struct device *dev,
const char *buf, size_t size) const char *buf, size_t size)
{ {
struct omap_mcbsp *mcbsp = dev_get_drvdata(dev); struct omap_mcbsp *mcbsp = dev_get_drvdata(dev);
const char * const *s; int i;
int i = 0;
for (s = &dma_op_modes[i]; i < ARRAY_SIZE(dma_op_modes); s++, i++)
if (sysfs_streq(buf, *s))
break;
if (i == ARRAY_SIZE(dma_op_modes)) i = sysfs_match_string(dma_op_modes, buf);
return -EINVAL; if (i < 0)
return i;
spin_lock_irq(&mcbsp->lock); spin_lock_irq(&mcbsp->lock);
if (!mcbsp->free) { if (!mcbsp->free) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment