pkarashchenko commented on code in PR #6344:
URL: https://github.com/apache/incubator-nuttx/pull/6344#discussion_r884968410
##########
drivers/video/isx012.c:
##########
@@ -2870,24 +2947,26 @@ static int isx012_set_shd(FAR isx012_dev_t *priv)
* Public Functions
****************************************************************************/
-int isx012_initialize(FAR struct i2c_master_s *i2c)
+int isx012_initialize(void)
{
+ int ret;
FAR struct isx012_dev_s *priv = &g_isx012_private;
- /* Save i2c information */
-
- priv->i2c = i2c;
- priv->i2c_addr = ISX012_I2C_SLV_ADDR;
- priv->i2c_freq = I2CFREQ_STANDARD;
-
/* Regiser image sensor operations variable */
- imgsensor_register(&g_isx012_ops);
+ ret = imgsensor_register(&g_isx012_ops);
+ if (ret != OK)
+ {
+ verr("Failed to register ops to video driver.\n");
+ return ret;
+ }
/* Initialize other information */
priv->state = STATE_ISX012_POWEROFF;
+ nxsem_init(&priv->i2c_lock, 0, 1);
Review Comment:
We can try to start using `nxmutex` in some further PRs.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]