hwmon: epm_adc: Support 32bit library IOCTL calls

Add support to differentiate between IOCTL 32bit vs
64bit userspace library calls.

Change-Id: I14e9d81798f793dc88b91f2d6b91fce11f425f2a
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
This commit is contained in:
Siddartha Mohanadoss 2015-04-13 08:22:55 -07:00
parent 594132c011
commit 2a5c98c67d
1 changed files with 13 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -307,8 +307,20 @@ static long epm_adc_ioctl(struct file *file, unsigned int cmd,
return 0;
}
#ifdef CONFIG_COMPAT
static long epm_adc_compat_ioctl_process(struct file *filep,
unsigned int cmd, unsigned long arg)
{
arg = (unsigned long)compat_ptr(arg);
return epm_adc_ioctl(filep, cmd, arg);
}
#endif /* CONFIG_COMPAT */
const struct file_operations epm_adc_fops = {
.unlocked_ioctl = epm_adc_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = epm_adc_compat_ioctl_process,
#endif /* CONFIG_COMPAT */
};
static int get_device_tree_data(struct spi_device *spi)