Skip to content

Commit 410fe39

Browse files
AxelLinbroonie
authored andcommitted
ASoC: cs35l33: Fix testing return value of devm_gpiod_get_optional
devm_gpiod_get_optional() returns NULL when the gpio is not assigned. So the if (PTR_ERR(cs35l33->reset_gpio) == -ENOENT) test is always false. Signed-off-by: Axel Lin <[email protected]> Acked-by: Paul Handrigan <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 20f12f2 commit 410fe39

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

sound/soc/codecs/cs35l33.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,11 +1176,7 @@ static int cs35l33_i2c_probe(struct i2c_client *i2c_client,
11761176
/* We could issue !RST or skip it based on AMP topology */
11771177
cs35l33->reset_gpio = devm_gpiod_get_optional(&i2c_client->dev,
11781178
"reset-gpios", GPIOD_OUT_HIGH);
1179-
1180-
if (PTR_ERR(cs35l33->reset_gpio) == -ENOENT) {
1181-
dev_warn(&i2c_client->dev,
1182-
"%s WARNING: No reset gpio assigned\n", __func__);
1183-
} else if (IS_ERR(cs35l33->reset_gpio)) {
1179+
if (IS_ERR(cs35l33->reset_gpio)) {
11841180
dev_err(&i2c_client->dev, "%s ERROR: Can't get reset GPIO\n",
11851181
__func__);
11861182
return PTR_ERR(cs35l33->reset_gpio);

0 commit comments

Comments
 (0)