summaryrefslogtreecommitdiff
path: root/drivers/staging/csr/drv.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-11 21:59:44 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-11 21:59:44 (GMT)
commit8966961b31c251b854169e9886394c2a20f2cea7 (patch)
tree248a625b23335acbd5ca4b55eb136fe0dc8ba0aa /drivers/staging/csr/drv.c
parent6a5971d8fea1f4a8c33dfe0cec6a1c490f0c9cde (diff)
parent7bcb57cde66c19df378f3468ea342166a8a4504d (diff)
downloadlinux-fsl-qoriq-8966961b31c251b854169e9886394c2a20f2cea7.tar.xz
Merge tag 'staging-3.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver tree merge from Greg Kroah-Hartman: "Here's the big staging tree merge for 3.8-rc1 There's a lot of patches in here, the majority being the comedi rework/cleanup that has been ongoing and is causing a huge reduction in overall code size, which is amazing to watch. We also removed some older drivers (telephony and rts_pstor), and added a new one (fwserial which also came in through the tty tree due to tty api changes, take that one if you get merge conflicts.) The iio and ipack drivers are moving out of the staging area into their own part of the kernel as they have been cleaned up sufficiently and are working well. Overall, again a reduction of code: 768 files changed, 31887 insertions(+), 82166 deletions(-) All of this has been in the linux-next tree for a while. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" * tag 'staging-3.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1298 commits) iio: imu: adis16480: remove duplicated include from adis16480.c iio: gyro: adis16136: remove duplicated include from adis16136.c iio:imu: adis16480: show_firmware() buffer too small iio:gyro: adis16136: divide by zero in write_frequency() iio: adc: Add Texas Instruments ADC081C021/027 support iio:ad7793: Add support for the ad7796 and ad7797 iio:ad7793: Add support for the ad7798 and ad7799 staging:iio: Move ad7793 driver out of staging staging:iio:ad7793: Implement stricter id checking staging:iio:ad7793: Move register definitions from header to source staging:iio:ad7793: Rework regulator handling staging:iio:ad7793: Rework platform data staging:iio:ad7793: Use kstrtol instead of strict_strtol staging:iio:ad7793: Use usleep_range instead of msleep staging:iio:ad7793: Fix temperature scale staging:iio:ad7793: Fix VDD monitor scale staging: gdm72xx: unlock on error in init_usb() staging: panel: pass correct lengths to keypad_send_key() staging: comedi: addi_apci_2032: fix interrupt support staging: comedi: addi_apci_2032: move i_APCI2032_ConfigDigitalOutput() ...
Diffstat (limited to 'drivers/staging/csr/drv.c')
-rw-r--r--drivers/staging/csr/drv.c101
1 files changed, 30 insertions, 71 deletions
diff --git a/drivers/staging/csr/drv.c b/drivers/staging/csr/drv.c
index 2497580..4780c32 100644
--- a/drivers/staging/csr/drv.c
+++ b/drivers/staging/csr/drv.c
@@ -166,33 +166,32 @@ s32 CsrHipResultToStatus(CsrResult csrResult)
static const char*
trace_putest_cmdid(unifi_putest_command_t putest_cmd)
{
- switch (putest_cmd)
- {
- case UNIFI_PUTEST_START:
- return "START";
- case UNIFI_PUTEST_STOP:
- return "STOP";
- case UNIFI_PUTEST_SET_SDIO_CLOCK:
- return "SET CLOCK";
- case UNIFI_PUTEST_CMD52_READ:
- return "CMD52R";
- case UNIFI_PUTEST_CMD52_BLOCK_READ:
- return "CMD52BR";
- case UNIFI_PUTEST_CMD52_WRITE:
- return "CMD52W";
- case UNIFI_PUTEST_DL_FW:
- return "D/L FW";
- case UNIFI_PUTEST_DL_FW_BUFF:
- return "D/L FW BUFFER";
- case UNIFI_PUTEST_COREDUMP_PREPARE:
- return "PREPARE COREDUMP";
- case UNIFI_PUTEST_GP_READ16:
- return "GP16R";
- case UNIFI_PUTEST_GP_WRITE16:
- return "GP16W";
- default:
- return "ERROR: unrecognised command";
- }
+ switch (putest_cmd) {
+ case UNIFI_PUTEST_START:
+ return "START";
+ case UNIFI_PUTEST_STOP:
+ return "STOP";
+ case UNIFI_PUTEST_SET_SDIO_CLOCK:
+ return "SET CLOCK";
+ case UNIFI_PUTEST_CMD52_READ:
+ return "CMD52R";
+ case UNIFI_PUTEST_CMD52_BLOCK_READ:
+ return "CMD52BR";
+ case UNIFI_PUTEST_CMD52_WRITE:
+ return "CMD52W";
+ case UNIFI_PUTEST_DL_FW:
+ return "D/L FW";
+ case UNIFI_PUTEST_DL_FW_BUFF:
+ return "D/L FW BUFFER";
+ case UNIFI_PUTEST_COREDUMP_PREPARE:
+ return "PREPARE COREDUMP";
+ case UNIFI_PUTEST_GP_READ16:
+ return "GP16R";
+ case UNIFI_PUTEST_GP_WRITE16:
+ return "GP16W";
+ default:
+ return "ERROR: unrecognised command";
+ }
}
#ifdef CSR_WIFI_HIP_DEBUG_OFFLINE
@@ -266,8 +265,6 @@ unifi_open(struct inode *inode, struct file *file)
unifi_priv_t *priv;
ul_client_t *udi_cli;
- func_enter();
-
devno = MINOR(inode->i_rdev) >> 1;
/*
@@ -278,7 +275,6 @@ unifi_open(struct inode *inode, struct file *file)
priv = uf_get_instance(devno);
if (priv == NULL) {
unifi_error(NULL, "unifi_open: No device present\n");
- func_exit();
return -ENODEV;
}
@@ -290,7 +286,6 @@ unifi_open(struct inode *inode, struct file *file)
/* Too many clients already using this device */
unifi_error(priv, "Too many clients already open\n");
uf_put_instance(devno);
- func_exit();
return -ENOSPC;
}
unifi_trace(priv, UDBG1, "Client is registered to /dev/unifiudi%d\n", devno);
@@ -310,7 +305,6 @@ unifi_open(struct inode *inode, struct file *file)
uf_put_instance(devno);
unifi_info(priv, "There is already a configuration client using the character device\n");
- func_exit();
return -EBUSY;
}
#endif /* CSR_SME_USERSPACE */
@@ -331,7 +325,6 @@ unifi_open(struct inode *inode, struct file *file)
uf_put_instance(devno);
unifi_error(priv, "Too many clients already open\n");
- func_exit();
return -ENOSPC;
}
@@ -357,7 +350,6 @@ unifi_open(struct inode *inode, struct file *file)
*/
file->private_data = udi_cli;
- func_exit();
return 0;
} /* unifi_open() */
@@ -369,8 +361,6 @@ unifi_release(struct inode *inode, struct file *filp)
int devno;
unifi_priv_t *priv;
- func_enter();
-
priv = uf_find_instance(udi_cli->instance);
if (!priv) {
unifi_error(priv, "unifi_close: instance for device not found\n");
@@ -465,8 +455,6 @@ unifi_read(struct file *filp, char *p, size_t len, loff_t *poff)
struct list_head *l;
int msglen;
- func_enter();
-
priv = uf_find_instance(pcli->instance);
if (!priv) {
unifi_error(priv, "invalid priv\n");
@@ -527,7 +515,6 @@ unifi_read(struct file *filp, char *p, size_t len, loff_t *poff)
/* It is our resposibility to free the message buffer. */
kfree(logptr);
- func_exit_r(msglen);
return msglen;
} /* unifi_read() */
@@ -615,7 +602,6 @@ udi_send_signal_unpacked(unifi_priv_t *priv, unsigned char* data, uint data_len)
unifi_net_data_free(priv, &bulk_data.d[i]);
}
}
- func_exit();
return -EIO;
}
@@ -654,8 +640,6 @@ udi_send_signal_raw(unifi_priv_t *priv, unsigned char *buf, int buflen)
int bytecount;
CsrResult csrResult;
- func_enter();
-
/*
* The signal is the first thing in buf, the signal id is the
* first 16 bits of the signal.
@@ -668,7 +652,6 @@ udi_send_signal_raw(unifi_priv_t *priv, unsigned char *buf, int buflen)
if ((signal_size <= 0) || (signal_size > buflen)) {
unifi_error(priv, "udi_send_signal_raw - Couldn't find length of signal 0x%x\n",
sig_id);
- func_exit();
return -EINVAL;
}
unifi_trace(priv, UDBG2, "udi_send_signal_raw: signal 0x%.4X len:%d\n",
@@ -713,7 +696,6 @@ udi_send_signal_raw(unifi_priv_t *priv, unsigned char *buf, int buflen)
if (bytecount > buflen) {
unifi_error(priv, "udi_send_signal_raw: Not enough data (%d instead of %d)\n", buflen, bytecount);
- func_exit();
return -EINVAL;
}
@@ -721,7 +703,6 @@ udi_send_signal_raw(unifi_priv_t *priv, unsigned char *buf, int buflen)
r = ul_send_signal_raw(priv, buf, signal_size, &data_ptrs);
if (r < 0) {
unifi_error(priv, "udi_send_signal_raw: send failed (%d)\n", r);
- func_exit();
return -EIO;
}
@@ -746,8 +727,6 @@ udi_send_signal_raw(unifi_priv_t *priv, unsigned char *buf, int buflen)
}
#endif
- func_exit_r(bytecount);
-
return bytecount;
} /* udi_send_signal_raw */
@@ -784,8 +763,6 @@ unifi_write(struct file *filp, const char *p, size_t len, loff_t *poff)
bulk_data_param_t bulkdata;
CsrResult csrResult;
- func_enter();
-
priv = uf_find_instance(pcli->instance);
if (!priv) {
unifi_error(priv, "invalid priv\n");
@@ -812,7 +789,6 @@ unifi_write(struct file *filp, const char *p, size_t len, loff_t *poff)
csrResult = unifi_net_data_malloc(priv, &bulkdata.d[0], len);
if (csrResult != CSR_RESULT_SUCCESS) {
unifi_error(priv, "unifi_write: failed to allocate request_data.\n");
- func_exit();
return -ENOMEM;
}
@@ -822,7 +798,6 @@ unifi_write(struct file *filp, const char *p, size_t len, loff_t *poff)
if (copy_from_user((void*)user_data_buf, p, len)) {
unifi_error(priv, "unifi_write: copy from user failed\n");
unifi_net_data_free(priv, &bulkdata.d[0]);
- func_exit();
return -EFAULT;
}
@@ -838,7 +813,6 @@ unifi_write(struct file *filp, const char *p, size_t len, loff_t *poff)
unifi_error(priv, "unifi_write - Couldn't find length of signal 0x%x\n",
sig_id);
unifi_net_data_free(priv, &bulkdata.d[0]);
- func_exit();
return -EINVAL;
}
@@ -849,7 +823,6 @@ unifi_write(struct file *filp, const char *p, size_t len, loff_t *poff)
signal_buf = kmalloc(signal_size, GFP_KERNEL);
if (!signal_buf) {
unifi_net_data_free(priv, &bulkdata.d[0]);
- func_exit();
return -ENOMEM;
}
@@ -948,8 +921,6 @@ unifi_write(struct file *filp, const char *p, size_t len, loff_t *poff)
kfree(buf);
- func_exit_r(bytes_written);
-
return bytes_written;
} /* unifi_write() */
@@ -1657,8 +1628,6 @@ unifi_poll(struct file *filp, poll_table *wait)
unsigned int mask = 0;
int ready;
- func_enter();
-
ready = !list_empty(&pcli->udi_log);
poll_wait(filp, &pcli->udi_wq, wait);
@@ -1667,8 +1636,6 @@ unifi_poll(struct file *filp, poll_table *wait)
mask |= POLLIN | POLLRDNORM; /* readable */
}
- func_exit();
-
return mask;
} /* unifi_poll() */
@@ -1784,8 +1751,6 @@ udi_log_event(ul_client_t *pcli,
unsigned long n_1000;
#endif
- func_enter();
-
/* Just a sanity check */
if ((signal == NULL) || (signal_len <= 0)) {
return;
@@ -1901,7 +1866,6 @@ udi_log_event(ul_client_t *pcli,
if (down_interruptible(&pcli->udi_sem)) {
printk(KERN_WARNING "udi_log_event_q: Failed to get udi sem\n");
kfree(logptr);
- func_exit();
return;
}
list_add_tail(&logptr->q, &pcli->udi_log);
@@ -1910,7 +1874,6 @@ udi_log_event(ul_client_t *pcli,
/* Wake any waiting user process */
wake_up_interruptible(&pcli->udi_wq);
- func_exit();
} /* udi_log_event() */
#ifdef CSR_SME_USERSPACE
@@ -1921,8 +1884,6 @@ uf_sme_queue_message(unifi_priv_t *priv, u8 *buffer, int length)
udi_msg_t *msgptr;
u8 *p;
- func_enter();
-
/* Just a sanity check */
if ((buffer == NULL) || (length <= 0)) {
return -EINVAL;
@@ -1968,8 +1929,6 @@ uf_sme_queue_message(unifi_priv_t *priv, u8 *buffer, int length)
/* It is our responsibility to free the buffer allocated in build_packed_*() */
kfree(buffer);
- func_exit();
-
return 0;
} /* uf_sme_queue_message() */
@@ -2059,10 +2018,10 @@ int uf_create_device_nodes(unifi_priv_t *priv, int bus_id)
void uf_destroy_device_nodes(unifi_priv_t *priv)
{
- device_destroy(unifi_class, priv->unifiudi_cdev.dev);
- device_destroy(unifi_class, priv->unifi_cdev.dev);
- cdev_del(&priv->unifiudi_cdev);
- cdev_del(&priv->unifi_cdev);
+ device_destroy(unifi_class, priv->unifiudi_cdev.dev);
+ device_destroy(unifi_class, priv->unifi_cdev.dev);
+ cdev_del(&priv->unifiudi_cdev);
+ cdev_del(&priv->unifi_cdev);
}