summaryrefslogtreecommitdiff
path: root/arch/arm/mach-bcm2708
diff options
context:
space:
mode:
authorNoralf Trønnes <noralf@tronnes.org>2015-04-30 21:02:44 +0200
committerpopcornmix <popcornmix@gmail.com>2015-05-18 14:12:59 +0100
commit83b376b1b644986288b0f6e9427e595f06e51d4c (patch)
tree144cc5069a2abe8a14878bd804ffef20217b3459 /arch/arm/mach-bcm2708
parent8a172435f08742ce31fd638e7da81bb7ce5fc5d2 (diff)
downloadlinux-83b376b1b644986288b0f6e9427e595f06e51d4c.tar.gz
BCM2708: vcio: Remove unused code and compact comments
The config reference SERIAL_BCM_MBOX_CONSOLE does not exist, so remove the whole clause as it will always be false. Remove includes that are not needed. Add <linux/fs.h>. Also sort include headers alphabetically, since this is now the preferred coding style. Remove vc_mailbox->dev since it is not used. Compact some comments to one line. Remove superfluous comments. Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Diffstat (limited to 'arch/arm/mach-bcm2708')
-rw-r--r--arch/arm/mach-bcm2708/vcio.c68
1 files changed, 15 insertions, 53 deletions
diff --git a/arch/arm/mach-bcm2708/vcio.c b/arch/arm/mach-bcm2708/vcio.c
index 5e9e777186eb..270f126864ee 100644
--- a/arch/arm/mach-bcm2708/vcio.c
+++ b/arch/arm/mach-bcm2708/vcio.c
@@ -12,39 +12,24 @@
* VideoCore processor
*/
-#if defined(CONFIG_SERIAL_BCM_MBOX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
-#define SUPPORT_SYSRQ
-#endif
-
+#include <linux/device.h>
+#include <linux/dma-mapping.h>
#include <linux/module.h>
-#include <linux/console.h>
-#include <linux/serial_core.h>
-#include <linux/serial.h>
#include <linux/errno.h>
-#include <linux/device.h>
+#include <linux/fs.h>
#include <linux/init.h>
-#include <linux/mm.h>
-#include <linux/dma-mapping.h>
-#include <linux/platform_device.h>
-#include <linux/sysrq.h>
-#include <linux/delay.h>
-#include <linux/slab.h>
#include <linux/interrupt.h>
-#include <linux/irq.h>
-
#include <linux/io.h>
+#include <linux/irq.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include <linux/uaccess.h>
#include <mach/vcio.h>
#include <mach/platform.h>
-#include <linux/uaccess.h>
-
#define DRIVER_NAME BCM_VCIO_DRIVER_NAME
-/* ----------------------------------------------------------------------
- * Mailbox
- * -------------------------------------------------------------------- */
-
/* offsets from a mail box base address */
#define MAIL_WRT 0x00 /* write - and next 4 words */
#define MAIL_RD 0x00 /* read - and next 4 words */
@@ -64,7 +49,6 @@
static struct class *vcio_class;
struct vc_mailbox {
- struct device *dev; /* parent device */
void __iomem *status;
void __iomem *config;
void __iomem *read;
@@ -79,7 +63,6 @@ static void mbox_init(struct vc_mailbox *mbox_out, struct device *dev,
{
int i;
- mbox_out->dev = dev;
mbox_out->status = __io_address(addr_mbox + MAIL_STA);
mbox_out->config = __io_address(addr_mbox + MAIL_CNF);
mbox_out->read = __io_address(addr_mbox + MAIL_RD);
@@ -144,7 +127,6 @@ static irqreturn_t mbox_irq(int irq, void *dev_id)
if (chan < MBOX_CHAN_COUNT) {
if (mbox->msg[chan]) {
- /* Overflow */
pr_err(DRIVER_NAME
": mbox chan %d overflow - drop %08x\n",
chan, msg);
@@ -168,9 +150,7 @@ static struct irqaction mbox_irqaction = {
.handler = mbox_irq,
};
-/* ----------------------------------------------------------------------
- * Mailbox Methods
- * -------------------------------------------------------------------- */
+/* Mailbox Methods */
static struct device *mbox_dev; /* we assume there's only one! */
@@ -279,9 +259,7 @@ extern int bcm_mailbox_property(void *data, int size)
}
EXPORT_SYMBOL_GPL(bcm_mailbox_property);
-/* ----------------------------------------------------------------------
- * Platform Device for Mailbox
- * -------------------------------------------------------------------- */
+/* Platform Device for Mailbox */
/*
* Is the device open right now? Used to prevent
@@ -289,33 +267,26 @@ EXPORT_SYMBOL_GPL(bcm_mailbox_property);
*/
static bool device_is_open;
-/*
- * This is called whenever a process attempts to open the device file
- */
+/* This is called whenever a process attempts to open the device file */
static int device_open(struct inode *inode, struct file *file)
{
- /*
- * We don't want to talk to two processes at the same time
- */
+ /* We don't want to talk to two processes at the same time */
if (device_is_open)
return -EBUSY;
device_is_open = true;
- /*
- * Initialize the message
- */
try_module_get(THIS_MODULE);
+
return 0;
}
static int device_release(struct inode *inode, struct file *file)
{
- /*
- * We're now ready for our next caller
- */
+ /* We're now ready for our next caller */
device_is_open = false;
module_put(THIS_MODULE);
+
return 0;
}
@@ -333,9 +304,7 @@ static long device_ioctl(struct file *file, unsigned int ioctl_num,
unsigned long ioctl_param)
{
unsigned size;
- /*
- * Switch according to the ioctl called
- */
+
switch (ioctl_num) {
case IOCTL_MBOX_PROPERTY:
/*
@@ -400,14 +369,7 @@ static int bcm_vcio_probe(struct platform_device *pdev)
}
if (ret == 0) {
- /*
- * Register the character device
- */
ret = register_chrdev(MAJOR_NUM, DEVICE_FILE_NAME, &fops);
-
- /*
- * Negative values signify an error
- */
if (ret < 0) {
pr_err(DRIVER_NAME
"Failed registering the character device %d\n",