1.修改ioctl返回值为int。

This commit is contained in:
MacRsh
2024-01-19 20:42:34 +08:00
parent dffa5fba52
commit 6894b544bc
13 changed files with 23 additions and 23 deletions

View File

@@ -351,7 +351,7 @@ MR_INLINE ssize_t dev_write(struct mr_dev *dev, int offset, const void *buf, siz
return ret;
}
MR_INLINE ssize_t dev_ioctl(struct mr_dev *dev, int desc, int off, int cmd, void *args)
MR_INLINE int dev_ioctl(struct mr_dev *dev, int desc, int off, int cmd, void *args)
{
/* Check whether the device has an ioctl function */
if (dev->ops->ioctl == MR_NULL)
@@ -447,7 +447,7 @@ MR_INLINE ssize_t dev_ioctl(struct mr_dev *dev, int desc, int off, int cmd, void
#endif /* MR_USING_RDWR_CTL */
/* I/O control to the device */
ssize_t ret = dev->ops->ioctl(dev, off, cmd, args);
int ret = dev->ops->ioctl(dev, off, cmd, args);
#ifdef MR_USING_RDWR_CTL
dev_lock_release(dev, MR_LFLAG_RDWR);
@@ -759,7 +759,7 @@ ssize_t mr_dev_write(int desc, const void *buf, size_t size)
*
* @return The arguments of the device, otherwise an error code.
*/
ssize_t mr_dev_ioctl(int desc, int cmd, void *args)
int mr_dev_ioctl(int desc, int cmd, void *args)
{
MR_DESC_CHECK(desc);

View File

@@ -12,13 +12,13 @@ static int start(void)
{
return 0;
}
MR_INIT_EXPORT(start, "0");
_MR_INIT_EXPORT(start, "0");
static int end(void)
{
return 0;
}
MR_INIT_EXPORT(end, "5.end");
_MR_INIT_EXPORT(end, "5.end");
/**
* @brief This function is auto initialized.
@@ -106,7 +106,7 @@ MR_WEAK int mr_printf_output(const char *buf, size_t size)
#ifndef MR_USING_PRINTF_NONBLOCKING
desc = mr_dev_open(MR_CFG_PRINTF_DEV_NAME, MR_OFLAG_RDWR);
#else
console = mr_dev_open(MR_CFG_PRINTF_DEV_NAME, MR_OFLAG_RDWR | MR_OFLAG_NONBLOCK);
desc = mr_dev_open(MR_CFG_PRINTF_DEV_NAME, MR_OFLAG_RDWR | MR_OFLAG_NONBLOCK);
#endif /* MR_USING_PRINTF_NONBLOCKING */
if (mr_dev_is_valid(desc) == MR_FALSE)
{