aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2019-01-29 09:42:20 -0600
committerMark Brown <broonie@kernel.org>2019-01-29 15:48:11 +0000
commit53b6d0adffb0505db5332589e78da1c66f7e626a (patch)
tree12acd62c84d29e7f3ec31aedff61eacce9f60874
parentASoC: cros_ec_codec: Add codec driver for Cros EC (diff)
downloadlinux-dev-53b6d0adffb0505db5332589e78da1c66f7e626a.tar.xz
linux-dev-53b6d0adffb0505db5332589e78da1c66f7e626a.zip
ASoC: Intel: cht_bsw_rt5672: remove useless test
For some reason we test if the machine is passed as a parameter before fixing up the codec name. This is unnecessary, generates false positives in static analysis tools and done only in this machine driver, remove and adjust indentation. Reported-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/intel/boards/cht_bsw_rt5672.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/sound/soc/intel/boards/cht_bsw_rt5672.c b/sound/soc/intel/boards/cht_bsw_rt5672.c
index f1c1f9dd5353..3d5a2b3a06f0 100644
--- a/sound/soc/intel/boards/cht_bsw_rt5672.c
+++ b/sound/soc/intel/boards/cht_bsw_rt5672.c
@@ -411,18 +411,15 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
strcpy(drv->codec_name, RT5672_I2C_DEFAULT);
/* fixup codec name based on HID */
- if (mach) {
- i2c_name = acpi_dev_get_first_match_name(mach->id, NULL, -1);
- if (i2c_name) {
- snprintf(drv->codec_name, sizeof(drv->codec_name),
- "i2c-%s", i2c_name);
- for (i = 0; i < ARRAY_SIZE(cht_dailink); i++) {
- if (!strcmp(cht_dailink[i].codec_name,
- RT5672_I2C_DEFAULT)) {
- cht_dailink[i].codec_name =
- drv->codec_name;
- break;
- }
+ i2c_name = acpi_dev_get_first_match_name(mach->id, NULL, -1);
+ if (i2c_name) {
+ snprintf(drv->codec_name, sizeof(drv->codec_name),
+ "i2c-%s", i2c_name);
+ for (i = 0; i < ARRAY_SIZE(cht_dailink); i++) {
+ if (!strcmp(cht_dailink[i].codec_name,
+ RT5672_I2C_DEFAULT)) {
+ cht_dailink[i].codec_name = drv->codec_name;
+ break;
}
}
}