From: Michael Büsch Date: Sat, 9 Oct 2010 15:43:06 +0000 (+0000) Subject: ucmb: Fix compile on 2.6.36 X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=commitdiff_plain;h=25719013184080b1f2e852ca174c52d94591f2f9 ucmb: Fix compile on 2.6.36 SVN-Revision: 23361 --- diff --git a/utils/ucmb/Makefile b/utils/ucmb/Makefile index b3e8316bd9..09fc28ee3d 100644 --- a/utils/ucmb/Makefile +++ b/utils/ucmb/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2009 OpenWrt.org +# Copyright (C) 2010 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ucmb -PKG_RELEASE:=1 +PKG_RELEASE:=2 include $(INCLUDE_DIR)/package.mk diff --git a/utils/ucmb/driver/ucmb.c b/utils/ucmb/driver/ucmb.c index bd02d9e8aa..bf4cd9b7c7 100644 --- a/utils/ucmb/driver/ucmb.c +++ b/utils/ucmb/driver/ucmb.c @@ -2,7 +2,7 @@ * Microcontroller Message Bus * Linux kernel driver * - * Copyright (c) 2009 Michael Buesch + * Copyright (c) 2009-2010 Michael Buesch * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -17,6 +17,7 @@ #include "ucmb.h" +#include #include #include #include @@ -191,8 +192,13 @@ static int ucmb_release(struct inode *inode, struct file *filp) return 0; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) +static long ucmb_ioctl(struct file *filp, + unsigned int cmd, unsigned long arg) +#else static int ucmb_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) +#endif { struct ucmb *ucmb = filp_to_ucmb(filp); int ret = 0; @@ -352,7 +358,6 @@ static ssize_t ucmb_write(struct file *filp, const char __user *user_buf, struct ucmb_message_hdr hdr = { .magic = cpu_to_le16(UCMB_MAGIC), }; struct ucmb_message_footer footer = { .crc = 0xFFFF, }; struct ucmb_status status; - size_t i, current_size, chunk_size; mutex_lock(&ucmb->mutex); @@ -517,7 +522,11 @@ static int __devinit ucmb_probe(struct platform_device *pdev) ucmb->mdev_fops.release = ucmb_release; ucmb->mdev_fops.read = ucmb_read; ucmb->mdev_fops.write = ucmb_write; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) + ucmb->mdev_fops.unlocked_ioctl = ucmb_ioctl; +#else ucmb->mdev_fops.ioctl = ucmb_ioctl; +#endif ucmb->mdev.fops = &ucmb->mdev_fops; err = misc_register(&ucmb->mdev);