diff mbox

[1/5] drm: Unexport drm_connector_register_all()

Message ID 1466778982-6974-1-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson June 24, 2016, 2:36 p.m. UTC
This has now been removed from all drivers as it is performed centrally
as a part of device registration for modesetting drivers. With the last
user gone, we can unexport it from the DRM module.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
---
 drivers/gpu/drm/drm_crtc.c | 19 +------------------
 include/drm/drm_crtc.h     |  1 -
 2 files changed, 1 insertion(+), 19 deletions(-)

Comments

Jani Nikula June 27, 2016, 1:03 p.m. UTC | #1
On Fri, 24 Jun 2016, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> This has now been removed from all drivers as it is performed centrally
> as a part of device registration for modesetting drivers. With the last
> user gone, we can unexport it from the DRM module.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: dri-devel@lists.freedesktop.org
> ---
>  drivers/gpu/drm/drm_crtc.c | 19 +------------------
>  include/drm/drm_crtc.h     |  1 -
>  2 files changed, 1 insertion(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 1190638a3d53..c660ea28cf26 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -1109,23 +1109,7 @@ void drm_connector_unregister(struct drm_connector *connector)
>  }
>  EXPORT_SYMBOL(drm_connector_unregister);
>  
> -/**
> - * drm_connector_register_all - register all connectors
> - * @dev: drm device
> - *
> - * This function registers all connectors in sysfs and other places so that
> - * userspace can start to access them. drm_connector_register_all() is called
> - * automatically from drm_dev_register() to complete the device registration,

Bikeshed, why throw away the documentation when you could just tweak it
to reflect reality?

Just cut from here...

> - * if they don't call drm_connector_register() on each connector individually.
> - *
> - * When a device is unplugged and should be removed from userspace access,
> - * call drm_connector_unregister_all(), which is the inverse of this
> - * function.
> - *

...to here?

BR,
Jani.

> - * Returns:
> - * Zero on success, error code on failure.
> - */
> -int drm_connector_register_all(struct drm_device *dev)
> +static int drm_connector_register_all(struct drm_device *dev)
>  {
>  	struct drm_connector *connector;
>  	int ret;
> @@ -1147,7 +1131,6 @@ err:
>  	drm_connector_unregister_all(dev);
>  	return ret;
>  }
> -EXPORT_SYMBOL(drm_connector_register_all);
>  
>  /**
>   * drm_connector_unregister_all - unregister connector userspace interfaces
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index e6ed7018e290..ddaa7243af55 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -2589,7 +2589,6 @@ static inline unsigned drm_connector_index(struct drm_connector *connector)
>  }
>  
>  /* helpers to {un}register all connectors from sysfs for device */
> -extern int drm_connector_register_all(struct drm_device *dev);
>  extern void drm_connector_unregister_all(struct drm_device *dev);
>  
>  extern __printf(5, 6)
Chris Wilson June 28, 2016, 7:25 a.m. UTC | #2
On Mon, Jun 27, 2016 at 04:03:23PM +0300, Jani Nikula wrote:
> On Fri, 24 Jun 2016, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > This has now been removed from all drivers as it is performed centrally
> > as a part of device registration for modesetting drivers. With the last
> > user gone, we can unexport it from the DRM module.
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: David Airlie <airlied@linux.ie>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Cc: dri-devel@lists.freedesktop.org
> > ---
> >  drivers/gpu/drm/drm_crtc.c | 19 +------------------
> >  include/drm/drm_crtc.h     |  1 -
> >  2 files changed, 1 insertion(+), 19 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> > index 1190638a3d53..c660ea28cf26 100644
> > --- a/drivers/gpu/drm/drm_crtc.c
> > +++ b/drivers/gpu/drm/drm_crtc.c
> > @@ -1109,23 +1109,7 @@ void drm_connector_unregister(struct drm_connector *connector)
> >  }
> >  EXPORT_SYMBOL(drm_connector_unregister);
> >  
> > -/**
> > - * drm_connector_register_all - register all connectors
> > - * @dev: drm device
> > - *
> > - * This function registers all connectors in sysfs and other places so that
> > - * userspace can start to access them. drm_connector_register_all() is called
> > - * automatically from drm_dev_register() to complete the device registration,
> 
> Bikeshed, why throw away the documentation when you could just tweak it
> to reflect reality?

Because Daniel only wanted the public interface in the DRM docs to avoid
confusion. Drivers should only be calling drm_connector_register to
handle dynamic configuration changes.
-Chris
Jani Nikula June 28, 2016, 8:14 a.m. UTC | #3
On Tue, 28 Jun 2016, Chris Wilson <chris@chris-wilson.co.uk> wrote:
>> Bikeshed, why throw away the documentation when you could just tweak it
>> to reflect reality?
>
> Because Daniel only wanted the public interface in the DRM docs to avoid
> confusion. Drivers should only be calling drm_connector_register to
> handle dynamic configuration changes.

Fair enough.

Jani.
Daniel Vetter July 12, 2016, 11:03 a.m. UTC | #4
On Fri, Jun 24, 2016 at 03:36:18PM +0100, Chris Wilson wrote:
> This has now been removed from all drivers as it is performed centrally
> as a part of device registration for modesetting drivers. With the last
> user gone, we can unexport it from the DRM module.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: dri-devel@lists.freedesktop.org

Merged patches 1,3&4 from this series. Need to backmerge drm-next first to
apply the sun4i one, and drm-intel-next for the last one. Please poke me
in a week again.
-Daniel

> ---
>  drivers/gpu/drm/drm_crtc.c | 19 +------------------
>  include/drm/drm_crtc.h     |  1 -
>  2 files changed, 1 insertion(+), 19 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 1190638a3d53..c660ea28cf26 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -1109,23 +1109,7 @@ void drm_connector_unregister(struct drm_connector *connector)
>  }
>  EXPORT_SYMBOL(drm_connector_unregister);
>  
> -/**
> - * drm_connector_register_all - register all connectors
> - * @dev: drm device
> - *
> - * This function registers all connectors in sysfs and other places so that
> - * userspace can start to access them. drm_connector_register_all() is called
> - * automatically from drm_dev_register() to complete the device registration,
> - * if they don't call drm_connector_register() on each connector individually.
> - *
> - * When a device is unplugged and should be removed from userspace access,
> - * call drm_connector_unregister_all(), which is the inverse of this
> - * function.
> - *
> - * Returns:
> - * Zero on success, error code on failure.
> - */
> -int drm_connector_register_all(struct drm_device *dev)
> +static int drm_connector_register_all(struct drm_device *dev)
>  {
>  	struct drm_connector *connector;
>  	int ret;
> @@ -1147,7 +1131,6 @@ err:
>  	drm_connector_unregister_all(dev);
>  	return ret;
>  }
> -EXPORT_SYMBOL(drm_connector_register_all);
>  
>  /**
>   * drm_connector_unregister_all - unregister connector userspace interfaces
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index e6ed7018e290..ddaa7243af55 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -2589,7 +2589,6 @@ static inline unsigned drm_connector_index(struct drm_connector *connector)
>  }
>  
>  /* helpers to {un}register all connectors from sysfs for device */
> -extern int drm_connector_register_all(struct drm_device *dev);
>  extern void drm_connector_unregister_all(struct drm_device *dev);
>  
>  extern __printf(5, 6)
> -- 
> 2.8.1
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 1190638a3d53..c660ea28cf26 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -1109,23 +1109,7 @@  void drm_connector_unregister(struct drm_connector *connector)
 }
 EXPORT_SYMBOL(drm_connector_unregister);
 
