Skip to content

Commit

Permalink
Fix build for recent kernels
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
  • Loading branch information
alexandrebelloni committed Jun 9, 2013
1 parent 85b6e58 commit 73b0806
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
13 changes: 7 additions & 6 deletions hx170dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
#include <asm/uaccess.h>
#include <linux/ioport.h>
#include <linux/clk.h>
#include <uapi/asm-generic/signal.h>
#include <asm-generic/siginfo.h>
#include <uapi/asm-generic/siginfo.h>

#include <asm/irq.h>
#include <linux/irq.h>
Expand All @@ -74,7 +77,7 @@ MODULE_DESCRIPTION("driver module for 8170/81990 Hantro decoder/pp");
/* Logic module base address */
#define HXDEC_LOGIC_MODULE0_BASE AT91SAM9G45_VDEC_BASE

#define VP_PB_INT_LT AT91SAM9G45_ID_VDEC
#define VP_PB_INT_LT (NR_IRQS_LEGACY + AT91SAM9G45_ID_VDEC)

#define INT_EXPINT1 10
#define INT_EXPINT2 11
Expand Down Expand Up @@ -145,7 +148,7 @@ static irqreturn_t hx170dec_isr(int irq, void *dev_id);
Return type : int
------------------------------------------------------------------------------*/

static int hx170dec_ioctl(struct inode *inode, struct file *filp,
static long hx170dec_ioctl(struct file *filp,
unsigned int cmd, unsigned long arg)
{
int err = 0;
Expand Down Expand Up @@ -282,7 +285,7 @@ static int hx170dec_release(struct inode *inode, struct file *filp)
static struct file_operations hx170dec_fops = {
open:hx170dec_open,
release:hx170dec_release,
ioctl:hx170dec_ioctl,
unlocked_ioctl:hx170dec_ioctl,
fasync:hx170dec_fasync,
};

Expand Down Expand Up @@ -335,7 +338,7 @@ int __init hx170dec_init(void)
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18))
SA_INTERRUPT | SA_SHIRQ,
#else
IRQF_DISABLED | IRQF_SHARED,
IRQF_DISABLED | IRQF_SHARED | IRQF_TRIGGER_HIGH,
#endif
"hx170dec", (void *) &hx170dec_data);
if(result != 0)
Expand Down Expand Up @@ -440,8 +443,6 @@ static int CheckHwId(hx170dec_t * dev)
------------------------------------------------------------------------------*/
static int ReserveIO(void)
{
set_irq_type(AT91SAM9G45_ID_VDEC, IRQ_TYPE_LEVEL_HIGH);

clk_enable(clk_get(NULL, "vdec_clk"));

if(!request_mem_region
Expand Down
14 changes: 7 additions & 7 deletions memalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct allocation

struct list_head heap_list;

static spinlock_t mem_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(mem_lock);

typedef struct hlinc
{
Expand Down Expand Up @@ -182,15 +182,15 @@ static int AllocMemory(unsigned *busaddr, unsigned int size, struct file *filp);
static int FreeMemory(unsigned long busaddr);
static void ResetMems(void);

static int memalloc_ioctl(struct inode *inode, struct file *filp,
static long memalloc_ioctl(struct file *filp,
unsigned int cmd, unsigned long arg)
{
int err = 0;
int ret;

PDEBUG("ioctl cmd 0x%08x\n", cmd);

if(inode == NULL || filp == NULL || arg == 0)
if(filp == NULL || arg == 0)
{
return -EFAULT;
}
Expand Down Expand Up @@ -221,17 +221,17 @@ static int memalloc_ioctl(struct inode *inode, struct file *filp,

case MEMALLOC_IOCXGETBUFFER:
{
int result;
int result, ignored;
MemallocParams memparams;

PDEBUG("GETBUFFER\n");
spin_lock(&mem_lock);

__copy_from_user(&memparams, (const void *) arg, sizeof(memparams));
ignored = copy_from_user(&memparams, (const void *) arg, sizeof(memparams));

result = AllocMemory(&memparams.busAddress, memparams.size, filp);

__copy_to_user((void *) arg, &memparams, sizeof(memparams));
ignored = copy_to_user((void *) arg, &memparams, sizeof(memparams));

spin_unlock(&mem_lock);

Expand Down Expand Up @@ -297,7 +297,7 @@ static int memalloc_release(struct inode *inode, struct file *filp)
static struct file_operations memalloc_fops = {
open:memalloc_open,
release:memalloc_release,
ioctl:memalloc_ioctl,
unlocked_ioctl:memalloc_ioctl,
};

int __init memalloc_init(void)
Expand Down

0 comments on commit 73b0806

Please sign in to comment.