mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-15 21:23:23 +00:00
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/fsi.git
This commit is contained in:
commit
002dc8bac5
@ -113,7 +113,7 @@ enum sbe_state
|
|||||||
#define SBEFIFO_TIMEOUT_IN_RSP 1000
|
#define SBEFIFO_TIMEOUT_IN_RSP 1000
|
||||||
|
|
||||||
/* Other constants */
|
/* Other constants */
|
||||||
#define SBEFIFO_MAX_USER_CMD_LEN (0x100000 + PAGE_SIZE)
|
#define SBEFIFO_MAX_USER_CMD_LEN (0x400000 + PAGE_SIZE)
|
||||||
#define SBEFIFO_RESET_MAGIC 0x52534554 /* "RSET" */
|
#define SBEFIFO_RESET_MAGIC 0x52534554 /* "RSET" */
|
||||||
|
|
||||||
struct sbefifo {
|
struct sbefifo {
|
||||||
@ -882,6 +882,13 @@ static ssize_t sbefifo_user_write(struct file *file, const char __user *buf,
|
|||||||
|
|
||||||
mutex_lock(&user->file_lock);
|
mutex_lock(&user->file_lock);
|
||||||
|
|
||||||
|
/* If previous write command is still pending then free it. It is safe
|
||||||
|
* to do that because read cannot be in progress since we hold the
|
||||||
|
* lock.
|
||||||
|
*/
|
||||||
|
if (user->pending_cmd)
|
||||||
|
sbefifo_release_command(user);
|
||||||
|
|
||||||
/* Can we use the pre-allocate buffer ? If not, allocate */
|
/* Can we use the pre-allocate buffer ? If not, allocate */
|
||||||
if (len <= PAGE_SIZE)
|
if (len <= PAGE_SIZE)
|
||||||
user->pending_cmd = user->cmd_page;
|
user->pending_cmd = user->cmd_page;
|
||||||
|
@ -73,9 +73,18 @@ static ssize_t i2cr_scom_write(struct file *filep, const char __user *buf, size_
|
|||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int i2cr_scom_open(struct inode *inode, struct file *file)
|
||||||
|
{
|
||||||
|
struct i2cr_scom *scom = container_of(inode->i_cdev, struct i2cr_scom, cdev);
|
||||||
|
|
||||||
|
file->private_data = scom;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct file_operations i2cr_scom_fops = {
|
static const struct file_operations i2cr_scom_fops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.open = simple_open,
|
.open = i2cr_scom_open,
|
||||||
.llseek = i2cr_scom_llseek,
|
.llseek = i2cr_scom_llseek,
|
||||||
.read = i2cr_scom_read,
|
.read = i2cr_scom_read,
|
||||||
.write = i2cr_scom_write,
|
.write = i2cr_scom_write,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user