-/**
- * drm_connector_register_all - register all connectors
- * @dev: drm device
- *
- * This function registers all connectors in sysfs and other places so that
- * userspace can start to access them. drm_connector_register_all() is called
- * automatically from drm_dev_register() to complete the device registration,
- * if they don't call drm_connector_register() on each connector individually.
- *
- * When a device is unplugged and should be removed from userspace access,
- * call drm_connector_unregister_all(), which is the inverse of this
- * function.
- *
- * Returns:
- * Zero on success, error code on failure.
- */
-int drm_connector_register_all(struct drm_device *dev)
+static int drm_connector_register_all(struct drm_device *dev)
 {
 	struct drm_connector *connector;
 	int ret;
@@ -1147,7 +1131,6 @@  err:
 	drm_connector_unregister_all(dev);
 	return ret;
 }
-EXPORT_SYMBOL(drm_connector_register_all);
 
 /**
  * drm_connector_unregister_all - unregister connector userspace interfaces
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index e6ed7018e290..ddaa7243af55 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -2589,7 +2589,6 @@  static inline unsigned drm_connector_index(struct drm_connector *connector)
 }
 
 /* helpers to {un}register all connectors from sysfs for device */
-extern int drm_connector_register_all(struct drm_device *dev);
 extern void drm_connector_unregister_all(struct drm_device *dev);
 
 extern __printf(5, 6)