Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

misc: xilinx_sdfec: fix xsdfec_poll()'s return type

xsdfec_poll() is defined as returning 'unsigned int' but the
.poll method is declared as returning '__poll_t', a bitwise type.

Fix this by using the proper return type and using the EPOLL
constants instead of the POLL ones, as required for __poll_t.

CC: Derek Kiernan <derek.kiernan@xilinx.com>
CC: Dragan Cvetic <dragan.cvetic@xilinx.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Acked-by: Dragan Cvetic <dragan.cvetic@xilinx.com>
Link: https://lore.kernel.org/r/20191209213655.57985-1-luc.vanoostenryck@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Luc Van Oostenryck and committed by
Greg Kroah-Hartman
fa4e7fc1 a6b07e89

+5 -5
+5 -5
drivers/misc/xilinx_sdfec.c
··· 1025 1025 } 1026 1026 #endif 1027 1027 1028 - static unsigned int xsdfec_poll(struct file *file, poll_table *wait) 1028 + static __poll_t xsdfec_poll(struct file *file, poll_table *wait) 1029 1029 { 1030 - unsigned int mask = 0; 1030 + __poll_t mask = 0; 1031 1031 struct xsdfec_dev *xsdfec; 1032 1032 1033 1033 xsdfec = container_of(file->private_data, struct xsdfec_dev, miscdev); 1034 1034 1035 1035 if (!xsdfec) 1036 - return POLLNVAL | POLLHUP; 1036 + return EPOLLNVAL | EPOLLHUP; 1037 1037 1038 1038 poll_wait(file, &xsdfec->waitq, wait); 1039 1039 1040 1040 /* XSDFEC ISR detected an error */ 1041 1041 spin_lock_irqsave(&xsdfec->error_data_lock, xsdfec->flags); 1042 1042 if (xsdfec->state_updated) 1043 - mask |= POLLIN | POLLPRI; 1043 + mask |= EPOLLIN | EPOLLPRI; 1044 1044 1045 1045 if (xsdfec->stats_updated) 1046 - mask |= POLLIN | POLLRDNORM; 1046 + mask |= EPOLLIN | EPOLLRDNORM; 1047 1047 spin_unlock_irqrestore(&xsdfec->error_data_lock, xsdfec->flags); 1048 1048 1049 1049 return mask;