Skip to content

Commit 75e8635

Browse files
committed
drm: Discard pm_runtime_put() return value
Multiple DRM drivers use the pm_runtime_put() return value for printing debug or even error messages and all of those messages are at least somewhat misleading. Returning an error code from pm_runtime_put() merely means that it has not queued up a work item to check whether or not the device can be suspended and there are many perfectly valid situations in which that can happen, like after writing "on" to the devices' runtime PM "control" attribute in sysfs for one example. It also happens when the kernel has been configured with CONFIG_PM unset. For this reason, modify all of those drivers to simply discard the pm_runtime_put() return value which is what they should be doing. This will facilitate a planned change of the pm_runtime_put() return type to void in the future. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Link: https://patch.msgid.link/2256082.irdbgypaU6@rafael.j.wysocki
1 parent e9df6eb commit 75e8635

8 files changed

Lines changed: 11 additions & 42 deletions

File tree

drivers/gpu/drm/arm/malidp_crtc.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ static void malidp_crtc_atomic_disable(struct drm_crtc *crtc,
7777
crtc);
7878
struct malidp_drm *malidp = crtc_to_malidp_device(crtc);
7979
struct malidp_hw_device *hwdev = malidp->dev;
80-
int err;
8180

8281
/* always disable planes on the CRTC that is being turned off */
8382
drm_atomic_helper_disable_planes_on_crtc(old_state, false);
@@ -87,10 +86,7 @@ static void malidp_crtc_atomic_disable(struct drm_crtc *crtc,
8786

8887
clk_disable_unprepare(hwdev->pxlclk);
8988

90-
err = pm_runtime_put(crtc->dev->dev);
91-
if (err < 0) {
92-
DRM_DEBUG_DRIVER("Failed to disable runtime power management: %d\n", err);
93-
}
89+
pm_runtime_put(crtc->dev->dev);
9490
}
9591

