You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/04/01 18:50:46 UTC

[incubator-nuttx] branch master updated: Check for return of nxsem_wait_uninterruptible. This commit is for files under arch/sim

This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 30ca00c  Check for return of nxsem_wait_uninterruptible. This commit is for files under arch/sim
30ca00c is described below

commit 30ca00c0a9d72756d7387cbde011cf244ff31d7e
Author: Alan Carvalho de Assis <ac...@gmail.com>
AuthorDate: Wed Apr 1 15:50:39 2020 -0300

    Check for return of nxsem_wait_uninterruptible. This commit is for files under arch/sim
---
 arch/sim/src/sim/up_internal.h    |  4 ++--
 arch/sim/src/sim/up_touchscreen.c | 16 ++++++++++++----
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/arch/sim/src/sim/up_internal.h b/arch/sim/src/sim/up_internal.h
index 65b8d1f..d7bedaa 100644
--- a/arch/sim/src/sim/up_internal.h
+++ b/arch/sim/src/sim/up_internal.h
@@ -291,8 +291,8 @@ int up_x11cmap(unsigned short first, unsigned short len,
 /* up_touchscreen.c *********************************************************/
 
 #ifdef CONFIG_SIM_TOUCHSCREEN
-int  sim_tsc_initialize(int minor);
-void sim_tsc_uninitialize(void);
+int sim_tsc_initialize(int minor);
+int sim_tsc_uninitialize(void);
 #endif
 
 /* up_eventloop.c ***********************************************************/
diff --git a/arch/sim/src/sim/up_touchscreen.c b/arch/sim/src/sim/up_touchscreen.c
index c7a014f..7e98850 100644
--- a/arch/sim/src/sim/up_touchscreen.c
+++ b/arch/sim/src/sim/up_touchscreen.c
@@ -66,6 +66,7 @@
 /****************************************************************************
  * Pre-processor Definitions
  ****************************************************************************/
+
 /* Configuration ************************************************************/
 
 #ifndef CONFIG_SIM_TCNWAITERS
@@ -73,6 +74,7 @@
 #endif
 
 /* Driver support ***********************************************************/
+
 /* This format is used to construct the /dev/input[n] device driver path.  It
  * defined here so that it will be used consistently in all places.
  */
@@ -675,19 +677,23 @@ errout_with_priv:
  *   None
  *
  * Returned Value:
- *   None.
+ *   Return OK if success or negative value of the error.
  *
  ****************************************************************************/
 
-void sim_tsc_uninitialize(void)
+int sim_tsc_uninitialize(void)
 {
   FAR struct up_dev_s *priv = (FAR struct up_dev_s *)&g_simtouchscreen;
   char devname[DEV_NAMELEN];
-  int ret;
+  int ret = OK;
 
   /* Get exclusive access */
 
-  nxsem_wait_uninterruptible(&priv->devsem);
+  ret = nxsem_wait_uninterruptible(&priv->devsem);
+  if (ret < 0)
+    {
+      return ret;
+    }
 
   /* Stop the event loop (Hmm.. the caller must be sure that there are no
    * open references to the touchscreen driver.  This might better be
@@ -711,6 +717,8 @@ void sim_tsc_uninitialize(void)
 
   nxsem_destroy(&priv->waitsem);
   nxsem_destroy(&priv->devsem);
+
+  return ret;
 }
 
 /****************************************************************************