[PATCH 16/44] drm/udl: don't set drm_device->dev_private

Sam Ravnborg sam at ravnborg.org
Wed Apr 8 07:29:30 UTC 2020


On Fri, Apr 03, 2020 at 03:58:00PM +0200, Daniel Vetter wrote:
> We're mostly there already, just a handful of places that didn't use
> the to_udl container_of cast. To make sure no new appear, don't set
> ->dev_private.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> Cc: Dave Airlie <airlied at redhat.com>
> Cc: Sean Paul <sean at poorly.run>
> Cc: Emil Velikov <emil.l.velikov at gmail.com>
> Cc: Thomas Zimmermann <tzimmermann at suse.de>
> Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> Cc: Alexios Zavras <alexios.zavras at intel.com>
> Cc: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Cc: Thomas Gleixner <tglx at linutronix.de>
> Cc: "José Roberto de Souza" <jose.souza at intel.com>
> Cc: Sam Ravnborg <sam at ravnborg.org>
> Cc: Gerd Hoffmann <kraxel at redhat.com>
> Cc: Allison Randal <allison at lohutok.net>
Acked-by: Sam Ravnborg <sam at ravnborg.org>

> ---
>  drivers/gpu/drm/udl/udl_connector.c | 4 ++--
>  drivers/gpu/drm/udl/udl_drv.c       | 1 -
>  drivers/gpu/drm/udl/udl_modeset.c   | 6 +++---
>  3 files changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/udl/udl_connector.c b/drivers/gpu/drm/udl/udl_connector.c
> index 0afdfb0d1fe1..cdc1c42e1669 100644
> --- a/drivers/gpu/drm/udl/udl_connector.c
> +++ b/drivers/gpu/drm/udl/udl_connector.c
> @@ -59,7 +59,7 @@ static int udl_get_modes(struct drm_connector *connector)
>  static enum drm_mode_status udl_mode_valid(struct drm_connector *connector,
>  			  struct drm_display_mode *mode)
>  {
> -	struct udl_device *udl = connector->dev->dev_private;
> +	struct udl_device *udl = to_udl(connector->dev);
>  	if (!udl->sku_pixel_limit)
>  		return 0;
>  
> @@ -72,7 +72,7 @@ static enum drm_mode_status udl_mode_valid(struct drm_connector *connector,
>  static enum drm_connector_status
>  udl_detect(struct drm_connector *connector, bool force)
>  {
> -	struct udl_device *udl = connector->dev->dev_private;
> +	struct udl_device *udl = to_udl(connector->dev);
>  	struct udl_drm_connector *udl_connector =
>  					container_of(connector,
>  					struct udl_drm_connector,
> diff --git a/drivers/gpu/drm/udl/udl_drv.c b/drivers/gpu/drm/udl/udl_drv.c
> index 4ba5149fdd57..126545428895 100644
> --- a/drivers/gpu/drm/udl/udl_drv.c
> +++ b/drivers/gpu/drm/udl/udl_drv.c
> @@ -63,7 +63,6 @@ static struct udl_device *udl_driver_create(struct usb_interface *interface)
>  		return udl;
>  
>  	udl->udev = udev;
> -	udl->drm.dev_private = udl;
>  
>  	r = udl_init(udl);
>  	if (r)
> diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c
> index 8cad01f3d163..99518a826435 100644
> --- a/drivers/gpu/drm/udl/udl_modeset.c
> +++ b/drivers/gpu/drm/udl/udl_modeset.c
> @@ -215,7 +215,7 @@ static char *udl_dummy_render(char *wrptr)
>  static int udl_crtc_write_mode_to_hw(struct drm_crtc *crtc)
>  {
>  	struct drm_device *dev = crtc->dev;
> -	struct udl_device *udl = dev->dev_private;
> +	struct udl_device *udl = to_udl(dev);
>  	struct urb *urb;
>  	char *buf;
>  	int retval;
> @@ -369,7 +369,7 @@ udl_simple_display_pipe_enable(struct drm_simple_display_pipe *pipe,
>  	struct drm_crtc *crtc = &pipe->crtc;
>  	struct drm_device *dev = crtc->dev;
>  	struct drm_framebuffer *fb = plane_state->fb;
> -	struct udl_device *udl = dev->dev_private;
> +	struct udl_device *udl = to_udl(dev);
>  	struct drm_display_mode *mode = &crtc_state->mode;
>  	char *buf;
>  	char *wrptr;
> @@ -464,7 +464,7 @@ static const struct drm_mode_config_funcs udl_mode_funcs = {
>  int udl_modeset_init(struct drm_device *dev)
>  {
>  	size_t format_count = ARRAY_SIZE(udl_simple_display_pipe_formats);
> -	struct udl_device *udl = dev->dev_private;
> +	struct udl_device *udl = to_udl(dev);
>  	struct drm_connector *connector;
>  	int ret;
>  
> -- 
> 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 dri-devel mailing list