浏览代码

ASoC: tas2552: Remove unneeded NULL test for tas2552->enable_gpio

It's safe to call gpiod_set_value() with NULL desc.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Axel Lin 10 年之前
父节点
当前提交
82cf77a1bd
共有 1 个文件被更改,包括 5 次插入10 次删除
  1. 5 10
      sound/soc/codecs/tas2552.c

+ 5 - 10
sound/soc/codecs/tas2552.c

@@ -493,8 +493,7 @@ static int tas2552_runtime_suspend(struct device *dev)
 	regcache_cache_only(tas2552->regmap, true);
 	regcache_cache_only(tas2552->regmap, true);
 	regcache_mark_dirty(tas2552->regmap);
 	regcache_mark_dirty(tas2552->regmap);
 
 
-	if (tas2552->enable_gpio)
-		gpiod_set_value(tas2552->enable_gpio, 0);
+	gpiod_set_value(tas2552->enable_gpio, 0);
 
 
 	return 0;
 	return 0;
 }
 }
@@ -503,8 +502,7 @@ static int tas2552_runtime_resume(struct device *dev)
 {
 {
 	struct tas2552_data *tas2552 = dev_get_drvdata(dev);
 	struct tas2552_data *tas2552 = dev_get_drvdata(dev);
 
 
-	if (tas2552->enable_gpio)
-		gpiod_set_value(tas2552->enable_gpio, 1);
+	gpiod_set_value(tas2552->enable_gpio, 1);
 
 
 	tas2552_sw_shutdown(tas2552, 0);
 	tas2552_sw_shutdown(tas2552, 0);
 
 
@@ -585,8 +583,7 @@ static int tas2552_codec_probe(struct snd_soc_codec *codec)
 		return ret;
 		return ret;
 	}
 	}
 
 
-	if (tas2552->enable_gpio)
-		gpiod_set_value(tas2552->enable_gpio, 1);
+	gpiod_set_value(tas2552->enable_gpio, 1);
 
 
 	ret = pm_runtime_get_sync(codec->dev);
 	ret = pm_runtime_get_sync(codec->dev);
 	if (ret < 0) {
 	if (ret < 0) {
@@ -610,8 +607,7 @@ static int tas2552_codec_probe(struct snd_soc_codec *codec)
 	return 0;
 	return 0;
 
 
 probe_fail:
 probe_fail:
-	if (tas2552->enable_gpio)
-		gpiod_set_value(tas2552->enable_gpio, 0);
+	gpiod_set_value(tas2552->enable_gpio, 0);
 
 
 	regulator_bulk_disable(ARRAY_SIZE(tas2552->supplies),
 	regulator_bulk_disable(ARRAY_SIZE(tas2552->supplies),
 					tas2552->supplies);
 					tas2552->supplies);
@@ -624,8 +620,7 @@ static int tas2552_codec_remove(struct snd_soc_codec *codec)
 
 
 	pm_runtime_put(codec->dev);
 	pm_runtime_put(codec->dev);
 
 
-	if (tas2552->enable_gpio)
-		gpiod_set_value(tas2552->enable_gpio, 0);
+	gpiod_set_value(tas2552->enable_gpio, 0);
 
 
 	return 0;
 	return 0;
 };
 };