BCM2708: vcio: Move some macros from header to driver

Move some macros that are only used by the driver:
MAJOR_NUM
IOCTL_MBOX_PROPERTY
DEVICE_FILE_NAME

This one becomes superfluous: BCM_VCIO_DRIVER_NAME

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
This commit is contained in:
Noralf Trønnes
2015-04-30 21:28:31 +02:00
committed by popcornmix
parent 62d6bea512
commit d264726de2
2 changed files with 7 additions and 37 deletions

View File

@@ -20,8 +20,6 @@
* (semaphores, doorbells, mailboxes)
*/
#define BCM_VCIO_DRIVER_NAME "bcm2708_vcio"
/* Constants shared with the ARM identifying separate mailbox channels */
#define MBOX_CHAN_POWER 0 /* for use by the power management interface */
#define MBOX_CHAN_FB 1 /* for use by the frame buffer */
@@ -127,37 +125,4 @@ extern int /*rc*/ bcm_mailbox_read(unsigned chan, uint32_t *data28);
extern int /*rc*/ bcm_mailbox_write(unsigned chan, uint32_t data28);
extern int /*rc*/ bcm_mailbox_property(void *data, int size);
#include <linux/ioctl.h>
/*
* The major device number. We can't rely on dynamic
* registration any more, because ioctls need to know
* it.
*/
#define MAJOR_NUM 100
/*
* Set the message of the device driver
*/
#define IOCTL_MBOX_PROPERTY _IOWR(MAJOR_NUM, 0, char *)
/*
* _IOWR means that we're creating an ioctl command
* number for passing information from a user process
* to the kernel module and from the kernel module to user process
*
* The first arguments, MAJOR_NUM, is the major device
* number we're using.
*
* The second argument is the number of the command
* (there could be several with different meanings).
*
* The third argument is the type we want to get from
* the process to the kernel.
*/
/*
* The name of the device file
*/
#define DEVICE_FILE_NAME "vcio"
#endif

View File

@@ -20,6 +20,7 @@
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/ioctl.h>
#include <linux/irq.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
@@ -28,7 +29,8 @@
#include <mach/vcio.h>
#include <mach/platform.h>
#define DRIVER_NAME BCM_VCIO_DRIVER_NAME
#define DRIVER_NAME "bcm2708_vcio"
#define DEVICE_FILE_NAME "vcio"
/* offsets from a mail box base address */
#define MAIL_WRT 0x00 /* write - and next 4 words */
@@ -46,6 +48,9 @@
#define MBOX_MAGIC 0xd0d0c0de
#define MAJOR_NUM 100
#define IOCTL_MBOX_PROPERTY _IOWR(MAJOR_NUM, 0, char *)
static struct class *vcio_class;
struct vc_mailbox {
@@ -370,7 +375,7 @@ static int bcm_vcio_probe(struct platform_device *pdev)
ret);
return ret;
}
vcio_class = class_create(THIS_MODULE, BCM_VCIO_DRIVER_NAME);
vcio_class = class_create(THIS_MODULE, DRIVER_NAME);
if (IS_ERR(vcio_class)) {
ret = PTR_ERR(vcio_class);
return ret;