[PATCH 1/1] drm/sti: fix master bind bug for using component
Benjamin Gaignard
benjamin.gaignard at linaro.org
Wed Jul 15 03:19:01 PDT 2015
The build order in Makefile hasn't been change so the bug doesn't occur...
In addition of taking care of not changing build order in Makefile,
I would like to understand what is the expected behavior of component
framework when
master call component_bind_all() before any component_add() calls.
Should component bind function be called in component_add() ?
Is up to component to detect that master is already bounded ?
Russell can you tell us what to do in this case ?
Regards,
Benjamin
2015-07-14 11:28 GMT+02:00 Xinwei Kong <kong.kongxinwei at hisilicon.com>:
> From: Xinwei Kong <kong.kongxinwei at hisilicon.com>
>
> This patch fix one bug which it can't call .bind function in
> sti_hdmi.c and sti_hda.c file when changing the building sequence
> (sti_hdmi.o,sti_hda.o) in Makefile file. This patch can prepare
> it.
>
> Signed-off-by: Xinwei Kong <kong.kongxinwei at hisilicon.com>
> ---
> drivers/gpu/drm/sti/sti_tvout.c | 17 ++++++++++++++++-
> 1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c
> index 5cc5311..293dfae 100644
> --- a/drivers/gpu/drm/sti/sti_tvout.c
> +++ b/drivers/gpu/drm/sti/sti_tvout.c
> @@ -683,7 +683,22 @@ static int compare_of(struct device *dev, void *data)
>
> static int sti_tvout_master_bind(struct device *dev)
> {
> - return 0;
> + struct sti_tvout *tvout = dev_get_drvdata(dev);
> + struct drm_device *drm_dev;
> + int ret;
> +
> + if (!tvout->drm_dev) {
> + DRM_ERROR("master bind is fail\n");
> + return 0;
> + }
> +
> + drm_dev = tvout->drm_dev;
> +
> + ret = component_bind_all(dev, drm_dev);
> + if (ret)
> + sti_tvout_destroy_encoders(tvout);
> +
> + return ret;
> }
>
> static void sti_tvout_master_unbind(struct device *dev)
> --
> 1.9.1
>
--
Benjamin Gaignard
Graphic Working Group
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
More information about the dri-devel
mailing list