linux中点亮led灯时出现无效操作数的错误,源代码如下:
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/delay.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/arch/regs-gpio.h>
#include <asm/hardware.h>
#include <linux/fs.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/cdev.h>
#include <linux/slab.h>
volatile unsigned long gpbcon = NULL;
volatile unsigned long *gpbdat = NULL;
static struct class *firstdrv_class;
static struct class_device *firstdrv_class_dev;
int first_drv_open(struct inode *inode, struct file *file)
{
gpbcon &= ~((0x3<<(5*2))|(0x3<<(6*2))|(0x3<<(7*2))|(0x3<<(8*2)));
gpbcon |= ((0x1<<(5*2))|(0x1<<(6*2))|(0x1<<(7*2))|(0x1<<(8*2)));
//printk("first_drv_open\n");
return 0;
}
ssize_t first_drv_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
int val;