diff options
author | Douglas Anderson <dianders@chromium.org> | 2021-04-23 09:58:50 -0700 |
---|---|---|
committer | Douglas Anderson <dianders@chromium.org> | 2021-05-03 13:21:08 -0700 |
commit | dea2500a820c0005bf0092d77d77eb9ca819ca1f (patch) | |
tree | 980699e59720aa399305aab4bef923d356a9d40e /drivers/gpu | |
parent | 905d66d08d0f73a3fbd2d16c6756e30272ac81b5 (diff) | |
download | linux-dea2500a820c0005bf0092d77d77eb9ca819ca1f.tar.bz2 |
drm/bridge: ti-sn65dsi86: Use devm to do our runtime_disable
There's no devm_runtime_enable(), but it's easy to use
devm_add_action_or_reset() and means we don't need to worry about the
disable in our remove() routine or in error paths.
No functional changes intended by this change.
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210423095743.v5.4.I1e627eb5f316c0cf6595b120e6e262f5bf890300@changeid
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/bridge/ti-sn65dsi86.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi86.c b/drivers/gpu/drm/bridge/ti-sn65dsi86.c index b1271865785b..443b532f6c6b 100644 --- a/drivers/gpu/drm/bridge/ti-sn65dsi86.c +++ b/drivers/gpu/drm/bridge/ti-sn65dsi86.c @@ -1214,6 +1214,11 @@ static void ti_sn_bridge_parse_lanes(struct ti_sn65dsi86 *pdata, pdata->ln_polrs = ln_polrs; } +static void ti_sn65dsi86_runtime_disable(void *data) +{ + pm_runtime_disable(data); +} + static int ti_sn65dsi86_probe(struct i2c_client *client, const struct i2c_device_id *id) { @@ -1273,12 +1278,13 @@ static int ti_sn65dsi86_probe(struct i2c_client *client, return ret; pm_runtime_enable(pdata->dev); + ret = devm_add_action_or_reset(pdata->dev, ti_sn65dsi86_runtime_disable, pdata->dev); + if (ret) + return ret; ret = ti_sn_setup_gpio_controller(pdata); - if (ret) { - pm_runtime_disable(pdata->dev); + if (ret) return ret; - } i2c_set_clientdata(client, pdata); @@ -1315,8 +1321,6 @@ static int ti_sn65dsi86_remove(struct i2c_client *client) drm_bridge_remove(&pdata->bridge); - pm_runtime_disable(pdata->dev); - of_node_put(pdata->host_node); return 0; |