From patchwork Thu Feb 3 08:37:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Walle X-Patchwork-Id: 528751 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p138bhLG017643 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 3 Feb 2011 08:38:04 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.74) (envelope-from ) id 1Pkuh7-00063M-01; Thu, 03 Feb 2011 08:37:37 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.74) (envelope-from ) id 1Pkuh5-00063G-W9 for spi-devel-general@lists.sourceforge.net; Thu, 03 Feb 2011 08:37:35 +0000 X-ACL-Warn: Received: from moutng.kundenserver.de ([212.227.126.187]) by sog-mx-2.v43.ch3.sourceforge.com with esmtp (Exim 4.74) id 1Pkuh4-0000i0-GS; Thu, 03 Feb 2011 08:37:35 +0000 Received: from corscience.de (DSL01.212.114.252.242.ip-pool.NEFkom.net [212.114.252.242]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0MCfv0-1Pt8AY0Zu6-008ok1; Thu, 03 Feb 2011 09:37:24 +0100 Received: from agamemnon.CS.local (unknown [192.168.102.58]) by corscience.de (Postfix) with ESMTP id A65C25215B; Thu, 3 Feb 2011 09:37:23 +0100 (CET) From: Bernhard Walle To: dbrownell@users.sourceforge.net, grant.likely@secretlab.ca Subject: [PATCH] spi: spidev: Add 32 bit compat ioctl() Date: Thu, 3 Feb 2011 09:37:18 +0100 Message-Id: <1296722238-4308-1-git-send-email-walle@corscience.de> X-Mailer: git-send-email 1.7.1 X-Provags-ID: V02:K0:EqwpQNPDfZKPFrkzN3KkmFECqy6unjAhBYeXD9yUdtC 6JeTOzXJ0zi67qHCoVE/TRJ1J2bKRCyMibCnQFXAQIRVw4pgeF vwfhhLFMSbPVQ327jLA+g9bpp/OMgN/8ZxG7iOqvQJ6l+rw9oY 7UjAM9CqMKFWS+L8NTTjUyGj/LL1OV1v2NOIB6mJhRYOesPkJA q7YIOXbXBEMwMieI1mvNQ== X-Spam-Score: -0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, low trust [212.227.126.187 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-Headers-End: 1Pkuh4-0000i0-GS Cc: spi-devel-general@lists.sourceforge.net, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, arnd@arndb.de X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 03 Feb 2011 08:38:04 +0000 (UTC) diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 4e6245e..833e238 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -471,6 +472,16 @@ spidev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) return retval; } +#ifdef CONFIG_COMPAT +static long +spidev_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) +{ + return spidev_ioctl(filp, cmd, (unsigned long)compat_ptr(arg)); +} +#else +#define spidev_compat_ioctl NULL +#endif /* CONFIG_COMPAT */ + static int spidev_open(struct inode *inode, struct file *filp) { struct spidev_data *spidev; @@ -543,6 +554,7 @@ static const struct file_operations spidev_fops = { .write = spidev_write, .read = spidev_read, .unlocked_ioctl = spidev_ioctl, + .compat_ioctl = spidev_compat_ioctl, .open = spidev_open, .release = spidev_release, .llseek = no_llseek,