[Intel-gfx] [PATCH] drm/i915: Make intel_dsi_init() return void
Jani Nikula
jani.nikula at linux.intel.com
Tue Jun 3 14:05:14 CEST 2014
On Wed, 28 May 2014, Damien Lespiau <damien.lespiau at intel.com> wrote:
> 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 at linux.intel.com>
> Suggested-by: Shobhit Kumar <shobhit.kumar at intel.com>
> Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
> Cc: Shobhit Kumar <shobhit.kumar at intel.com>
> Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
> ---
> drivers/gpu/drm/i915/intel_drv.h | 2 +-
> drivers/gpu/drm/i915/intel_dsi.c | 12 ++++++------
> 2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index edecf89..62686b2 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -831,7 +831,7 @@ void intel_edp_psr_update(struct drm_device *dev);
> void intel_dp_set_drrs_state(struct drm_device *dev, int refresh_rate);
>
> /* intel_dsi.c */
> -bool intel_dsi_init(struct drm_device *dev);
> +void intel_dsi_init(struct drm_device *dev);
>
>
> /* intel_dvo.c */
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index e73bec6..4dbd160 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -646,7 +646,7 @@ static const struct drm_connector_funcs intel_dsi_connector_funcs = {
> .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_encoder *intel_encoder;
> @@ -662,12 +662,12 @@ bool intel_dsi_init(struct drm_device *dev)
>
> intel_dsi = kzalloc(sizeof(*intel_dsi), GFP_KERNEL);
> if (!intel_dsi)
> - return false;
> + return;
>
> intel_connector = kzalloc(sizeof(*intel_connector), GFP_KERNEL);
> if (!intel_connector) {
> kfree(intel_dsi);
> - return false;
> + return;
> }
>
> intel_encoder = &intel_dsi->base;
> @@ -678,7 +678,7 @@ bool intel_dsi_init(struct drm_device *dev)
> dev_priv->mipi_mmio_base = VLV_MIPI_BASE;
> } else {
> DRM_ERROR("Unsupported Mipi device to reg base");
> - return false;
> + return;
> }
>
> connector = &intel_connector->base;
> @@ -738,12 +738,12 @@ bool intel_dsi_init(struct drm_device *dev)
> fixed_mode->type |= DRM_MODE_TYPE_PREFERRED;
> intel_panel_init(&intel_connector->panel, fixed_mode, NULL);
>
> - return true;
> + return;
>
> err:
> drm_encoder_cleanup(&intel_encoder->base);
> kfree(intel_dsi);
> kfree(intel_connector);
>
> - return false;
> + return;
Okay this went in already, but I find return statements at the end of
void functions like that a bit silly...
...but hey, you can send a fix removing that! ;)
BR,
Jani.
> }
> --
> 1.8.3.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Jani Nikula, Intel Open Source Technology Center
More information about the Intel-gfx
mailing list