acassis commented on code in PR #16778:
URL: https://github.com/apache/nuttx/pull/16778#discussion_r2232885546


##########
drivers/sensors/l86xxx_uorb.c:
##########
@@ -837,7 +742,7 @@ int l86xxx_register(FAR const char *uartpath, int devno)
   if (err < 0)
     {
     sensor_unreg:
-      sensor_unregister(&priv->lower, devno);
+      gnss_unregister(&priv->lower, devno);
     close_file:
       file_close(&priv->uart);
     destroy_sem:

Review Comment:
   You can remove this second "if (err < 0)", just to this way:
   
   ```
     sninfo("Registered L86-XXX driver with kernel polling thread"
             " with baud rate %d and update rate %d",
             L86_XXX_BAUD_RATE,
             CONFIG_L86_XXX_FIX_INT);
   
     return OK;
   
     /* Cleanup items on error */
   
   sensor_unreg:
     gnss_unregister(&priv->lower, devno);
   close_file:
     file_close(&priv->uart);
   destroy_sem:
     nxsem_destroy(&priv->run);
   destroy_mutex:
     nxmutex_destroy(&priv->devlock);
   free_mem:
     kmm_free(priv);
     
   return err;
   ```
   
   
   This way is more standard and easier to read  



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to