]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: fsl_ssi: Use the tolower() function
authorFabio Estevam <fabio.estevam@nxp.com>
Wed, 5 Apr 2017 19:44:06 +0000 (16:44 -0300)
committerMark Brown <broonie@kernel.org>
Mon, 10 Apr 2017 17:49:17 +0000 (18:49 +0100)
Code can be simplified by using the standard tolower() funtion.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Acked-by: Timur Tabi <timur@tabi.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_ssi.c

index 184a47360f84fad3614bdaf34811cf0f86bdbbe7..549a598d030ee8b56deb6575f58557b70ded8155 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/clk.h>
+#include <linux/ctype.h>
 #include <linux/device.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
@@ -1320,14 +1321,10 @@ static struct snd_ac97_bus_ops fsl_ssi_ac97_ops = {
  */
 static void make_lowercase(char *s)
 {
-       char *p = s;
-       char c;
-
-       while ((c = *p)) {
-               if ((c >= 'A') && (c <= 'Z'))
-                       *p = c + ('a' - 'A');
-               p++;
-       }
+       if (!s)
+               return;
+       for (; *s; s++)
+               *s = tolower(*s);
 }
 
 static int fsl_ssi_imx_probe(struct platform_device *pdev,