Commit 75e86358 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

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: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: default avatarDave Stevenson <dave.stevenson@raspberrypi.com>
Acked-by: default avatarLiviu Dudau <liviu.dudau@arm.com>
Link: https://patch.msgid.link/2256082.irdbgypaU6@rafael.j.wysocki
parent e9df6eba
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -77,7 +77,6 @@ static void malidp_crtc_atomic_disable(struct drm_crtc *crtc,
									 crtc);
	struct malidp_drm *malidp = crtc_to_malidp_device(crtc);
	struct malidp_hw_device *hwdev = malidp->dev;
	int err;

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

	clk_disable_unprepare(hwdev->pxlclk);

	err = pm_runtime_put(crtc->dev->dev);
	if (err < 0) {
		DRM_DEBUG_DRIVER("Failed to disable runtime power management: %d\n", err);
	}
	pm_runtime_put(crtc->dev->dev);
}

static const struct gamma_curve_segment {
+1 −3
Original line number Diff line number Diff line
@@ -280,9 +280,7 @@ static void imx8qm_ldb_bridge_atomic_disable(struct drm_bridge *bridge,
	clk_disable_unprepare(imx8qm_ldb->clk_bypass);
	clk_disable_unprepare(imx8qm_ldb->clk_pixel);

	ret = pm_runtime_put(dev);
	if (ret < 0)
		DRM_DEV_ERROR(dev, "failed to put runtime PM: %d\n", ret);
	pm_runtime_put(dev);
}

static const u32 imx8qm_ldb_bus_output_fmts[] = {
+1 −3
Original line number Diff line number Diff line
@@ -282,9 +282,7 @@ static void imx8qxp_ldb_bridge_atomic_disable(struct drm_bridge *bridge,
	if (is_split && companion)
		companion->funcs->atomic_disable(companion, state);

	ret = pm_runtime_put(dev);
	if (ret < 0)
		DRM_DEV_ERROR(dev, "failed to put runtime PM: %d\n", ret);
	pm_runtime_put(dev);
}

static const u32 imx8qxp_ldb_bus_output_fmts[] = {
+1 −4
Original line number Diff line number Diff line
@@ -181,11 +181,8 @@ static void imx8qxp_pc_bridge_atomic_disable(struct drm_bridge *bridge,
{
	struct imx8qxp_pc_channel *ch = bridge->driver_private;
	struct imx8qxp_pc *pc = ch->pc;
	int ret;

	ret = pm_runtime_put(pc->dev);
	if (ret < 0)
		DRM_DEV_ERROR(pc->dev, "failed to put runtime PM: %d\n", ret);
	pm_runtime_put(pc->dev);
}

static const u32 imx8qxp_pc_bus_output_fmts[] = {
+1 −4
Original line number Diff line number Diff line
@@ -127,11 +127,8 @@ static void imx8qxp_pxl2dpi_bridge_atomic_disable(struct drm_bridge *bridge,
						  struct drm_atomic_state *state)
{
	struct imx8qxp_pxl2dpi *p2d = bridge->driver_private;
	int ret;

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

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