*/
static int sep_singleton_open(struct inode *inode_ptr, struct file *file_ptr)
{
- int error = 0;
struct sep_device *sep;
/*
file_ptr->private_data = sep;
- if (test_and_set_bit(0, &sep->singleton_access_flag)) {
- error = -EBUSY;
- goto end_function;
- }
-
-end_function:
- return error;
+ if (test_and_set_bit(0, &sep->singleton_access_flag))
+ return -EBUSY;
+ return 0;
}
/**
sep = sep_dev;
filp->private_data = sep;
- dev_dbg(&sep->pdev->dev, "Open for pid %d\n", current->pid);
-
/* Anyone can open; locking takes place at transaction level */
return 0;
}
filp->private_data = sep;
- dev_dbg(&sep->pdev->dev, "Request daemon open for pid %d\n",
- current->pid);
-
/* There is supposed to be only one request daemon */
if (test_and_set_bit(0, &sep->request_daemon_open))
error = -EBUSY;
/* Am I the process that owns the transaction? */
mutex_lock(&sep->sep_mutex);
if (current->pid != sep->pid_doing_transaction) {
- dev_warn(&sep->pdev->dev, "poll; wrong pid\n");
+ dev_dbg(&sep->pdev->dev, "poll; wrong pid\n");
mask = POLLERR;
mutex_unlock(&sep->sep_mutex);
goto end_function;
}
if (i == SEP_CALLER_ID_TABLE_NUM_ENTRIES) {
- dev_warn(&sep->pdev->dev, "no more caller id entries left\n");
- dev_warn(&sep->pdev->dev, "maximum number is %d\n",
+ dev_dbg(&sep->pdev->dev, "no more caller id entries left\n");
+ dev_dbg(&sep->pdev->dev, "maximum number is %d\n",
SEP_CALLER_ID_TABLE_NUM_ENTRIES);
error = -EUSERS;
goto end_function;
sep->num_of_data_allocations += 1;
end_function:
- dev_dbg(&sep->pdev->dev, "sep_allocate_data_pool_memory_handler end\n");
return error;
}
if (reg_val != 0x2) {
error = SEP_ALREADY_INITIALIZED_ERR;
- dev_warn(&sep->pdev->dev, "init; device already initialized\n");
+ dev_dbg(&sep->pdev->dev, "init; device already initialized\n");
goto end_function;
}
*/
static int sep_free_dcb_handler(struct sep_device *sep)
{
- int error ;
-
- dev_dbg(&sep->pdev->dev, "free dcbs num of DCBs %x\n", sep->nr_dcb_creat);
-
- error = sep_free_dma_tables_and_dcb(sep, false, false);
-
- return error;
+ return sep_free_dma_tables_and_dcb(sep, false, false);
}
/**
int error = 0;
struct sep_device *sep = filp->private_data;
- dev_dbg(&sep->pdev->dev, "ioctl cmd is %x\n", cmd);
-
/* Make sure we own this device */
mutex_lock(&sep->sep_mutex);
if ((current->pid != sep->pid_doing_transaction) &&
(sep->pid_doing_transaction != 0)) {
- dev_warn(&sep->pdev->dev, "ioctl pid is not owner\n");
- mutex_unlock(&sep->sep_mutex);
+ dev_dbg(&sep->pdev->dev, "ioctl pid is not owner\n");
error = -EACCES;
goto end_function;
}
mutex_unlock(&sep->sep_mutex);
- /* Check that the command is for SEP device */
- if (_IOC_TYPE(cmd) != SEP_IOC_MAGIC_NUMBER) {
- error = -ENOTTY;
- goto end_function;
- }
+ if (_IOC_TYPE(cmd) != SEP_IOC_MAGIC_NUMBER)
+ return -ENOTTY;
/* Lock to prevent the daemon to interfere with operation */
mutex_lock(&sep->ioctl_mutex);
error = sep_free_dcb_handler(sep);
break;
default:
- dev_dbg(&sep->pdev->dev, "invalid ioctl %x\n", cmd);
error = -ENOTTY;
break;
}
- mutex_unlock(&sep->ioctl_mutex);
end_function:
- dev_dbg(&sep->pdev->dev, "ioctl end\n");
+ mutex_unlock(&sep->ioctl_mutex);
return error;
}
long error = 0;
struct sep_device *sep = filp->private_data;
- dev_dbg(&sep->pdev->dev, "singleton ioctl cmd is %x\n", cmd);
-
/* Check that the command is for the SEP device */
- if (_IOC_TYPE(cmd) != SEP_IOC_MAGIC_NUMBER) {
- error = -ENOTTY;
- goto end_function;
- }
+ if (_IOC_TYPE(cmd) != SEP_IOC_MAGIC_NUMBER)
+ return -ENOTTY;
/* Make sure we own this device */
mutex_lock(&sep->sep_mutex);
if ((current->pid != sep->pid_doing_transaction) &&
(sep->pid_doing_transaction != 0)) {
- dev_warn(&sep->pdev->dev, "singleton ioctl pid is not owner\n");
+ dev_dbg(&sep->pdev->dev, "singleton ioctl pid is not owner\n");
mutex_unlock(&sep->sep_mutex);
- error = -EACCES;
- goto end_function;
+ return -EACCES;
}
mutex_unlock(&sep->sep_mutex);
error = sep_ioctl(filp, cmd, arg);
break;
}
-
-end_function:
return error;
}
long error;
struct sep_device *sep = filp->private_data;
- dev_dbg(&sep->pdev->dev, "daemon ioctl: cmd is %x\n", cmd);
-
/* Check that the command is for SEP device */
- if (_IOC_TYPE(cmd) != SEP_IOC_MAGIC_NUMBER) {
- error = -ENOTTY;
- goto end_function;
- }
+ if (_IOC_TYPE(cmd) != SEP_IOC_MAGIC_NUMBER)
+ return -ENOTTY;
/* Only one process can access ioctl at any given time */
mutex_lock(&sep->ioctl_mutex);
error = 0;
break;
default:
- dev_warn(&sep->pdev->dev, "daemon ioctl: no such IOCTL\n");
error = -ENOTTY;
}
mutex_unlock(&sep->ioctl_mutex);
-
-end_function:
return error;
-
}
/**
if (error)
goto end_function_dealloc_rar;
- /* The new chip requires ashared area reconfigure */
+ /* The new chip requires a shared area reconfigure */
if (sep->pdev->revision == 4) { /* Only for new chip */
error = sep_reconfig_shared_area(sep);
if (error)