diff options
author | Behan Webster <behanw@converseincode.com> | 2014-09-26 21:10:52 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2014-09-30 06:11:44 -0400 |
commit | 032e57f01b7524ad9aec39788b38f523583ab58e (patch) | |
tree | 87b80683219fd04b0a69e33eed6bc749ff5303f2 | |
parent | 8251434bb489f4bf7fbc1825fb212051d0a030ea (diff) |
arm, fbdev, omap2, LLVMLinux: Remove nested function from omap2 dss
Replace the use of nested functions where a normal function will suffice.
Nested functions are not liked by upstream kernel developers in general. Their
use breaks the use of clang as a compiler, and doesn't make the code any
better.
This code now works for both gcc and clang.
Signed-off-by: Behan Webster <behanw@converseincode.com>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r-- | drivers/video/fbdev/omap2/dss/dispc-compat.c | 9 | ||||
-rw-r--r-- | drivers/video/fbdev/omap2/dss/manager-sysfs.c | 16 |
2 files changed, 14 insertions, 11 deletions
diff --git a/drivers/video/fbdev/omap2/dss/dispc-compat.c b/drivers/video/fbdev/omap2/dss/dispc-compat.c index 83779c2b292a..633c461fbc6e 100644 --- a/drivers/video/fbdev/omap2/dss/dispc-compat.c +++ b/drivers/video/fbdev/omap2/dss/dispc-compat.c | |||
@@ -634,13 +634,14 @@ void dispc_mgr_disable_sync(enum omap_channel channel) | |||
634 | WARN_ON(1); | 634 | WARN_ON(1); |
635 | } | 635 | } |
636 | 636 | ||
637 | static inline void dispc_irq_wait_handler(void *data, u32 mask) | ||
638 | { | ||
639 | complete((struct completion *)data); | ||
640 | } | ||
641 | |||
637 | int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask, | 642 | int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask, |
638 | unsigned long timeout) | 643 | unsigned long timeout) |
639 | { | 644 | { |
640 | void dispc_irq_wait_handler(void *data, u32 mask) | ||
641 | { | ||
642 | complete((struct completion *)data); | ||
643 | } | ||
644 | 645 | ||
645 | int r; | 646 | int r; |
646 | DECLARE_COMPLETION_ONSTACK(completion); | 647 | DECLARE_COMPLETION_ONSTACK(completion); |
diff --git a/drivers/video/fbdev/omap2/dss/manager-sysfs.c b/drivers/video/fbdev/omap2/dss/manager-sysfs.c index 37b59fe28dc8..a7414fb12830 100644 --- a/drivers/video/fbdev/omap2/dss/manager-sysfs.c +++ b/drivers/video/fbdev/omap2/dss/manager-sysfs.c | |||
@@ -44,6 +44,13 @@ static ssize_t manager_display_show(struct omap_overlay_manager *mgr, char *buf) | |||
44 | dssdev->name : "<none>"); | 44 | dssdev->name : "<none>"); |
45 | } | 45 | } |
46 | 46 | ||
47 | static int manager_display_match(struct omap_dss_device *dssdev, void *data) | ||
48 | { | ||
49 | const char *str = data; | ||
50 | |||
51 | return sysfs_streq(dssdev->name, str); | ||
52 | } | ||
53 | |||
47 | static ssize_t manager_display_store(struct omap_overlay_manager *mgr, | 54 | static ssize_t manager_display_store(struct omap_overlay_manager *mgr, |
48 | const char *buf, size_t size) | 55 | const char *buf, size_t size) |
49 | { | 56 | { |
@@ -52,17 +59,12 @@ static ssize_t manager_display_store(struct omap_overlay_manager *mgr, | |||
52 | struct omap_dss_device *dssdev = NULL; | 59 | struct omap_dss_device *dssdev = NULL; |
53 | struct omap_dss_device *old_dssdev; | 60 | struct omap_dss_device *old_dssdev; |
54 | 61 | ||
55 | int match(struct omap_dss_device *dssdev, void *data) | ||
56 | { | ||
57 | const char *str = data; | ||
58 | return sysfs_streq(dssdev->name, str); | ||
59 | } | ||
60 | |||
61 | if (buf[size-1] == '\n') | 62 | if (buf[size-1] == '\n') |
62 | --len; | 63 | --len; |
63 | 64 | ||
64 | if (len > 0) | 65 | if (len > 0) |
65 | dssdev = omap_dss_find_device((void *)buf, match); | 66 | dssdev = omap_dss_find_device((void *)buf, |
67 | manager_display_match); | ||
66 | 68 | ||
67 | if (len > 0 && dssdev == NULL) | 69 | if (len > 0 && dssdev == NULL) |
68 | return -EINVAL; | 70 | return -EINVAL; |