diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2018-03-02 02:43:45 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2018-09-03 16:13:26 +0300 |
commit | c1dfe721e0966947019c43b65f2837c591fdcb3c (patch) | |
tree | 8ce6d3643384f63f717b66bf36eb2bce92d32929 /drivers/gpu/drm/omapdrm/dss | |
parent | 67822ae11971c664f5d28d7914b4b00cff07a9fd (diff) | |
download | linux-c1dfe721e0966947019c43b65f2837c591fdcb3c.tar.bz2 |
drm/omap: dss: Move and rename omap_dss_(get|put)_device()
The functions operate on any omap_dss_device, move them from display.c
to base.c. While at it rename them to match the naming of the other
functions operating on struct omap_dss_device.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/dss')
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/base.c | 27 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/display.c | 24 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/omapdss.h | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/output.c | 2 |
4 files changed, 27 insertions, 31 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c index 9f01a4f28145..08846eea5a53 100644 --- a/drivers/gpu/drm/omapdrm/dss/base.c +++ b/drivers/gpu/drm/omapdrm/dss/base.c @@ -91,6 +91,27 @@ static bool omapdss_device_is_registered(struct device_node *node) return found; } +struct omap_dss_device *omapdss_device_get(struct omap_dss_device *dssdev) +{ + if (!try_module_get(dssdev->owner)) + return NULL; + + if (get_device(dssdev->dev) == NULL) { + module_put(dssdev->owner); + return NULL; + } + + return dssdev; +} +EXPORT_SYMBOL(omapdss_device_get); + +void omapdss_device_put(struct omap_dss_device *dssdev) +{ + put_device(dssdev->dev); + module_put(dssdev->owner); +} +EXPORT_SYMBOL(omapdss_device_put); + struct omap_dss_device *omapdss_find_device_by_port(struct device_node *src, unsigned int port) { @@ -98,7 +119,7 @@ struct omap_dss_device *omapdss_find_device_by_port(struct device_node *src, list_for_each_entry(dssdev, &omapdss_devices_list, list) { if (dssdev->dev->of_node == src && dssdev->port_num == port) - return omap_dss_get_device(dssdev); + return omapdss_device_get(dssdev); } return NULL; @@ -147,9 +168,9 @@ struct omap_dss_device *omapdss_device_get_next(struct omap_dss_device *from, done: if (from) - omap_dss_put_device(from); + omapdss_device_put(from); if (dssdev) - omap_dss_get_device(dssdev); + omapdss_device_get(dssdev); mutex_unlock(&omapdss_devices_lock); return dssdev; diff --git a/drivers/gpu/drm/omapdrm/dss/display.c b/drivers/gpu/drm/omapdrm/dss/display.c index 178d88841e0c..53cb46f6503d 100644 --- a/drivers/gpu/drm/omapdrm/dss/display.c +++ b/drivers/gpu/drm/omapdrm/dss/display.c @@ -21,9 +21,6 @@ #define DSS_SUBSYS_NAME "DISPLAY" #include <linux/kernel.h> -#include <linux/module.h> -#include <linux/jiffies.h> -#include <linux/platform_device.h> #include <linux/of.h> #include "omapdss.h" @@ -52,24 +49,3 @@ void omapdss_display_init(struct omap_dss_device *dssdev) "display%u", id); } EXPORT_SYMBOL_GPL(omapdss_display_init); - -struct omap_dss_device *omap_dss_get_device(struct omap_dss_device *dssdev) -{ - if (!try_module_get(dssdev->owner)) - return NULL; - - if (get_device(dssdev->dev) == NULL) { - module_put(dssdev->owner); - return NULL; - } - - return dssdev; -} -EXPORT_SYMBOL(omap_dss_get_device); - -void omap_dss_put_device(struct omap_dss_device *dssdev) -{ - put_device(dssdev->dev); - module_put(dssdev->owner); -} -EXPORT_SYMBOL(omap_dss_put_device); diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 5f71f6885991..96011e42da05 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -492,6 +492,8 @@ void omapdss_display_init(struct omap_dss_device *dssdev); void omapdss_device_register(struct omap_dss_device *dssdev); void omapdss_device_unregister(struct omap_dss_device *dssdev); +struct omap_dss_device *omapdss_device_get(struct omap_dss_device *dssdev); +void omapdss_device_put(struct omap_dss_device *dssdev); struct omap_dss_device *omapdss_find_device_by_port(struct device_node *src, unsigned int port); struct omap_dss_device *omapdss_device_get_next(struct omap_dss_device *from, @@ -501,9 +503,6 @@ int omapdss_device_connect(struct omap_dss_device *src, void omapdss_device_disconnect(struct omap_dss_device *src, struct omap_dss_device *dst); -struct omap_dss_device *omap_dss_get_device(struct omap_dss_device *dssdev); -void omap_dss_put_device(struct omap_dss_device *dssdev); - int omap_dss_get_num_overlay_managers(void); int omap_dss_get_num_overlays(void); diff --git a/drivers/gpu/drm/omapdrm/dss/output.c b/drivers/gpu/drm/omapdrm/dss/output.c index e62da96f83af..b5bf7a5e35d9 100644 --- a/drivers/gpu/drm/omapdrm/dss/output.c +++ b/drivers/gpu/drm/omapdrm/dss/output.c @@ -93,7 +93,7 @@ struct omap_dss_device *omapdss_find_output_from_display(struct omap_dss_device dssdev = dssdev->src; if (dssdev->id != 0) - return omap_dss_get_device(dssdev); + return omapdss_device_get(dssdev); return NULL; } |