aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs4265.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-04-13 10:23:18 +0200
committerTakashi Iwai <tiwai@suse.de>2015-04-13 10:23:18 +0200
commit9a4f35865ffcb2f4603375eadabe0d475fab1a0f (patch)
tree1465ac717deee029d3a9c1f7235ba85be57feefa /sound/soc/codecs/cs4265.c
parentALSA: usb-audio: Don't attempt to get Microsoft Lifecam Cinema sample rate (diff)
parentALSA: control: Fix a typo of SNDRV_CTL_ELEM_ACCESS_TLV_* with SNDRV_CTL_TLV_OP_* (diff)
downloadlinux-dev-9a4f35865ffcb2f4603375eadabe0d475fab1a0f.tar.xz
linux-dev-9a4f35865ffcb2f4603375eadabe0d475fab1a0f.zip
Merge branch 'for-next' into for-linus
Diffstat (limited to 'sound/soc/codecs/cs4265.c')
-rw-r--r--sound/soc/codecs/cs4265.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/sound/soc/codecs/cs4265.c b/sound/soc/codecs/cs4265.c
index ce6086835ebd..cac48ddf3ba6 100644
--- a/sound/soc/codecs/cs4265.c
+++ b/sound/soc/codecs/cs4265.c
@@ -605,21 +605,14 @@ static int cs4265_i2c_probe(struct i2c_client *i2c_client,
return ret;
}
- cs4265->reset_gpio = devm_gpiod_get(&i2c_client->dev,
- "reset-gpios");
- if (IS_ERR(cs4265->reset_gpio)) {
- ret = PTR_ERR(cs4265->reset_gpio);
- if (ret != -ENOENT && ret != -ENOSYS)
- return ret;
-
- cs4265->reset_gpio = NULL;
- } else {
- ret = gpiod_direction_output(cs4265->reset_gpio, 0);
- if (ret)
- return ret;
+ cs4265->reset_gpio = devm_gpiod_get_optional(&i2c_client->dev,
+ "reset", GPIOD_OUT_LOW);
+ if (IS_ERR(cs4265->reset_gpio))
+ return PTR_ERR(cs4265->reset_gpio);
+
+ if (cs4265->reset_gpio) {
mdelay(1);
gpiod_set_value_cansleep(cs4265->reset_gpio, 1);
-
}
i2c_set_clientdata(i2c_client, cs4265);