summaryrefslogtreecommitdiff
path: root/drivers/staging/sep
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/sep')
-rw-r--r--drivers/staging/sep/sep_crypto.c123
-rw-r--r--drivers/staging/sep/sep_driver_api.h8
-rw-r--r--drivers/staging/sep/sep_driver_config.h4
-rw-r--r--drivers/staging/sep/sep_main.c101
4 files changed, 56 insertions, 180 deletions
diff --git a/drivers/staging/sep/sep_crypto.c b/drivers/staging/sep/sep_crypto.c
index 1cc790e..34710ce 100644
--- a/drivers/staging/sep/sep_crypto.c
+++ b/drivers/staging/sep/sep_crypto.c
@@ -44,7 +44,6 @@
#include <linux/poll.h>
#include <linux/wait.h>
#include <linux/pci.h>
-#include <linux/pci.h>
#include <linux/pm_runtime.h>
#include <linux/err.h>
#include <linux/device.h>
@@ -85,28 +84,6 @@ static void sep_dequeuer(void *data);
/* TESTING */
/**
- * crypto_sep_dump_message - dump the message that is pending
- * @sep: SEP device
- * This will only print dump if DEBUG is set; it does
- * follow kernel debug print enabling
- */
-static void crypto_sep_dump_message(struct sep_device *sep, void *msg)
-{
-#if 0
- u32 *p;
- u32 *i;
- int count;
-
- p = sep->shared_addr;
- i = (u32 *)msg;
- for (count = 0; count < 10 * 4; count += 4)
- dev_dbg(&sep->pdev->dev,
- "[PID%d] Word %d of the message is %x (local)%x\n",
- current->pid, count/4, *p++, *i++);
-#endif
-}
-
-/**
* sep_do_callback
* @work: pointer to work_struct
* This is what is called by the queue; it is generic so that it
@@ -487,55 +464,6 @@ static int partial_overlap(void *src_ptr, void *dst_ptr, u32 nbytes)
return 0;
}
-/* Debug - prints only if DEBUG is defined; follows kernel debug model */
-static void sep_dump(struct sep_device *sep, char *stg, void *start, int len)
-{
-#if 0
- int ct1;
- u8 *ptt;
-
- dev_dbg(&sep->pdev->dev,
- "Dump of %s starting at %08lx for %08x bytes\n",
- stg, (unsigned long)start, len);
- for (ct1 = 0; ct1 < len; ct1 += 1) {
- ptt = (u8 *)(start + ct1);
- dev_dbg(&sep->pdev->dev, "%02x ", *ptt);
- if (ct1 % 16 == 15)
- dev_dbg(&sep->pdev->dev, "\n");
- }
- dev_dbg(&sep->pdev->dev, "\n");
-#endif
-}
-
-/* Debug - prints only if DEBUG is defined; follows kernel debug model */
-static void sep_dump_sg(struct sep_device *sep, char *stg,
- struct scatterlist *sg)
-{
-#if 0
- int ct1, ct2;
- u8 *ptt;
-
- dev_dbg(&sep->pdev->dev, "Dump of scatterlist %s\n", stg);
-
- ct1 = 0;
- while (sg) {
- dev_dbg(&sep->pdev->dev, "page %x\n size %x", ct1,
- sg->length);
- dev_dbg(&sep->pdev->dev, "phys addr is %lx",
- (unsigned long)sg_phys(sg));
- ptt = sg_virt(sg);
- for (ct2 = 0; ct2 < sg->length; ct2 += 1) {
- dev_dbg(&sep->pdev->dev, "byte %x is %02x\n",
- ct2, (unsigned char)*(ptt + ct2));
- }
-
- ct1 += 1;
- sg = sg_next(sg);
- }
- dev_dbg(&sep->pdev->dev, "\n");
-#endif
-}
-
/* Debug - prints only if DEBUG is defined */
static void sep_dump_ivs(struct ablkcipher_request *req, char *reason)
@@ -807,7 +735,7 @@ end_function:
* @size: size of parameter to copy (in bytes)
* @max_size: size to move up offset; SEP mesg is in word sizes
* @msg_offset: pointer to current offset (is updated)
- * @byte_array: flag ti indicate wheter endian must be changed
+ * @byte_array: flag ti indicate whether endian must be changed
* Copies data into the message area from caller
*/
static void sep_write_msg(struct this_task_ctx *ta_ctx, void *in_addr,
@@ -855,7 +783,7 @@ static void sep_make_header(struct this_task_ctx *ta_ctx, u32 *msg_offset,
* @size: size of parameter to copy (in bytes)
* @max_size: size to move up offset; SEP mesg is in word sizes
* @msg_offset: pointer to current offset (is updated)
- * @byte_array: flag ti indicate wheter endian must be changed
+ * @byte_array: flag ti indicate whether endian must be changed
* Copies data out of the message area to caller
*/
static void sep_read_msg(struct this_task_ctx *ta_ctx, void *in_addr,
@@ -990,7 +918,7 @@ static void sep_clear_out(struct this_task_ctx *ta_ctx)
/**
* The following unlocks the sep and makes it available
* to any other application
- * First, null out crypto entries in sep before relesing it
+ * First, null out crypto entries in sep before releasing it
*/
ta_ctx->sep_used->current_hash_req = NULL;
ta_ctx->sep_used->current_cypher_req = NULL;
@@ -1001,7 +929,7 @@ static void sep_clear_out(struct this_task_ctx *ta_ctx)
ta_ctx->call_status.status = 0;
- /* Remove anything confidentail */
+ /* Remove anything confidential */
memset(ta_ctx->sep_used->shared_addr, 0,
SEP_DRIVER_MESSAGE_SHARED_AREA_SIZE_IN_BYTES);
@@ -1095,8 +1023,8 @@ static int sep_crypto_take_sep(struct this_task_ctx *ta_ctx)
current->comm, sizeof(current->comm));
if (!ta_ctx->queue_elem) {
- dev_dbg(&sep->pdev->dev, "[PID%d] updating queue"
- " status error\n", current->pid);
+ dev_dbg(&sep->pdev->dev,
+ "[PID%d] updating queue status error\n", current->pid);
return -EINVAL;
}
@@ -1207,7 +1135,7 @@ static int sep_crypto_block_data(struct ablkcipher_request *req)
req->nbytes, ta_ctx->walk.blocksize, &new_sg, 1);
if (int_error < 0) {
- dev_warn(&ta_ctx->sep_used->pdev->dev, "oddball page eerror\n");
+ dev_warn(&ta_ctx->sep_used->pdev->dev, "oddball page error\n");
return -ENOMEM;
} else if (int_error == 1) {
ta_ctx->src_sg = new_sg;
@@ -1238,9 +1166,6 @@ static int sep_crypto_block_data(struct ablkcipher_request *req)
/* Key already done; this is for data */
dev_dbg(&ta_ctx->sep_used->pdev->dev, "sending data\n");
- sep_dump_sg(ta_ctx->sep_used,
- "block sg in", ta_ctx->src_sg);
-
/* check for valid data and proper spacing */
src_ptr = sg_virt(ta_ctx->src_sg);
dst_ptr = sg_virt(ta_ctx->dst_sg);
@@ -1362,14 +1287,10 @@ static int sep_crypto_block_data(struct ablkcipher_request *req)
sep_write_context(ta_ctx, &msg_offset,
&sctx->des_private_ctx,
sizeof(struct sep_des_private_context));
- sep_dump(ta_ctx->sep_used, "ctx to block des",
- &sctx->des_private_ctx, 40);
} else {
sep_write_context(ta_ctx, &msg_offset,
&sctx->aes_private_ctx,
sizeof(struct sep_aes_private_context));
- sep_dump(ta_ctx->sep_used, "ctx to block aes",
- &sctx->aes_private_ctx, 20);
}
/* conclude message */
@@ -1426,8 +1347,6 @@ static int sep_crypto_send_key(struct ablkcipher_request *req)
}
memcpy(ta_ctx->iv, ta_ctx->walk.iv, SEP_DES_IV_SIZE_BYTES);
- sep_dump(ta_ctx->sep_used, "iv",
- ta_ctx->iv, SEP_DES_IV_SIZE_BYTES);
}
if ((ta_ctx->current_request == AES_CBC) &&
@@ -1438,8 +1357,6 @@ static int sep_crypto_send_key(struct ablkcipher_request *req)
}
memcpy(ta_ctx->iv, ta_ctx->walk.iv, SEP_AES_IV_SIZE_BYTES);
- sep_dump(ta_ctx->sep_used, "iv",
- ta_ctx->iv, SEP_AES_IV_SIZE_BYTES);
}
/* put together message to SEP */
@@ -1452,8 +1369,6 @@ static int sep_crypto_send_key(struct ablkcipher_request *req)
sep_write_msg(ta_ctx, ta_ctx->iv,
SEP_DES_IV_SIZE_BYTES, sizeof(u32) * 4,
&msg_offset, 1);
- sep_dump(ta_ctx->sep_used, "initial IV",
- ta_ctx->walk.iv, SEP_DES_IV_SIZE_BYTES);
} else {
/* Skip if ECB */
msg_offset += 4 * sizeof(u32);
@@ -1465,8 +1380,6 @@ static int sep_crypto_send_key(struct ablkcipher_request *req)
sep_write_msg(ta_ctx, ta_ctx->iv,
SEP_AES_IV_SIZE_BYTES, max_length,
&msg_offset, 1);
- sep_dump(ta_ctx->sep_used, "initial IV",
- ta_ctx->walk.iv, SEP_AES_IV_SIZE_BYTES);
} else {
/* Skip if ECB */
msg_offset += max_length;
@@ -1646,7 +1559,6 @@ static u32 crypto_post_op(struct sep_device *sep)
dev_dbg(&ta_ctx->sep_used->pdev->dev, "crypto post_op\n");
dev_dbg(&ta_ctx->sep_used->pdev->dev, "crypto post_op message dump\n");
- crypto_sep_dump_message(ta_ctx->sep_used, ta_ctx->msg);
/* first bring msg from shared area to local area */
memcpy(ta_ctx->msg, sep->shared_addr,
@@ -1670,16 +1582,10 @@ static u32 crypto_post_op(struct sep_device *sep)
sep_read_context(ta_ctx, &msg_offset,
&sctx->des_private_ctx,
sizeof(struct sep_des_private_context));
-
- sep_dump(ta_ctx->sep_used, "ctx init des",
- &sctx->des_private_ctx, 40);
} else {
sep_read_context(ta_ctx, &msg_offset,
&sctx->aes_private_ctx,
sizeof(struct sep_aes_private_context));
-
- sep_dump(ta_ctx->sep_used, "ctx init aes",
- &sctx->aes_private_ctx, 20);
}
sep_dump_ivs(req, "after sending key to sep\n");
@@ -1758,9 +1664,6 @@ static u32 crypto_post_op(struct sep_device *sep)
sizeof(struct sep_aes_private_context));
}
- sep_dump_sg(ta_ctx->sep_used,
- "block sg out", ta_ctx->dst_sg);
-
/* Copy to correct sg if this block had oddball pages */
if (ta_ctx->dst_sg_hold)
sep_copy_sg(ta_ctx->sep_used,
@@ -1870,7 +1773,7 @@ static u32 hash_update_post_op(struct sep_device *sep)
sizeof(struct sep_hash_private_context));
/**
- * Following is only for finup; if we just completd the
+ * Following is only for finup; if we just completed the
* data portion of finup, we now need to kick off the
* finish portion of finup.
*/
@@ -2011,7 +1914,7 @@ static u32 hash_digest_post_op(struct sep_device *sep)
}
/**
- * The sep_finish function is the function that is schedule (via tasket)
+ * The sep_finish function is the function that is scheduled (via tasklet)
* by the interrupt service routine when the SEP sends and interrupt
* This is only called by the interrupt handler as a tasklet.
*/
@@ -2249,7 +2152,7 @@ static void sep_hash_update(void *data)
head_len = (block_size - int_ctx->prev_update_bytes) % block_size;
tail_len = (req->nbytes - head_len) % block_size;
- /* Make sure all pages are even block */
+ /* Make sure all pages are an even block */
int_error = sep_oddball_pages(ta_ctx->sep_used, req->src,
req->nbytes,
block_size, &new_sg, 1);
@@ -2274,8 +2177,6 @@ static void sep_hash_update(void *data)
src_ptr = NULL;
}
- sep_dump_sg(ta_ctx->sep_used, "hash block sg in", ta_ctx->src_sg);
-
ta_ctx->dcb_input_data.app_in_address = src_ptr;
ta_ctx->dcb_input_data.data_in_size =
req->nbytes - (head_len + tail_len);
@@ -2482,7 +2383,7 @@ static void sep_hash_digest(void *data)
dev_dbg(&ta_ctx->sep_used->pdev->dev, "block_size is %x\n", block_size);
dev_dbg(&ta_ctx->sep_used->pdev->dev, "tail len is %x\n", tail_len);
- /* Make sure all pages are even block */
+ /* Make sure all pages are an even block */
int_error = sep_oddball_pages(ta_ctx->sep_used, req->src,
req->nbytes,
block_size, &new_sg, 1);
@@ -2507,8 +2408,6 @@ static void sep_hash_digest(void *data)
src_ptr = NULL;
}
- sep_dump_sg(ta_ctx->sep_used, "hash block sg in", ta_ctx->src_sg);
-
ta_ctx->dcb_input_data.app_in_address = src_ptr;
ta_ctx->dcb_input_data.data_in_size = req->nbytes - tail_len;
ta_ctx->dcb_input_data.app_out_address = NULL;
diff --git a/drivers/staging/sep/sep_driver_api.h b/drivers/staging/sep/sep_driver_api.h
index 8b797d5..7ee1c3b 100644
--- a/drivers/staging/sep/sep_driver_api.h
+++ b/drivers/staging/sep/sep_driver_api.h
@@ -91,7 +91,7 @@ struct sep_dcblock {
};
/*
- command structure for building dcb block (currently for ext app only
+ command structure for building dcb block (currently for ext app only)
*/
struct build_dcb_struct {
/* address value of the data in */
@@ -234,7 +234,7 @@ struct sep_dma_context {
u32 dmatables_len;
/* size of input data */
u32 input_data_len;
- /* secure dma use (for imr memory restriced area in output */
+ /* secure dma use (for imr memory restricted area in output) */
bool secure_dma;
struct sep_dma_resource dma_res_arr[SEP_MAX_NUM_SYNC_DMA_OPS];
/* Scatter gather for kernel crypto */
@@ -347,10 +347,10 @@ int sep_prepare_input_output_dma_table_in_dcb(struct sep_device *sep,
/**
* sep_free_dma_table_data_handler - free DMA table
- * @sep: pointere to struct sep_device
+ * @sep: pointer to struct sep_device
* @dma_ctx: dma context
*
- * Handles the request to free DMA table for synchronic actions
+ * Handles the request to free DMA table for synchronic actions
*/
int sep_free_dma_table_data_handler(struct sep_device *sep,
struct sep_dma_context **dma_ctx);
diff --git a/drivers/staging/sep/sep_driver_config.h b/drivers/staging/sep/sep_driver_config.h
index 9d9fc7c..7d7c7ab 100644
--- a/drivers/staging/sep/sep_driver_config.h
+++ b/drivers/staging/sep/sep_driver_config.h
@@ -43,7 +43,7 @@
#define SEP_DRIVER_POLLING_MODE 0
/* flag which defines if the shared area address should be
- reconfiged (send to SEP anew) during init of the driver */
+ reconfigured (send to SEP anew) during init of the driver */
#define SEP_DRIVER_RECONFIG_MESSAGE_AREA 0
/* the mode for running on the ARM1172 Evaluation platform (flag is 1) */
@@ -166,7 +166,7 @@ held by the process (struct file) */
(SEP_DRIVER_STATIC_AREA_OFFSET_IN_BYTES + \
SEP_DRIVER_STATIC_AREA_SIZE_IN_BYTES)
-/* synhronic dma tables area offset */
+/* synchronic dma tables area offset */
#define SYNCHRONIC_DMA_TABLES_AREA_OFFSET_BYTES \
(SEP_DRIVER_DATA_POOL_AREA_OFFSET_IN_BYTES + \
SEP_DRIVER_DATA_POOL_SHARED_AREA_SIZE_IN_BYTES)
diff --git a/drivers/staging/sep/sep_main.c b/drivers/staging/sep/sep_main.c
index df1d13e..ca8946a 100644
--- a/drivers/staging/sep/sep_main.c
+++ b/drivers/staging/sep/sep_main.c
@@ -61,7 +61,6 @@
#include <linux/interrupt.h>
#include <linux/pagemap.h>
#include <asm/cacheflush.h>
-#include <linux/sched.h>
#include <linux/delay.h>
#include <linux/jiffies.h>
#include <linux/async.h>
@@ -94,7 +93,7 @@
#endif
/**
- * Currenlty, there is only one SEP device per platform;
+ * Currently, there is only one SEP device per platform;
* In event platforms in the future have more than one SEP
* device, this will be a linked list
*/
@@ -106,7 +105,7 @@ struct sep_device *sep_dev;
* @sep: SEP device
* @sep_queue_info: pointer to status queue
*
- * This function will removes information about transaction from the queue.
+ * This function will remove information about transaction from the queue.
*/
void sep_queue_status_remove(struct sep_device *sep,
struct sep_queue_info **queue_elem)
@@ -294,7 +293,7 @@ int sep_wait_transaction(struct sep_device *sep)
end_function_setpid:
/*
* The pid_doing_transaction indicates that this process
- * now owns the facilities to performa a transaction with
+ * now owns the facilities to perform a transaction with
* the SEP. While this process is performing a transaction,
* no other process who has the SEP device open can perform
* any transactions. This method allows more than one process
@@ -447,10 +446,10 @@ static int sep_open(struct inode *inode, struct file *filp)
/**
* sep_free_dma_table_data_handler - free DMA table
- * @sep: pointere to struct sep_device
+ * @sep: pointer to struct sep_device
* @dma_ctx: dma context
*
- * Handles the request to free DMA table for synchronic actions
+ * Handles the request to free DMA table for synchronic actions
*/
int sep_free_dma_table_data_handler(struct sep_device *sep,
struct sep_dma_context **dma_ctx)
@@ -540,7 +539,7 @@ int sep_free_dma_table_data_handler(struct sep_device *sep,
* don't have a page array; the page array is generated
* only in the lock_user_pages, which is not called
* for kernel crypto, which is what the sg (scatter gather
- * is used for exclusively
+ * is used for exclusively)
*/
if (dma->src_sg) {
dma_unmap_sg(&sep->pdev->dev, dma->src_sg,
@@ -1227,7 +1226,7 @@ static int sep_lock_user_pages(struct sep_device *sep,
/* Map array */
struct sep_dma_map *map_array;
- /* Set start and end pages and num pages */
+ /* Set start and end pages and num pages */
end_page = (app_virt_addr + data_size - 1) >> PAGE_SHIFT;
start_page = app_virt_addr >> PAGE_SHIFT;
num_pages = end_page - start_page + 1;
@@ -1431,13 +1430,14 @@ static int sep_lli_table_secure_dma(struct sep_device *sep,
/* Array of lli */
struct sep_lli_entry *lli_array;
- /* Set start and end pages and num pages */
+ /* Set start and end pages and num pages */
end_page = (app_virt_addr + data_size - 1) >> PAGE_SHIFT;
start_page = app_virt_addr >> PAGE_SHIFT;
num_pages = end_page - start_page + 1;
- dev_dbg(&sep->pdev->dev, "[PID%d] lock user pages"
- " app_virt_addr is %x\n", current->pid, app_virt_addr);
+ dev_dbg(&sep->pdev->dev,
+ "[PID%d] lock user pages app_virt_addr is %x\n",
+ current->pid, app_virt_addr);
dev_dbg(&sep->pdev->dev, "[PID%d] data_size is (hex) %x\n",
current->pid, data_size);
@@ -1601,7 +1601,7 @@ end_function:
* @num_table_entries_ptr: pointer to number of tables
* @table_data_size: total data size
*
- * Builds ant lli table from the lli_array according to
+ * Builds an lli table from the lli_array according to
* the given size of data
*/
static void sep_build_lli_table(struct sep_device *sep,
@@ -1700,7 +1700,7 @@ static void sep_build_lli_table(struct sep_device *sep,
* @virt_address: virtual address to convert
*
* This functions returns the physical address inside shared area according
- * to the virtual address. It can be either on the externa RAM device
+ * to the virtual address. It can be either on the external RAM device
* (ioremapped), or on the system RAM
* This implementation is for the external RAM
*/
@@ -1724,7 +1724,7 @@ static dma_addr_t sep_shared_area_virt_to_bus(struct sep_device *sep,
*
* This functions returns the virtual address inside shared area
* according to the physical address. It can be either on the
- * externa RAM device (ioremapped), or on the system RAM
+ * external RAM device (ioremapped), or on the system RAM
* This implementation is for the external RAM
*/
static void *sep_shared_area_bus_to_virt(struct sep_device *sep,
@@ -1890,9 +1890,9 @@ static void sep_prepare_empty_lli_table(struct sep_device *sep,
* @lli_table_ptr:
* @num_entries_ptr:
* @table_data_size_ptr:
- * @is_kva: set for kernel data (kernel cryptio call)
+ * @is_kva: set for kernel data (kernel crypt io call)
*
- * This function prepares only input DMA table for synhronic symmetric
+ * This function prepares only input DMA table for synchronic symmetric
* operations (HASH)
* Note that all bus addresses that are passed to the SEP
* are in 32 bit format; the SEP is a 32 bit device
@@ -1931,9 +1931,9 @@ static int sep_prepare_input_dma_table(struct sep_device *sep,
void *dma_lli_table_alloc_addr = NULL;
void *dma_in_lli_table_ptr = NULL;
- dev_dbg(&sep->pdev->dev, "[PID%d] prepare intput dma "
- "tbl data size: (hex) %x\n",
- current->pid, data_size);
+ dev_dbg(&sep->pdev->dev,
+ "[PID%d] prepare intput dma tbl data size: (hex) %x\n",
+ current->pid, data_size);
dev_dbg(&sep->pdev->dev, "[PID%d] block_size is (hex) %x\n",
current->pid, block_size);
@@ -2173,9 +2173,9 @@ static int sep_construct_dma_tables_from_lli(
u32 last_table_flag = 0;
/* The data size that should be in table */
u32 table_data_size = 0;
- /* Number of etnries in the input table */
+ /* Number of entries in the input table */
u32 num_entries_in_table = 0;
- /* Number of etnries in the output table */
+ /* Number of entries in the output table */
u32 num_entries_out_table = 0;
if (!dma_ctx) {
@@ -2400,7 +2400,7 @@ static int sep_construct_dma_tables_from_lli(
* @table_data_size_ptr:
* @is_kva: set for kernel data; used only for kernel crypto module
*
- * This function builds input and output DMA tables for synhronic
+ * This function builds input and output DMA tables for synchronic
* symmetric operations (AES, DES, HASH). It also checks that each table
* is of the modular block size
* Note that all bus addresses that are passed to the SEP
@@ -2542,19 +2542,20 @@ static int sep_prepare_input_output_dma_table(struct sep_device *sep,
}
}
- dev_dbg(&sep->pdev->dev, "[PID%d] After lock; prep input output dma "
- "table sep_in_num_pages is (hex) %x\n", current->pid,
+ dev_dbg(&sep->pdev->dev,
+ "[PID%d] After lock; prep input output dma table sep_in_num_pages is (hex) %x\n",
+ current->pid,
dma_ctx->dma_res_arr[dma_ctx->nr_dcb_creat].in_num_pages);
dev_dbg(&sep->pdev->dev, "[PID%d] sep_out_num_pages is (hex) %x\n",
current->pid,
dma_ctx->dma_res_arr[dma_ctx->nr_dcb_creat].out_num_pages);
- dev_dbg(&sep->pdev->dev, "[PID%d] SEP_DRIVER_ENTRIES_PER_TABLE_IN_SEP"
- " is (hex) %x\n", current->pid,
- SEP_DRIVER_ENTRIES_PER_TABLE_IN_SEP);
+ dev_dbg(&sep->pdev->dev,
+ "[PID%d] SEP_DRIVER_ENTRIES_PER_TABLE_IN_SEP is (hex) %x\n",
+ current->pid, SEP_DRIVER_ENTRIES_PER_TABLE_IN_SEP);
- /* Call the fucntion that creates table from the lli arrays */
+ /* Call the function that creates table from the lli arrays */
dev_dbg(&sep->pdev->dev, "[PID%d] calling create table from lli\n",
current->pid);
error = sep_construct_dma_tables_from_lli(
@@ -3661,7 +3662,7 @@ static ssize_t sep_read(struct file *filp,
goto end_function;
}
- /* Checks that user has called necessarry apis */
+ /* Checks that user has called necessary apis */
if (0 == test_bit(SEP_FASTCALL_WRITE_DONE_OFFSET,
&call_status->status)) {
dev_warn(&sep->pdev->dev,
@@ -3844,8 +3845,9 @@ static ssize_t sep_write(struct file *filp,
* buffers created. Only SEP_DOUBLEBUF_USERS_LIMIT number
* of threads can progress further at a time
*/
- dev_dbg(&sep->pdev->dev, "[PID%d] waiting for double buffering "
- "region access\n", current->pid);
+ dev_dbg(&sep->pdev->dev,
+ "[PID%d] waiting for double buffering region access\n",
+ current->pid);
error = down_interruptible(&sep->sep_doublebuf);
dev_dbg(&sep->pdev->dev, "[PID%d] double buffering region start\n",
current->pid);
@@ -3889,8 +3891,8 @@ static ssize_t sep_write(struct file *filp,
current->comm, sizeof(current->comm));
if (!my_queue_elem) {
- dev_dbg(&sep->pdev->dev, "[PID%d] updating queue"
- "status error\n", current->pid);
+ dev_dbg(&sep->pdev->dev,
+ "[PID%d] updating queue status error\n", current->pid);
error = -ENOMEM;
goto end_function_error_doublebuf;
}
@@ -4155,8 +4157,8 @@ static int __devinit sep_probe(struct pci_dev *pdev,
INIT_LIST_HEAD(&sep->sep_queue_status);
- dev_dbg(&sep->pdev->dev, "sep probe: PCI obtained, "
- "device being prepared\n");
+ dev_dbg(&sep->pdev->dev,
+ "sep probe: PCI obtained, device being prepared\n");
/* Set up our register area */
sep->reg_physical_addr = pci_resource_start(sep->pdev, 0);
@@ -4318,7 +4320,7 @@ static void sep_remove(struct pci_dev *pdev)
static DEFINE_PCI_DEVICE_TABLE(sep_pci_id_tbl) = {
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x0826)},
{PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x08e9)},
- {0}
+ {0}
};
/* Export our pci_device_id structure to user space */
@@ -4489,30 +4491,5 @@ static struct pci_driver sep_pci_driver = {
.remove = sep_remove
};
-/**
- * sep_init - init function
- *
- * Module load time. Register the PCI device driver.
- */
-
-static int __init sep_init(void)
-{
- return pci_register_driver(&sep_pci_driver);
-}
-
-
-/**
- * sep_exit - called to unload driver
- *
- * Unregister the driver The device will perform all the cleanup required.
- */
-static void __exit sep_exit(void)
-{
- pci_unregister_driver(&sep_pci_driver);
-}
-
-
-module_init(sep_init);
-module_exit(sep_exit);
-
+module_pci_driver(sep_pci_driver);
MODULE_LICENSE("GPL");