9692
static const struct gamma_curve_segment {

drivers/gpu/drm/bridge/imx/imx8qm-ldb.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,7 @@ static void imx8qm_ldb_bridge_atomic_disable(struct drm_bridge *bridge,
280280
clk_disable_unprepare(imx8qm_ldb->clk_bypass);
281281
clk_disable_unprepare(imx8qm_ldb->clk_pixel);
282282

283-
ret = pm_runtime_put(dev);
284-
if (ret < 0)
285-
DRM_DEV_ERROR(dev, "failed to put runtime PM: %d\n", ret);
283+
pm_runtime_put(dev);
286284
}
287285

288286
static const u32 imx8qm_ldb_bus_output_fmts[] = {

drivers/gpu/drm/bridge/imx/imx8qxp-ldb.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,7 @@ static void imx8qxp_ldb_bridge_atomic_disable(struct drm_bridge *bridge,
282282
if (is_split && companion)
283283
companion->funcs->atomic_disable(companion, state);
284284

285-
ret = pm_runtime_put(dev);
286-
if (ret < 0)
287-
DRM_DEV_ERROR(dev, "failed to put runtime PM: %d\n", ret);
285+
pm_runtime_put(dev);
288286
}
289287

290288
static const u32 imx8qxp_ldb_bus_output_fmts[] = {

drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,8 @@ static void imx8qxp_pc_bridge_atomic_disable(struct drm_bridge *bridge,
181181
{
182182
struct imx8qxp_pc_channel *ch = bridge->driver_private;
183183
struct imx8qxp_pc *pc = ch->pc;
184-
int ret;
185184

186-
ret = pm_runtime_put(pc->dev);
187-
if (ret < 0)
188-
DRM_DEV_ERROR(pc->dev, "failed to put runtime PM: %d\n", ret);
185+
pm_runtime_put(pc->dev);
189186
}
190187

191188
static const u32 imx8qxp_pc_bus_output_fmts[] = {

drivers/gpu/drm/bridge/imx/imx8qxp-pxl2dpi.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,8 @@ static void imx8qxp_pxl2dpi_bridge_atomic_disable(struct drm_bridge *bridge,
127127
struct drm_atomic_state *state)
128128
{
129129
struct imx8qxp_pxl2dpi *p2d = bridge->driver_private;
130-
int ret;
131130

132-
ret = pm_runtime_put(p2d->dev);
133-
if (ret < 0)
134-
DRM_DEV_ERROR(p2d->dev, "failed to put runtime PM: %d\n", ret);
131+
pm_runtime_put(p2d->dev);
135132

136133
if (p2d->companion)
137134
p2d->companion->funcs->atomic_disable(p2d->companion, state);

drivers/gpu/drm/imx/dc/dc-crtc.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ dc_crtc_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *state)
300300
drm_atomic_get_new_crtc_state(state, crtc);
301301
struct dc_drm_device *dc_drm = to_dc_drm_device(crtc->dev);
302302
struct dc_crtc *dc_crtc = to_dc_crtc(crtc);
303-
int idx, ret;
303+
int idx;
304304

305305
if (!drm_dev_enter(crtc->dev, &idx))
306306
goto out;
@@ -313,16 +313,10 @@ dc_crtc_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *state)
313313
dc_fg_disable_clock(dc_crtc->fg);
314314

315315
/* request pixel engine power-off as plane is off too */
316-
ret = pm_runtime_put(dc_drm->pe->dev);
317-
if (ret)
318-
dc_crtc_err(crtc, "failed to put DC pixel engine RPM: %d\n",
319-
ret);
316+
pm_runtime_put(dc_drm->pe->dev);
320317

321318
/* request display engine power-off when CRTC is disabled */
322-
ret = pm_runtime_put(dc_crtc->de->dev);
323-
if (ret < 0)
324-
dc_crtc_err(crtc, "failed to put DC display engine RPM: %d\n",
325-
ret);
319+
pm_runtime_put(dc_crtc->de->dev);
326320

327321
drm_dev_exit(idx);
328322

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,6 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder,
848848
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
849849
struct drm_device *drm = vc4_hdmi->connector.dev;
850850
unsigned long flags;
851-
int ret;
852851
int idx;
853852

854853
mutex_lock(&vc4_hdmi->mutex);
@@ -867,9 +866,7 @@ static void vc4_hdmi_encoder_post_crtc_powerdown(struct drm_encoder *encoder,
867866
clk_disable_unprepare(vc4_hdmi->pixel_bvb_clock);
868867
clk_disable_unprepare(vc4_hdmi->pixel_clock);
869868

870-
ret = pm_runtime_put(&vc4_hdmi->pdev->dev);
871-
if (ret < 0)
872-
drm_err(drm, "Failed to release power domain: %d\n", ret);
869+
pm_runtime_put(&vc4_hdmi->pdev->dev);
873870

874871
drm_dev_exit(idx);
875872

drivers/gpu/drm/vc4/vc4_vec.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ static void vc4_vec_encoder_disable(struct drm_encoder *encoder,
542542
{
543543
struct drm_device *drm = encoder->dev;
544544
struct vc4_vec *vec = encoder_to_vc4_vec(encoder);
545-
int idx, ret;
545+
int idx;
546546

547547
if (!drm_dev_enter(drm, &idx))
548548
return;
@@ -556,16 +556,8 @@ static void vc4_vec_encoder_disable(struct drm_encoder *encoder,
556556

557557
clk_disable_unprepare(vec->clock);
558558

559-
ret = pm_runtime_put(&vec->pdev->dev);
560-
if (ret < 0) {
561-
drm_err(drm, "Failed to release power domain: %d\n", ret);
562-
goto err_dev_exit;
563-
}
564-
565-
drm_dev_exit(idx);
566-
return;
559+
pm_runtime_put(&vec->pdev->dev);
567560

568-
err_dev_exit:
569561
drm_dev_exit(idx);
570562
}
571563

0 commit comments

Comments
 (0)