[Intel-gfx] [PATCH 43/59] drm/arc: Embedd a drm_connector for sim case
Sam Ravnborg
sam at ravnborg.org
Fri Apr 24 17:34:46 UTC 2020
On Wed, Apr 15, 2020 at 09:40:18AM +0200, Daniel Vetter wrote:
> Removes the last devm_kzalloc, which means we're now prepared to use
> drmm_mode_config_cleanup!
>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> Cc: Alexey Brodkin <abrodkin at synopsys.com>
Acked-by: Sam Ravnborg <sam at ravnborg.org>
> ---
> drivers/gpu/drm/arc/arcpgu.h | 1 +
> drivers/gpu/drm/arc/arcpgu_sim.c | 14 +-------------
> 2 files changed, 2 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/arc/arcpgu.h b/drivers/gpu/drm/arc/arcpgu.h
> index 52afd638a4d2..c52cdd2274e1 100644
> --- a/drivers/gpu/drm/arc/arcpgu.h
> +++ b/drivers/gpu/drm/arc/arcpgu.h
> @@ -15,6 +15,7 @@ struct arcpgu_drm_private {
> void __iomem *regs;
> struct clk *clk;
> struct drm_simple_display_pipe pipe;
> + struct drm_connector sim_conn;
> };
>
> #define dev_to_arcpgu(x) container_of(x, struct arcpgu_drm_private, drm)
> diff --git a/drivers/gpu/drm/arc/arcpgu_sim.c b/drivers/gpu/drm/arc/arcpgu_sim.c
> index 134afb9fa625..e42fe5d05a3d 100644
> --- a/drivers/gpu/drm/arc/arcpgu_sim.c
> +++ b/drivers/gpu/drm/arc/arcpgu_sim.c
> @@ -18,10 +18,6 @@
> #define YRES_MAX 8192
>
>
> -struct arcpgu_drm_connector {
> - struct drm_connector connector;
> -};
> -
> static int arcpgu_drm_connector_get_modes(struct drm_connector *connector)
> {
> int count;
> @@ -57,7 +53,6 @@ static struct drm_encoder_funcs arcpgu_drm_encoder_funcs = {
> int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np)
> {
> struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(drm);
> - struct arcpgu_drm_connector *arcpgu_connector;
> struct drm_encoder *encoder;
> struct drm_connector *connector;
> int ret;
> @@ -72,14 +67,7 @@ int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np)
> if (ret)
> return ret;
>
> - arcpgu_connector = devm_kzalloc(drm->dev, sizeof(*arcpgu_connector),
> - GFP_KERNEL);
> - if (!arcpgu_connector) {
> - ret = -ENOMEM;
> - goto error_encoder_cleanup;
> - }
> -
> - connector = &arcpgu_connector->connector;
> + connector = &arcpgu->sim_conn;
> drm_connector_helper_add(connector, &arcpgu_drm_connector_helper_funcs);
>
> ret = drm_connector_init(drm, connector, &arcpgu_drm_connector_funcs,
> --
> 2.25.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
More information about the Intel-gfx
mailing list