drm/i915: Make intel_dsi_init() return void

Functions that can't fail are such a bliss to work with, it'd be shame
to miss the occasion. The "failure" mode is the DSI connector not being
created, the rest of the initialization can carry on happily.

We weren't even checking that value anyway.

Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Suggested-by: Shobhit Kumar <shobhit.kumar@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Shobhit Kumar <shobhit.kumar@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
[danvet: Also convert the missed return statement due to other patches
merged meanwhile.]
[danvet2: Squash in fixup from Damien to remove empty return; at the
end of intel_dsi_init.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Damien Lespiau 2014-05-28 12:30:56 +01:00 committed by Daniel Vetter
parent b5fbcd9897
commit 4328633d65
2 changed files with 7 additions and 9 deletions

View File

@ -834,7 +834,7 @@ void intel_edp_psr_update(struct drm_device *dev);
void intel_dp_set_drrs_state(struct drm_device *dev, int refresh_rate); void intel_dp_set_drrs_state(struct drm_device *dev, int refresh_rate);
/* intel_dsi.c */ /* intel_dsi.c */
bool intel_dsi_init(struct drm_device *dev); void intel_dsi_init(struct drm_device *dev);
/* intel_dvo.c */ /* intel_dvo.c */

View File

@ -657,7 +657,7 @@ static const struct drm_connector_funcs intel_dsi_connector_funcs = {
.fill_modes = drm_helper_probe_single_connector_modes, .fill_modes = drm_helper_probe_single_connector_modes,
}; };
bool intel_dsi_init(struct drm_device *dev) void intel_dsi_init(struct drm_device *dev)
{ {
struct intel_dsi *intel_dsi; struct intel_dsi *intel_dsi;
struct intel_encoder *intel_encoder; struct intel_encoder *intel_encoder;
@ -673,16 +673,16 @@ bool intel_dsi_init(struct drm_device *dev)
/* There is no detection method for MIPI so rely on VBT */ /* There is no detection method for MIPI so rely on VBT */
if (!dev_priv->vbt.has_mipi) if (!dev_priv->vbt.has_mipi)
return false; return;
intel_dsi = kzalloc(sizeof(*intel_dsi), GFP_KERNEL); intel_dsi = kzalloc(sizeof(*intel_dsi), GFP_KERNEL);
if (!intel_dsi) if (!intel_dsi)
return false; return;
intel_connector = kzalloc(sizeof(*intel_connector), GFP_KERNEL); intel_connector = kzalloc(sizeof(*intel_connector), GFP_KERNEL);
if (!intel_connector) { if (!intel_connector) {
kfree(intel_dsi); kfree(intel_dsi);
return false; return;
} }
intel_encoder = &intel_dsi->base; intel_encoder = &intel_dsi->base;
@ -693,7 +693,7 @@ bool intel_dsi_init(struct drm_device *dev)
dev_priv->mipi_mmio_base = VLV_MIPI_BASE; dev_priv->mipi_mmio_base = VLV_MIPI_BASE;
} else { } else {
DRM_ERROR("Unsupported Mipi device to reg base"); DRM_ERROR("Unsupported Mipi device to reg base");
return false; return;
} }
connector = &intel_connector->base; connector = &intel_connector->base;
@ -753,12 +753,10 @@ bool intel_dsi_init(struct drm_device *dev)
fixed_mode->type |= DRM_MODE_TYPE_PREFERRED; fixed_mode->type |= DRM_MODE_TYPE_PREFERRED;
intel_panel_init(&intel_connector->panel, fixed_mode, NULL); intel_panel_init(&intel_connector->panel, fixed_mode, NULL);
return true; return;
err: err:
drm_encoder_cleanup(&intel_encoder->base); drm_encoder_cleanup(&intel_encoder->base);
kfree(intel_dsi); kfree(intel_dsi);
kfree(intel_connector); kfree(intel_connector);
return false;
} }