drivers: nfc: Import ASUS changes from 31.1004.0404.107
drivers/nfc/pn8xt/nfc/pn8xt.c:124:42: error: too many arguments to function call, expected 1, have 3 sigret = force_sig_info(SIG_NFC, &sinfo, task); ~~~~~~~~~~~~~~ ^~~~~~~~~~~~ include/linux/sched/signal.h:329:12: note: 'force_sig_info' declared here extern int force_sig_info(struct kernel_siginfo *); ^ drivers/nfc/pn8xt/nfc/pn8xt.c:512:32: warning: implicit conversion from enumeration type 'enum pn8xt_jcop_dwnld_state' to different enumeration type 'pn8xt_access_st_t' (aka 'enum pn8xt_access_state') [-Wenum-convers> signal_handler(JCP_DN_INIT, pn8xt_dev->service_pid); ~~~~~~~~~~~~~~ ^~~~~~~~~~~ drivers/nfc/pn8xt/nfc/pn8xt.c:529:28: warning: implicit conversion from enumeration type 'enum pn8xt_jcop_dwnld_state' to different enumeration type 'pn8xt_access_st_t' (aka 'enum pn8xt_access_state') [-Wenum-convers> signal_handler(JCP_DWP_DN_COMP, pn8xt_dev->service_pid); ~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~ 2 warnings and 1 error generated. Change-Id: I7ca43f08130177a98b996cf097772b4e84c1dd03
This commit is contained in:
parent
30f7fa5080
commit
5021516315
@ -51,25 +51,28 @@ static ssize_t ese_dev_read(struct file *filp, char __user *ubuf,
|
||||
{
|
||||
ssize_t ret = -EFAULT;
|
||||
struct ese_dev *ese_dev = filp->private_data;
|
||||
char rx_buf[MAX_BUFFER_SIZE];
|
||||
char *rx_buf;
|
||||
mutex_lock(&ese_dev->mutex);
|
||||
if (len > MAX_BUFFER_SIZE) {
|
||||
len = MAX_BUFFER_SIZE;
|
||||
}
|
||||
pr_debug("%s: start reading of %zu bytes\n", __func__, len);
|
||||
memset(rx_buf, 0, sizeof(rx_buf));
|
||||
rx_buf = kmalloc(MAX_BUFFER_SIZE, GFP_DMA);
|
||||
ret = spi_read(ese_dev->spi, rx_buf, len);
|
||||
if (0 > ret) {
|
||||
pr_err("%s failed to read from SPI\n", __func__);
|
||||
kfree(rx_buf);
|
||||
mutex_unlock(&ese_dev->mutex);
|
||||
return -EIO;
|
||||
}
|
||||
if (copy_to_user(ubuf, rx_buf, len)) {
|
||||
pr_err("%s failed to copy from user\n", __func__);
|
||||
mutex_unlock(&ese_dev->mutex);
|
||||
kfree(rx_buf);
|
||||
return -EFAULT;
|
||||
}
|
||||
mutex_unlock(&ese_dev->mutex);
|
||||
kfree(rx_buf);
|
||||
pr_debug("%s: Success in reading %zu bytes\n", __func__, len);
|
||||
return ret;
|
||||
}
|
||||
@ -79,25 +82,28 @@ static ssize_t ese_dev_write(struct file *filp, const char __user *ubuf,
|
||||
{
|
||||
ssize_t ret = -EFAULT;
|
||||
struct ese_dev *ese_dev = filp->private_data;
|
||||
char tx_buf[MAX_BUFFER_SIZE];
|
||||
char *tx_buf;
|
||||
mutex_lock(&ese_dev->write_mutex);
|
||||
if (len > MAX_BUFFER_SIZE)
|
||||
len = MAX_BUFFER_SIZE;
|
||||
pr_debug("%s: start writing of %zu bytes\n", __func__, len);
|
||||
memset(tx_buf, 0, sizeof(tx_buf));
|
||||
tx_buf = kmalloc(MAX_BUFFER_SIZE, GFP_DMA);
|
||||
if (copy_from_user(tx_buf, ubuf, len)) {
|
||||
pr_err("%s: failed to copy from user\n", __func__);
|
||||
mutex_unlock(&ese_dev->write_mutex);
|
||||
kfree(tx_buf);
|
||||
return -EFAULT;
|
||||
}
|
||||
ret = spi_write(ese_dev->spi, tx_buf, len);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed to write to SPI\n", __func__);
|
||||
mutex_unlock(&ese_dev->write_mutex);
|
||||
kfree(tx_buf);
|
||||
return -EIO;
|
||||
}
|
||||
pr_debug("%s: Success in writing %zu bytes\n", __func__, len);
|
||||
mutex_unlock(&ese_dev->write_mutex);
|
||||
kfree(tx_buf);
|
||||
return len;
|
||||
}
|
||||
|
||||
@ -117,6 +123,8 @@ static int ese_dev_open(struct inode *inode, struct file *filp)
|
||||
struct ese_dev *ese_dev = container_of(filp->private_data,
|
||||
struct ese_dev, device);
|
||||
mutex_lock(&ese_dev->mutex);
|
||||
#ifndef ASUS_SAKE_PROJECT
|
||||
#ifndef ASUS_VODKA_PROJECT
|
||||
/* Find the NFC parent device if it exists. */
|
||||
if (ese_dev->nfcc_data == NULL) {
|
||||
struct device *nfc_dev = bus_find_device_by_name(
|
||||
@ -140,6 +148,8 @@ static int ese_dev_open(struct inode *inode, struct file *filp)
|
||||
pr_info("%s: NFC controller found\n", __func__);
|
||||
ese_dev->nfcc_device = nfc_dev;
|
||||
}
|
||||
#endif // ASUS_VODKA_PROJECT
|
||||
#endif // ASUS_SAKE_PROJECT
|
||||
mutex_unlock(&ese_dev->mutex);
|
||||
func(NFC_PLATFORM, _ese_dev_open)(ese_dev);
|
||||
filp->private_data = ese_dev;
|
||||
@ -225,6 +235,8 @@ static int ese_probe(struct spi_device *spi)
|
||||
pr_info("%s: rst gpio not provided\n", __func__);
|
||||
}
|
||||
|
||||
#ifndef ASUS_SAKE_PROJECT
|
||||
#ifndef ASUS_VODKA_PROJECT
|
||||
ret = of_property_read_string(np, "nxp,nfcc", &ese_dev->nfcc_name);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: nxp,nfcc invalid or missing in device tree (%d)\n",
|
||||
@ -233,6 +245,8 @@ static int ese_probe(struct spi_device *spi)
|
||||
}
|
||||
pr_info("%s: device tree set '%s' as eSE power controller\n",
|
||||
__func__, ese_dev->nfcc_name);
|
||||
#endif // ASUS_VODKA_PROJECT
|
||||
#endif // ASUS_SAKE_PROJECT
|
||||
|
||||
ret = misc_register(&ese_dev->device);
|
||||
if (ret) {
|
||||
|
@ -105,7 +105,7 @@ static int signal_handler(pn8xt_access_st_t state, long nfc_pid)
|
||||
{
|
||||
int sigret = 0;
|
||||
pid_t pid;
|
||||
struct siginfo sinfo;
|
||||
struct kernel_siginfo sinfo;
|
||||
struct task_struct *task;
|
||||
|
||||
if(nfc_pid <= 0) {
|
||||
@ -121,7 +121,7 @@ static int signal_handler(pn8xt_access_st_t state, long nfc_pid)
|
||||
task = pid_task(find_vpid(pid), PIDTYPE_PID);
|
||||
if(task) {
|
||||
pr_info("%s: %s\n", __func__, task->comm);
|
||||
sigret = force_sig_info(SIG_NFC, &sinfo, task);
|
||||
sigret = force_sig_info_to_task(&sinfo, task);
|
||||
if(sigret < 0) {
|
||||
pr_err("%s: send_sig_info failed, sigret %d\n", __func__, sigret);
|
||||
return -1;
|
||||
@ -441,7 +441,10 @@ static long pn8xt_ese_pwr(struct nfc_dev *nfc_dev, unsigned int cmd, unsigned lo
|
||||
trigger_onoff(pn8xt_dev, ST_SPI_SVDD_SY_END);
|
||||
msleep(10);
|
||||
if(!gpio_get_value(nfc_dev->ese_pwr_gpio))
|
||||
{
|
||||
gpio_set_value(nfc_dev->ese_pwr_gpio, 1);
|
||||
pn8xt_update_state(pn8xt_dev, ST_SPI, true);
|
||||
}
|
||||
msleep(10);
|
||||
}
|
||||
} else {
|
||||
@ -509,7 +512,7 @@ static long set_jcop_download_state(struct pn8xt_dev *pn8xt_dev, unsigned long a
|
||||
case JCP_DN_INIT:
|
||||
if(pn8xt_dev->service_pid) {
|
||||
pr_err("%s:nfc service pid %ld", __func__, pn8xt_dev->service_pid);
|
||||
signal_handler(JCP_DN_INIT, pn8xt_dev->service_pid);
|
||||
signal_handler((pn8xt_access_st_t)JCP_DN_INIT, pn8xt_dev->service_pid);
|
||||
} else {
|
||||
if (*cur_state & ST_JCP_DN) {
|
||||
ret = -EINVAL;
|
||||
@ -526,7 +529,7 @@ static long set_jcop_download_state(struct pn8xt_dev *pn8xt_dev, unsigned long a
|
||||
}
|
||||
break;
|
||||
case JCP_SPI_DN_COMP:
|
||||
signal_handler(JCP_DWP_DN_COMP, pn8xt_dev->service_pid);
|
||||
signal_handler((pn8xt_access_st_t)JCP_DWP_DN_COMP, pn8xt_dev->service_pid);
|
||||
pn8xt_update_state(pn8xt_dev, ST_JCP_DN, false);
|
||||
break;
|
||||
case JCP_DWP_DN_COMP:
|
||||
|
@ -327,6 +327,7 @@ int force_sig_ptrace_errno_trap(int errno, void __user *addr);
|
||||
extern int send_sig_info(int, struct kernel_siginfo *, struct task_struct *);
|
||||
extern void force_sigsegv(int sig);
|
||||
extern int force_sig_info(struct kernel_siginfo *);
|
||||
extern int force_sig_info_to_task(struct kernel_siginfo *info, struct task_struct *t);
|
||||
extern int __kill_pgrp_info(int sig, struct kernel_siginfo *info, struct pid *pgrp);
|
||||
extern int kill_pid_info(int sig, struct kernel_siginfo *info, struct pid *pid);
|
||||
extern int kill_pid_usb_asyncio(int sig, int errno, sigval_t addr, struct pid *,
|
||||
|
@ -1307,7 +1307,7 @@ int do_send_sig_info(int sig, struct kernel_siginfo *info, struct task_struct *p
|
||||
* We don't want to have recursive SIGSEGV's etc, for example,
|
||||
* that is why we also clear SIGNAL_UNKILLABLE.
|
||||
*/
|
||||
static int
|
||||
int
|
||||
force_sig_info_to_task(struct kernel_siginfo *info, struct task_struct *t)
|
||||
{
|
||||
unsigned long int flags;
|
||||
|
Loading…
Reference in New Issue
Block a user