Merge "ASoC: wsa881x: Fix GPIO leak issue"
This commit is contained in:
commit
c9ada11e43
1 changed files with 6 additions and 0 deletions
|
@ -1185,6 +1185,7 @@ static int wsa881x_swr_probe(struct swr_device *pdev)
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
struct wsa881x_priv *wsa881x;
|
struct wsa881x_priv *wsa881x;
|
||||||
u8 devnum = 0;
|
u8 devnum = 0;
|
||||||
|
bool pin_state_current = false;
|
||||||
|
|
||||||
wsa881x = devm_kzalloc(&pdev->dev, sizeof(struct wsa881x_priv),
|
wsa881x = devm_kzalloc(&pdev->dev, sizeof(struct wsa881x_priv),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
|
@ -1218,6 +1219,9 @@ static int wsa881x_swr_probe(struct swr_device *pdev)
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
if (wsa881x->wsa_rst_np)
|
||||||
|
pin_state_current = msm_cdc_pinctrl_get_state(
|
||||||
|
wsa881x->wsa_rst_np);
|
||||||
wsa881x_gpio_ctrl(wsa881x, true);
|
wsa881x_gpio_ctrl(wsa881x, true);
|
||||||
wsa881x->state = WSA881X_DEV_UP;
|
wsa881x->state = WSA881X_DEV_UP;
|
||||||
|
|
||||||
|
@ -1280,6 +1284,8 @@ static int wsa881x_swr_probe(struct swr_device *pdev)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
dev_err:
|
dev_err:
|
||||||
|
if (pin_state_current == false)
|
||||||
|
wsa881x_gpio_ctrl(wsa881x, false);
|
||||||
swr_remove_device(pdev);
|
swr_remove_device(pdev);
|
||||||
err:
|
err:
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Add table
Reference in a new issue