summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/cris/arch-v10/drivers/gpio.c2
-rw-r--r--arch/cris/arch-v10/drivers/sync_serial.c8
-rw-r--r--arch/cris/arch-v32/drivers/sync_serial.c10
-rw-r--r--arch/ia64/kernel/perfmon.c2
-rw-r--r--arch/mips/kernel/rtlx.c4
-rw-r--r--arch/powerpc/kernel/rtasd.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/backing_ops.c8
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c10
-rw-r--r--arch/powerpc/platforms/cell/spufs/hw_ops.c8
-rw-r--r--arch/powerpc/platforms/powernv/opal-prd.c2
-rw-r--r--arch/x86/kernel/apm_32.c2
-rw-r--r--arch/x86/kernel/cpu/mcheck/dev-mcelog.c4
-rw-r--r--block/bsg.c4
-rw-r--r--crypto/af_alg.c16
-rw-r--r--drivers/acpi/acpi_dbg.c4
-rw-r--r--drivers/android/binder.c4
-rw-r--r--drivers/bluetooth/hci_vhci.c4
-rw-r--r--drivers/char/apm-emulation.c2
-rw-r--r--drivers/char/dsp56k.c2
-rw-r--r--drivers/char/dtlk.c6
-rw-r--r--drivers/char/hpet.c2
-rw-r--r--drivers/char/ipmi/bt-bmc.c4
-rw-r--r--drivers/char/ipmi/ipmi_devintf.c2
-rw-r--r--drivers/char/ipmi/ipmi_watchdog.c2
-rw-r--r--drivers/char/pcmcia/cm4040_cs.c4
-rw-r--r--drivers/char/ppdev.c2
-rw-r--r--drivers/char/random.c4
-rw-r--r--drivers/char/rtc.c2
-rw-r--r--drivers/char/snsc.c4
-rw-r--r--drivers/char/sonypi.c2
-rw-r--r--drivers/char/tpm/tpm_vtpm_proxy.c6
-rw-r--r--drivers/char/virtio_console.c8
-rw-r--r--drivers/char/xillybus/xillybus_core.c12
-rw-r--r--drivers/dma-buf/dma-buf.c26
-rw-r--r--drivers/dma-buf/sync_file.c2
-rw-r--r--drivers/firewire/core-cdev.c4
-rw-r--r--drivers/firewire/nosy.c4
-rw-r--r--drivers/gpio/gpiolib.c4
-rw-r--r--drivers/gpu/drm/drm_file.c2
-rw-r--r--drivers/gpu/drm/i915/i915_perf.c10
-rw-r--r--drivers/gpu/vga/vgaarb.c2
-rw-r--r--drivers/hid/hid-debug.c4
-rw-r--r--drivers/hid/hid-roccat.c4
-rw-r--r--drivers/hid/hid-sensor-custom.c2
-rw-r--r--drivers/hid/hidraw.c4
-rw-r--r--drivers/hid/uhid.c2
-rw-r--r--drivers/hid/usbhid/hiddev.c4
-rw-r--r--drivers/hsi/clients/cmt_speech.c4
-rw-r--r--drivers/hv/hv_utils_transport.c4
-rw-r--r--drivers/iio/buffer/industrialio-buffer-dma.c4
-rw-r--r--drivers/iio/industrialio-buffer.c6
-rw-r--r--drivers/iio/industrialio-event.c6
-rw-r--r--drivers/infiniband/core/ucm.c2
-rw-r--r--drivers/infiniband/core/ucma.c2
-rw-r--r--drivers/infiniband/core/user_mad.c4
-rw-r--r--drivers/infiniband/core/uverbs_main.c2
-rw-r--r--drivers/infiniband/hw/hfi1/file_ops.c8
-rw-r--r--drivers/infiniband/hw/qib/qib_file_ops.c8
-rw-r--r--drivers/infiniband/ulp/iser/iscsi_iser.c2
-rw-r--r--drivers/input/evdev.c6
-rw-r--r--drivers/input/input.c2
-rw-r--r--drivers/input/joydev.c4
-rw-r--r--drivers/input/misc/hp_sdc_rtc.c2
-rw-r--r--drivers/input/misc/uinput.c2
-rw-r--r--drivers/input/mousedev.c4
-rw-r--r--drivers/input/serio/serio_raw.c4
-rw-r--r--drivers/input/serio/userio.c2
-rw-r--r--drivers/isdn/capi/capi.c6
-rw-r--r--drivers/isdn/divert/divert_procfs.c4
-rw-r--r--drivers/isdn/hardware/eicon/divamnt.c4
-rw-r--r--drivers/isdn/hardware/eicon/divasi.c10
-rw-r--r--drivers/isdn/hardware/eicon/divasmain.c4
-rw-r--r--drivers/isdn/hardware/eicon/divasproc.c2
-rw-r--r--drivers/isdn/hysdn/hysdn_proclog.c2
-rw-r--r--drivers/isdn/i4l/isdn_common.c12
-rw-r--r--drivers/isdn/i4l/isdn_ppp.c8
-rw-r--r--drivers/isdn/mISDN/timerdev.c4
-rw-r--r--drivers/leds/uleds.c2
-rw-r--r--drivers/macintosh/smu.c2
-rw-r--r--drivers/macintosh/via-pmu.c2
-rw-r--r--drivers/mailbox/mailbox-test.c2
-rw-r--r--drivers/md/dm-ioctl.c2
-rw-r--r--drivers/md/md.c6
-rw-r--r--drivers/media/cec/cec-api.c8
-rw-r--r--drivers/media/common/saa7146/saa7146_fops.c6
-rw-r--r--drivers/media/common/siano/smsdvb-debugfs.c2
-rw-r--r--drivers/media/common/videobuf2/videobuf2-core.c30
-rw-r--r--drivers/media/common/videobuf2/videobuf2-v4l2.c8
-rw-r--r--drivers/media/dvb-core/dmxdev.c14
-rw-r--r--drivers/media/dvb-core/dvb_ca_en50221.c4
-rw-r--r--drivers/media/dvb-core/dvb_frontend.c2
-rw-r--r--drivers/media/firewire/firedtv-ci.c2
-rw-r--r--drivers/media/i2c/saa6588.c2
-rw-r--r--drivers/media/media-devnode.c2
-rw-r--r--drivers/media/pci/bt8xx/bttv-driver.c22
-rw-r--r--drivers/media/pci/cx18/cx18-fileops.c16
-rw-r--r--drivers/media/pci/ddbridge/ddbridge-core.c4
-rw-r--r--drivers/media/pci/ivtv/ivtv-fileops.c16
-rw-r--r--drivers/media/pci/meye/meye.c2
-rw-r--r--drivers/media/pci/saa7164/saa7164-encoder.c6
-rw-r--r--drivers/media/pci/saa7164/saa7164-vbi.c2
-rw-r--r--drivers/media/pci/ttpci/av7110_av.c10
-rw-r--r--drivers/media/pci/ttpci/av7110_ca.c4
-rw-r--r--drivers/media/pci/zoran/zoran_driver.c16
-rw-r--r--drivers/media/platform/fsl-viu.c4
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc.c8
-rw-r--r--drivers/media/platform/soc_camera/soc_camera.c4
-rw-r--r--drivers/media/platform/vivid/vivid-radio-rx.c2
-rw-r--r--drivers/media/platform/vivid/vivid-radio-tx.c2
-rw-r--r--drivers/media/radio/radio-cadet.c4
-rw-r--r--drivers/media/radio/radio-si476x.c6
-rw-r--r--drivers/media/radio/radio-wl1273.c4
-rw-r--r--drivers/media/radio/si470x/radio-si470x-common.c4
-rw-r--r--drivers/media/radio/wl128x/fmdrv_v4l2.c2
-rw-r--r--drivers/media/rc/lirc_dev.c12
-rw-r--r--drivers/media/usb/cpia2/cpia2_core.c4
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-417.c4
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-video.c10
-rw-r--r--drivers/media/usb/gspca/gspca.c12
-rw-r--r--drivers/media/usb/hdpvr/hdpvr-video.c4
-rw-r--r--drivers/media/usb/pvrusb2/pvrusb2-v4l2.c6
-rw-r--r--drivers/media/usb/stkwebcam/stk-webcam.c4
-rw-r--r--drivers/media/usb/tm6000/tm6000-video.c14
-rw-r--r--drivers/media/v4l2-core/v4l2-ctrls.c2
-rw-r--r--drivers/media/v4l2-core/v4l2-dev.c2
-rw-r--r--drivers/media/v4l2-core/v4l2-mem2mem.c14
-rw-r--r--drivers/media/v4l2-core/v4l2-subdev.c4
-rw-r--r--drivers/media/v4l2-core/videobuf-core.c10
-rw-r--r--drivers/mfd/ab8500-debugfs.c2
-rw-r--r--drivers/misc/cxl/file.c4
-rw-r--r--drivers/misc/hpilo.c4
-rw-r--r--drivers/misc/lis3lv02d/lis3lv02d.c2
-rw-r--r--drivers/misc/mei/main.c12
-rw-r--r--drivers/misc/mic/cosm/cosm_scif_server.c16
-rw-r--r--drivers/misc/mic/cosm_client/cosm_scif_client.c4
-rw-r--r--drivers/misc/mic/scif/scif_api.c24
-rw-r--r--drivers/misc/mic/vop/vop_vringh.c8
-rw-r--r--drivers/misc/ocxl/file.c4
-rw-r--r--drivers/misc/phantom.c4
-rw-r--r--drivers/misc/vmw_vmci/vmci_host.c2
-rw-r--r--drivers/net/ieee802154/ca8210.c4
-rw-r--r--drivers/net/ppp/ppp_generic.c8
-rw-r--r--drivers/net/tap.c10
-rw-r--r--drivers/net/tun.c12
-rw-r--r--drivers/net/wireless/ralink/rt2x00/rt2x00debug.c2
-rw-r--r--drivers/pci/switch/switchtec.c6
-rw-r--r--drivers/platform/chrome/cros_ec_debugfs.c2
-rw-r--r--drivers/platform/goldfish/goldfish_pipe.c8
-rw-r--r--drivers/platform/x86/sony-laptop.c2
-rw-r--r--drivers/pps/pps.c2
-rw-r--r--drivers/ptp/ptp_chardev.c2
-rw-r--r--drivers/rapidio/devices/rio_mport_cdev.c2
-rw-r--r--drivers/rpmsg/qcom_smd.c2
-rw-r--r--drivers/rpmsg/rpmsg_char.c4
-rw-r--r--drivers/rtc/rtc-dev.c2
-rw-r--r--drivers/s390/block/dasd_eer.c2
-rw-r--r--drivers/s390/char/monreader.c4
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c2
-rw-r--r--drivers/scsi/mpt3sas/mpt3sas_ctl.c2
-rw-r--r--drivers/scsi/sg.c12
-rw-r--r--drivers/staging/comedi/comedi_fops.c4
-rw-r--r--drivers/staging/comedi/drivers/serial2002.c4
-rw-r--r--drivers/staging/fwserial/fwserial.c2
-rw-r--r--drivers/staging/greybus/tools/loopback_test.c4
-rw-r--r--drivers/staging/irda/net/af_irda.c14
-rw-r--r--drivers/staging/irda/net/irnet/irnet_ppp.c8
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c2
-rw-r--r--drivers/staging/media/bcm2048/radio-bcm2048.c2
-rw-r--r--drivers/staging/most/cdev/cdev.c4
-rw-r--r--drivers/staging/most/video/video.c2
-rw-r--r--drivers/staging/speakup/speakup_soft.c2
-rw-r--r--drivers/tty/n_gsm.c6
-rw-r--r--drivers/tty/n_hdlc.c8
-rw-r--r--drivers/tty/n_r3964.c4
-rw-r--r--drivers/tty/n_tty.c16
-rw-r--r--drivers/tty/pty.c4
-rw-r--r--drivers/tty/tty_io.c14
-rw-r--r--drivers/tty/tty_ldisc.c4
-rw-r--r--drivers/tty/vt/vc_screen.c2
-rw-r--r--drivers/uio/uio.c2
-rw-r--r--drivers/usb/class/cdc-wdm.c8
-rw-r--r--drivers/usb/class/usblp.c4
-rw-r--r--drivers/usb/class/usbtmc.c4
-rw-r--r--drivers/usb/core/devices.c2
-rw-r--r--drivers/usb/core/devio.c6
-rw-r--r--drivers/usb/gadget/function/f_fs.c8
-rw-r--r--drivers/usb/gadget/function/f_hid.c4
-rw-r--r--drivers/usb/gadget/function/f_printer.c4
-rw-r--r--drivers/usb/gadget/legacy/inode.c6
-rw-r--r--drivers/usb/misc/iowarrior.c8
-rw-r--r--drivers/usb/misc/ldusb.c6
-rw-r--r--drivers/usb/misc/legousbtower.c6
-rw-r--r--drivers/usb/mon/mon_bin.c2
-rw-r--r--drivers/vfio/virqfd.c8
-rw-r--r--drivers/vhost/net.c4
-rw-r--r--drivers/vhost/vhost.c10
-rw-r--r--drivers/virt/fsl_hypervisor.c2
-rw-r--r--drivers/xen/evtchn.c6
-rw-r--r--drivers/xen/mcelog.c2
-rw-r--r--drivers/xen/pvcalls-front.c14
-rw-r--r--drivers/xen/xenbus/xenbus_dev_frontend.c2
-rw-r--r--fs/cachefiles/daemon.c6
-rw-r--r--fs/coda/psdev.c4
-rw-r--r--fs/debugfs/file.c2
-rw-r--r--fs/dlm/plock.c2
-rw-r--r--fs/dlm/user.c2
-rw-r--r--fs/ecryptfs/miscdev.c2
-rw-r--r--fs/eventfd.c18
-rw-r--r--fs/eventpoll.c22
-rw-r--r--fs/fcntl.c12
-rw-r--r--fs/fuse/dev.c8
-rw-r--r--fs/fuse/file.c2
-rw-r--r--fs/kernfs/file.c4
-rw-r--r--fs/notify/fanotify/fanotify_user.c2
-rw-r--r--fs/notify/inotify/inotify_user.c2
-rw-r--r--fs/ocfs2/dlmfs/dlmfs.c6
-rw-r--r--fs/orangefs/devorangefs-req.c2
-rw-r--r--fs/pipe.c22
-rw-r--r--fs/proc/kmsg.c2
-rw-r--r--fs/proc/proc_sysctl.c4
-rw-r--r--fs/proc_namespace.c4
-rw-r--r--fs/select.c10
-rw-r--r--fs/signalfd.c4
-rw-r--r--fs/timerfd.c2
-rw-r--r--fs/userfaultfd.c16
-rw-r--r--include/linux/scif.h16
-rw-r--r--include/media/videobuf2-core.h6
-rw-r--r--include/net/inet_connection_sock.h2
-rw-r--r--ipc/mqueue.c4
-rw-r--r--kernel/events/core.c2
-rw-r--r--kernel/events/ring_buffer.c2
-rw-r--r--kernel/printk/printk.c6
-rw-r--r--kernel/relay.c4
-rw-r--r--kernel/time/posix-clock.c2
-rw-r--r--kernel/trace/ring_buffer.c4
-rw-r--r--kernel/trace/trace.c4
-rw-r--r--mm/memcontrol.c4
-rw-r--r--mm/swapfile.c4
-rw-r--r--net/9p/trans_fd.c26
-rw-r--r--net/atm/common.c8
-rw-r--r--net/batman-adv/icmp_socket.c2
-rw-r--r--net/batman-adv/log.c2
-rw-r--r--net/bluetooth/af_bluetooth.c16
-rw-r--r--net/caif/caif_socket.c12
-rw-r--r--net/core/datagram.c16
-rw-r--r--net/core/sock.c10
-rw-r--r--net/core/stream.c4
-rw-r--r--net/dccp/proto.c12
-rw-r--r--net/decnet/af_decnet.c2
-rw-r--r--net/ipv4/af_inet.c2
-rw-r--r--net/ipv4/tcp.c34
-rw-r--r--net/ipv4/tcp_input.c2
-rw-r--r--net/ipv4/udp.c6
-rw-r--r--net/iucv/af_iucv.c18
-rw-r--r--net/kcm/kcmsock.c6
-rw-r--r--net/nfc/llcp_sock.c16
-rw-r--r--net/packet/af_packet.c4
-rw-r--r--net/phonet/socket.c10
-rw-r--r--net/rds/af_rds.c16
-rw-r--r--net/rfkill/core.c4
-rw-r--r--net/rxrpc/af_rxrpc.c4
-rw-r--r--net/sctp/socket.c20
-rw-r--r--net/smc/af_smc.c24
-rw-r--r--net/smc/smc_rx.c4
-rw-r--r--net/smc/smc_tx.c4
-rw-r--r--net/sunrpc/cache.c4
-rw-r--r--net/sunrpc/rpc_pipe.c6
-rw-r--r--net/tipc/socket.c22
-rw-r--r--net/unix/af_unix.c40
-rw-r--r--net/vmw_vsock/af_vsock.c30
-rw-r--r--security/apparmor/apparmorfs.c2
-rw-r--r--security/tomoyo/audit.c6
-rw-r--r--security/tomoyo/common.c14
-rw-r--r--security/tomoyo/securityfs_if.c4
-rw-r--r--sound/core/compress_offload.c10
-rw-r--r--sound/core/control.c2
-rw-r--r--sound/core/info.c4
-rw-r--r--sound/core/init.c2
-rw-r--r--sound/core/oss/pcm_oss.c4
-rw-r--r--sound/core/pcm_native.c14
-rw-r--r--sound/core/rawmidi.c4
-rw-r--r--sound/core/seq/oss/seq_oss_rw.c4
-rw-r--r--sound/core/seq/seq_clientmgr.c4
-rw-r--r--sound/core/timer.c4
-rw-r--r--sound/firewire/bebob/bebob_hwdep.c2
-rw-r--r--sound/firewire/dice/dice-hwdep.c2
-rw-r--r--sound/firewire/digi00x/digi00x-hwdep.c2
-rw-r--r--sound/firewire/fireface/ff-hwdep.c2
-rw-r--r--sound/firewire/fireworks/fireworks_hwdep.c4
-rw-r--r--sound/firewire/motu/motu-hwdep.c4
-rw-r--r--sound/firewire/oxfw/oxfw-hwdep.c2
-rw-r--r--sound/firewire/tascam/tascam-hwdep.c2
-rw-r--r--sound/oss/dmasound/dmasound_core.c2
-rw-r--r--sound/usb/mixer_quirks.c2
-rw-r--r--sound/usb/usx2y/us122l.c4
-rw-r--r--sound/usb/usx2y/usX2Yhwdep.c4
-rw-r--r--virt/kvm/eventfd.c8
297 files changed, 913 insertions, 913 deletions
diff --git a/arch/cris/arch-v10/drivers/gpio.c b/arch/cris/arch-v10/drivers/gpio.c
index a2986c60aaac..cd0e05d89d42 100644
--- a/arch/cris/arch-v10/drivers/gpio.c
+++ b/arch/cris/arch-v10/drivers/gpio.c
@@ -173,7 +173,7 @@ static __poll_t gpio_poll(struct file *file, poll_table *wait)
173 173
174 if ((data & priv->highalarm) || 174 if ((data & priv->highalarm) ||
175 (~data & priv->lowalarm)) { 175 (~data & priv->lowalarm)) {
176 mask = POLLIN|POLLRDNORM; 176 mask = EPOLLIN|EPOLLRDNORM;
177 } 177 }
178 178
179out: 179out:
diff --git a/arch/cris/arch-v10/drivers/sync_serial.c b/arch/cris/arch-v10/drivers/sync_serial.c
index 177843c64071..ed1a568a7217 100644
--- a/arch/cris/arch-v10/drivers/sync_serial.c
+++ b/arch/cris/arch-v10/drivers/sync_serial.c
@@ -666,16 +666,16 @@ static __poll_t sync_serial_poll(struct file *file, poll_table *wait)
666 poll_wait(file, &port->in_wait_q, wait); 666 poll_wait(file, &port->in_wait_q, wait);
667 /* Some room to write */ 667 /* Some room to write */
668 if (port->out_count < OUT_BUFFER_SIZE) 668 if (port->out_count < OUT_BUFFER_SIZE)
669 mask |= POLLOUT | POLLWRNORM; 669 mask |= EPOLLOUT | EPOLLWRNORM;
670 /* At least an inbufchunk of data */ 670 /* At least an inbufchunk of data */
671 if (sync_data_avail(port) >= port->inbufchunk) 671 if (sync_data_avail(port) >= port->inbufchunk)
672 mask |= POLLIN | POLLRDNORM; 672 mask |= EPOLLIN | EPOLLRDNORM;
673 673
674 DEBUGPOLL(if (mask != prev_mask) 674 DEBUGPOLL(if (mask != prev_mask)
675 printk(KERN_DEBUG "sync_serial_poll: mask 0x%08X %s %s\n", 675 printk(KERN_DEBUG "sync_serial_poll: mask 0x%08X %s %s\n",
676 mask, 676 mask,
677 mask & POLLOUT ? "POLLOUT" : "", 677 mask & EPOLLOUT ? "POLLOUT" : "",
678 mask & POLLIN ? "POLLIN" : ""); 678 mask & EPOLLIN ? "POLLIN" : "");
679 prev_mask = mask; 679 prev_mask = mask;
680 ); 680 );
681 return mask; 681 return mask;
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c
index e20e0b9a3a5c..1b0ce8a8af16 100644
--- a/arch/cris/arch-v32/drivers/sync_serial.c
+++ b/arch/cris/arch-v32/drivers/sync_serial.c
@@ -574,24 +574,24 @@ static __poll_t sync_serial_poll(struct file *file, poll_table *wait)
574 574
575 /* No active transfer, descriptors are available */ 575 /* No active transfer, descriptors are available */
576 if (port->output && !port->tr_running) 576 if (port->output && !port->tr_running)
577 mask |= POLLOUT | POLLWRNORM; 577 mask |= EPOLLOUT | EPOLLWRNORM;
578 578
579 /* Descriptor and buffer space available. */ 579 /* Descriptor and buffer space available. */
580 if (port->output && 580 if (port->output &&
581 port->active_tr_descr != port->catch_tr_descr && 581 port->active_tr_descr != port->catch_tr_descr &&
582 port->out_buf_count < OUT_BUFFER_SIZE) 582 port->out_buf_count < OUT_BUFFER_SIZE)
583 mask |= POLLOUT | POLLWRNORM; 583 mask |= EPOLLOUT | EPOLLWRNORM;
584 584
585 /* At least an inbufchunk of data */ 585 /* At least an inbufchunk of data */
586 if (port->input && sync_data_avail(port) >= port->inbufchunk) 586 if (port->input && sync_data_avail(port) >= port->inbufchunk)
587 mask |= POLLIN | POLLRDNORM; 587 mask |= EPOLLIN | EPOLLRDNORM;
588 588
589 DEBUGPOLL( 589 DEBUGPOLL(
590 if (mask != prev_mask) 590 if (mask != prev_mask)
591 pr_info("sync_serial_poll: mask 0x%08X %s %s\n", 591 pr_info("sync_serial_poll: mask 0x%08X %s %s\n",
592 mask, 592 mask,
593 mask & POLLOUT ? "POLLOUT" : "", 593 mask & EPOLLOUT ? "POLLOUT" : "",
594 mask & POLLIN ? "POLLIN" : ""); 594 mask & EPOLLIN ? "POLLIN" : "");
595 prev_mask = mask; 595 prev_mask = mask;
596 ); 596 );
597 return mask; 597 return mask;
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 858602494096..8fb280e33114 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -1670,7 +1670,7 @@ pfm_poll(struct file *filp, poll_table * wait)
1670 PROTECT_CTX(ctx, flags); 1670 PROTECT_CTX(ctx, flags);
1671 1671
1672 if (PFM_CTXQ_EMPTY(ctx) == 0) 1672 if (PFM_CTXQ_EMPTY(ctx) == 0)
1673 mask = POLLIN | POLLRDNORM; 1673 mask = EPOLLIN | EPOLLRDNORM;
1674 1674
1675 UNPROTECT_CTX(ctx, flags); 1675 UNPROTECT_CTX(ctx, flags);
1676 1676
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c
index bbb0f4770c0d..18c509c59f33 100644
--- a/arch/mips/kernel/rtlx.c
+++ b/arch/mips/kernel/rtlx.c
@@ -349,11 +349,11 @@ static __poll_t file_poll(struct file *file, poll_table *wait)
349 349
350 /* data available to read? */ 350 /* data available to read? */
351 if (rtlx_read_poll(minor, 0)) 351 if (rtlx_read_poll(minor, 0))
352 mask |= POLLIN | POLLRDNORM; 352 mask |= EPOLLIN | EPOLLRDNORM;
353 353
354 /* space to write */ 354 /* space to write */
355 if (rtlx_write_poll(minor)) 355 if (rtlx_write_poll(minor))
356 mask |= POLLOUT | POLLWRNORM; 356 mask |= EPOLLOUT | EPOLLWRNORM;
357 357
358 return mask; 358 return mask;
359} 359}
diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c
index fc600a8b1e77..f915db93cd42 100644
--- a/arch/powerpc/kernel/rtasd.c
+++ b/arch/powerpc/kernel/rtasd.c
@@ -392,7 +392,7 @@ static __poll_t rtas_log_poll(struct file *file, poll_table * wait)
392{ 392{
393 poll_wait(file, &rtas_log_wait, wait); 393 poll_wait(file, &rtas_log_wait, wait);
394 if (rtas_log_size) 394 if (rtas_log_size)
395 return POLLIN | POLLRDNORM; 395 return EPOLLIN | EPOLLRDNORM;
396 return 0; 396 return 0;
397} 397}
398 398
diff --git a/arch/powerpc/platforms/cell/spufs/backing_ops.c b/arch/powerpc/platforms/cell/spufs/backing_ops.c
index 1a9a756b0b2f..857580a78bbd 100644
--- a/arch/powerpc/platforms/cell/spufs/backing_ops.c
+++ b/arch/powerpc/platforms/cell/spufs/backing_ops.c
@@ -101,9 +101,9 @@ static __poll_t spu_backing_mbox_stat_poll(struct spu_context *ctx,
101 but first mark any pending interrupts as done so 101 but first mark any pending interrupts as done so
102 we don't get woken up unnecessarily */ 102 we don't get woken up unnecessarily */
103 103
104 if (events & (POLLIN | POLLRDNORM)) { 104 if (events & (EPOLLIN | EPOLLRDNORM)) {
105 if (stat & 0xff0000) 105 if (stat & 0xff0000)
106 ret |= POLLIN | POLLRDNORM; 106 ret |= EPOLLIN | EPOLLRDNORM;
107 else { 107 else {
108 ctx->csa.priv1.int_stat_class2_RW &= 108 ctx->csa.priv1.int_stat_class2_RW &=
109 ~CLASS2_MAILBOX_INTR; 109 ~CLASS2_MAILBOX_INTR;
@@ -111,9 +111,9 @@ static __poll_t spu_backing_mbox_stat_poll(struct spu_context *ctx,
111 CLASS2_ENABLE_MAILBOX_INTR; 111 CLASS2_ENABLE_MAILBOX_INTR;
112 } 112 }
113 } 113 }
114 if (events & (POLLOUT | POLLWRNORM)) { 114 if (events & (EPOLLOUT | EPOLLWRNORM)) {
115 if (stat & 0x00ff00) 115 if (stat & 0x00ff00)
116 ret = POLLOUT | POLLWRNORM; 116 ret = EPOLLOUT | EPOLLWRNORM;
117 else { 117 else {
118 ctx->csa.priv1.int_stat_class2_RW &= 118 ctx->csa.priv1.int_stat_class2_RW &=
119 ~CLASS2_MAILBOX_THRESHOLD_INTR; 119 ~CLASS2_MAILBOX_THRESHOLD_INTR;
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index c1be486da899..469bdd0b748f 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -774,7 +774,7 @@ static __poll_t spufs_ibox_poll(struct file *file, poll_table *wait)
774 * that poll should not sleep. Will be fixed later. 774 * that poll should not sleep. Will be fixed later.
775 */ 775 */
776 mutex_lock(&ctx->state_mutex); 776 mutex_lock(&ctx->state_mutex);
777 mask = ctx->ops->mbox_stat_poll(ctx, POLLIN | POLLRDNORM); 777 mask = ctx->ops->mbox_stat_poll(ctx, EPOLLIN | EPOLLRDNORM);
778 spu_release(ctx); 778 spu_release(ctx);
779 779
780 return mask; 780 return mask;
@@ -910,7 +910,7 @@ static __poll_t spufs_wbox_poll(struct file *file, poll_table *wait)
910 * that poll should not sleep. Will be fixed later. 910 * that poll should not sleep. Will be fixed later.
911 */ 911 */
912 mutex_lock(&ctx->state_mutex); 912 mutex_lock(&ctx->state_mutex);
913 mask = ctx->ops->mbox_stat_poll(ctx, POLLOUT | POLLWRNORM); 913 mask = ctx->ops->mbox_stat_poll(ctx, EPOLLOUT | EPOLLWRNORM);
914 spu_release(ctx); 914 spu_release(ctx);
915 915
916 return mask; 916 return mask;
@@ -1710,9 +1710,9 @@ static __poll_t spufs_mfc_poll(struct file *file,poll_table *wait)
1710 1710
1711 mask = 0; 1711 mask = 0;
1712 if (free_elements & 0xffff) 1712 if (free_elements & 0xffff)
1713 mask |= POLLOUT | POLLWRNORM; 1713 mask |= EPOLLOUT | EPOLLWRNORM;
1714 if (tagstatus & ctx->tagwait) 1714 if (tagstatus & ctx->tagwait)
1715 mask |= POLLIN | POLLRDNORM; 1715 mask |= EPOLLIN | EPOLLRDNORM;
1716 1716
1717 pr_debug("%s: free %d tagstatus %d tagwait %d\n", __func__, 1717 pr_debug("%s: free %d tagstatus %d tagwait %d\n", __func__,
1718 free_elements, tagstatus, ctx->tagwait); 1718 free_elements, tagstatus, ctx->tagwait);
@@ -2469,7 +2469,7 @@ static __poll_t spufs_switch_log_poll(struct file *file, poll_table *wait)
2469 return rc; 2469 return rc;
2470 2470
2471 if (spufs_switch_log_used(ctx) > 0) 2471 if (spufs_switch_log_used(ctx) > 0)
2472 mask |= POLLIN; 2472 mask |= EPOLLIN;
2473 2473
2474 spu_release(ctx); 2474 spu_release(ctx);
2475 2475
diff --git a/arch/powerpc/platforms/cell/spufs/hw_ops.c b/arch/powerpc/platforms/cell/spufs/hw_ops.c
index fff58198b5b6..ae9d24d31eed 100644
--- a/arch/powerpc/platforms/cell/spufs/hw_ops.c
+++ b/arch/powerpc/platforms/cell/spufs/hw_ops.c
@@ -70,17 +70,17 @@ static __poll_t spu_hw_mbox_stat_poll(struct spu_context *ctx, __poll_t events)
70 but first mark any pending interrupts as done so 70 but first mark any pending interrupts as done so
71 we don't get woken up unnecessarily */ 71 we don't get woken up unnecessarily */
72 72
73 if (events & (POLLIN | POLLRDNORM)) { 73 if (events & (EPOLLIN | EPOLLRDNORM)) {
74 if (stat & 0xff0000) 74 if (stat & 0xff0000)
75 ret |= POLLIN | POLLRDNORM; 75 ret |= EPOLLIN | EPOLLRDNORM;
76 else { 76 else {
77 spu_int_stat_clear(spu, 2, CLASS2_MAILBOX_INTR); 77 spu_int_stat_clear(spu, 2, CLASS2_MAILBOX_INTR);
78 spu_int_mask_or(spu, 2, CLASS2_ENABLE_MAILBOX_INTR); 78 spu_int_mask_or(spu, 2, CLASS2_ENABLE_MAILBOX_INTR);
79 } 79 }
80 } 80 }
81 if (events & (POLLOUT | POLLWRNORM)) { 81 if (events & (EPOLLOUT | EPOLLWRNORM)) {
82 if (stat & 0x00ff00) 82 if (stat & 0x00ff00)
83 ret = POLLOUT | POLLWRNORM; 83 ret = EPOLLOUT | EPOLLWRNORM;
84 else { 84 else {
85 spu_int_stat_clear(spu, 2, 85 spu_int_stat_clear(spu, 2,
86 CLASS2_MAILBOX_THRESHOLD_INTR); 86 CLASS2_MAILBOX_THRESHOLD_INTR);
diff --git a/arch/powerpc/platforms/powernv/opal-prd.c b/arch/powerpc/platforms/powernv/opal-prd.c
index c18de0a9b1bd..4070bb4e9da4 100644
--- a/arch/powerpc/platforms/powernv/opal-prd.c
+++ b/arch/powerpc/platforms/powernv/opal-prd.c
@@ -153,7 +153,7 @@ static __poll_t opal_prd_poll(struct file *file,
153 poll_wait(file, &opal_prd_msg_wait, wait); 153 poll_wait(file, &opal_prd_msg_wait, wait);
154 154
155 if (!opal_msg_queue_empty()) 155 if (!opal_msg_queue_empty())
156 return POLLIN | POLLRDNORM; 156 return EPOLLIN | EPOLLRDNORM;
157 157
158 return 0; 158 return 0;
159} 159}
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index dc0ca8e29c75..dfcbe6924eaf 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -1515,7 +1515,7 @@ static __poll_t do_poll(struct file *fp, poll_table *wait)
1515 return 0; 1515 return 0;
1516 poll_wait(fp, &apm_waitqueue, wait); 1516 poll_wait(fp, &apm_waitqueue, wait);
1517 if (!queue_empty(as)) 1517 if (!queue_empty(as))
1518 return POLLIN | POLLRDNORM; 1518 return EPOLLIN | EPOLLRDNORM;
1519 return 0; 1519 return 0;
1520} 1520}
1521 1521
diff --git a/arch/x86/kernel/cpu/mcheck/dev-mcelog.c b/arch/x86/kernel/cpu/mcheck/dev-mcelog.c
index 213e8c2ca702..97685a0c3175 100644
--- a/arch/x86/kernel/cpu/mcheck/dev-mcelog.c
+++ b/arch/x86/kernel/cpu/mcheck/dev-mcelog.c
@@ -247,9 +247,9 @@ static __poll_t mce_chrdev_poll(struct file *file, poll_table *wait)
247{ 247{
248 poll_wait(file, &mce_chrdev_wait, wait); 248 poll_wait(file, &mce_chrdev_wait, wait);
249 if (READ_ONCE(mcelog.next)) 249 if (READ_ONCE(mcelog.next))
250 return POLLIN | POLLRDNORM; 250 return EPOLLIN | EPOLLRDNORM;
251 if (!mce_apei_read_done && apei_check_mce()) 251 if (!mce_apei_read_done && apei_check_mce())
252 return POLLIN | POLLRDNORM; 252 return EPOLLIN | EPOLLRDNORM;
253 return 0; 253 return 0;
254} 254}
255 255
diff --git a/block/bsg.c b/block/bsg.c
index 2e2c1e222209..06dc96e1f670 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -849,9 +849,9 @@ static __poll_t bsg_poll(struct file *file, poll_table *wait)
849 849
850 spin_lock_irq(&bd->lock); 850 spin_lock_irq(&bd->lock);
851 if (!list_empty(&bd->done_list)) 851 if (!list_empty(&bd->done_list))
852 mask |= POLLIN | POLLRDNORM; 852 mask |= EPOLLIN | EPOLLRDNORM;
853 if (bd->queued_cmds < bd->max_queue) 853 if (bd->queued_cmds < bd->max_queue)
854 mask |= POLLOUT; 854 mask |= EPOLLOUT;
855 spin_unlock_irq(&bd->lock); 855 spin_unlock_irq(&bd->lock);
856 856
857 return mask; 857 return mask;
diff --git a/crypto/af_alg.c b/crypto/af_alg.c
index 0f8d8d5523c3..c49766b03165 100644
--- a/crypto/af_alg.c
+++ b/crypto/af_alg.c
@@ -735,9 +735,9 @@ void af_alg_wmem_wakeup(struct sock *sk)
735 rcu_read_lock(); 735 rcu_read_lock();
736 wq = rcu_dereference(sk->sk_wq); 736 wq = rcu_dereference(sk->sk_wq);
737 if (skwq_has_sleeper(wq)) 737 if (skwq_has_sleeper(wq))
738 wake_up_interruptible_sync_poll(&wq->wait, POLLIN | 738 wake_up_interruptible_sync_poll(&wq->wait, EPOLLIN |
739 POLLRDNORM | 739 EPOLLRDNORM |
740 POLLRDBAND); 740 EPOLLRDBAND);
741 sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN); 741 sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN);
742 rcu_read_unlock(); 742 rcu_read_unlock();
743} 743}
@@ -800,9 +800,9 @@ void af_alg_data_wakeup(struct sock *sk)
800 rcu_read_lock(); 800 rcu_read_lock();
801 wq = rcu_dereference(sk->sk_wq); 801 wq = rcu_dereference(sk->sk_wq);
802 if (skwq_has_sleeper(wq)) 802 if (skwq_has_sleeper(wq))
803 wake_up_interruptible_sync_poll(&wq->wait, POLLOUT | 803 wake_up_interruptible_sync_poll(&wq->wait, EPOLLOUT |
804 POLLRDNORM | 804 EPOLLRDNORM |
805 POLLRDBAND); 805 EPOLLRDBAND);
806 sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT); 806 sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT);
807 rcu_read_unlock(); 807 rcu_read_unlock();
808} 808}
@@ -1076,10 +1076,10 @@ __poll_t af_alg_poll(struct file *file, struct socket *sock,
1076 mask = 0; 1076 mask = 0;
1077 1077
1078 if (!ctx->more || ctx->used) 1078 if (!ctx->more || ctx->used)
1079 mask |= POLLIN | POLLRDNORM; 1079 mask |= EPOLLIN | EPOLLRDNORM;
1080 1080
1081 if (af_alg_writable(sk)) 1081 if (af_alg_writable(sk))
1082 mask |= POLLOUT | POLLWRNORM | POLLWRBAND; 1082 mask |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
1083 1083
1084 return mask; 1084 return mask;
1085} 1085}
diff --git a/drivers/acpi/acpi_dbg.c b/drivers/acpi/acpi_dbg.c
index 2ff5c8c04e3b..f21c99ec46ee 100644
--- a/drivers/acpi/acpi_dbg.c
+++ b/drivers/acpi/acpi_dbg.c
@@ -724,9 +724,9 @@ static __poll_t acpi_aml_poll(struct file *file, poll_table *wait)
724 724
725 poll_wait(file, &acpi_aml_io.wait, wait); 725 poll_wait(file, &acpi_aml_io.wait, wait);
726 if (acpi_aml_user_readable()) 726 if (acpi_aml_user_readable())
727 masks |= POLLIN | POLLRDNORM; 727 masks |= EPOLLIN | EPOLLRDNORM;
728 if (acpi_aml_user_writable()) 728 if (acpi_aml_user_writable())
729 masks |= POLLOUT | POLLWRNORM; 729 masks |= EPOLLOUT | EPOLLWRNORM;
730 730
731 return masks; 731 return masks;
732} 732}
diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index d21040c5d343..15e3d3c2260d 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -4371,7 +4371,7 @@ static int binder_thread_release(struct binder_proc *proc,
4371 */ 4371 */
4372 if ((thread->looper & BINDER_LOOPER_STATE_POLL) && 4372 if ((thread->looper & BINDER_LOOPER_STATE_POLL) &&
4373 waitqueue_active(&thread->wait)) { 4373 waitqueue_active(&thread->wait)) {
4374 wake_up_poll(&thread->wait, POLLHUP | POLLFREE); 4374 wake_up_poll(&thread->wait, EPOLLHUP | POLLFREE);
4375 } 4375 }
4376 4376
4377 binder_inner_proc_unlock(thread->proc); 4377 binder_inner_proc_unlock(thread->proc);
@@ -4401,7 +4401,7 @@ static __poll_t binder_poll(struct file *filp,
4401 poll_wait(filp, &thread->wait, wait); 4401 poll_wait(filp, &thread->wait, wait);
4402 4402
4403 if (binder_has_work(thread, wait_for_proc_work)) 4403 if (binder_has_work(thread, wait_for_proc_work))
4404 return POLLIN; 4404 return EPOLLIN;
4405 4405
4406 return 0; 4406 return 0;
4407} 4407}
diff --git a/drivers/bluetooth/hci_vhci.c b/drivers/bluetooth/hci_vhci.c
index 0521748a1972..22f9145a426f 100644
--- a/drivers/bluetooth/hci_vhci.c
+++ b/drivers/bluetooth/hci_vhci.c
@@ -306,9 +306,9 @@ static __poll_t vhci_poll(struct file *file, poll_table *wait)
306 poll_wait(file, &data->read_wait, wait); 306 poll_wait(file, &data->read_wait, wait);
307 307
308 if (!skb_queue_empty(&data->readq)) 308 if (!skb_queue_empty(&data->readq))
309 return POLLIN | POLLRDNORM; 309 return EPOLLIN | EPOLLRDNORM;
310 310
311 return POLLOUT | POLLWRNORM; 311 return EPOLLOUT | EPOLLWRNORM;
312} 312}
313 313
314static void vhci_open_timeout(struct work_struct *work) 314static void vhci_open_timeout(struct work_struct *work)
diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c
index a2a1c1478cd0..a5e2f9e557ea 100644
--- a/drivers/char/apm-emulation.c
+++ b/drivers/char/apm-emulation.c
@@ -241,7 +241,7 @@ static __poll_t apm_poll(struct file *fp, poll_table * wait)
241 struct apm_user *as = fp->private_data; 241 struct apm_user *as = fp->private_data;
242 242
243 poll_wait(fp, &apm_waitqueue, wait); 243 poll_wait(fp, &apm_waitqueue, wait);
244 return queue_empty(&as->queue) ? 0 : POLLIN | POLLRDNORM; 244 return queue_empty(&as->queue) ? 0 : EPOLLIN | EPOLLRDNORM;
245} 245}
246 246
247/* 247/*
diff --git a/drivers/char/dsp56k.c b/drivers/char/dsp56k.c
index 2f92cc46698b..06749e295ada 100644
--- a/drivers/char/dsp56k.c
+++ b/drivers/char/dsp56k.c
@@ -414,7 +414,7 @@ static __poll_t dsp56k_poll(struct file *file, poll_table *wait)
414 { 414 {
415 case DSP56K_DEV_56001: 415 case DSP56K_DEV_56001:
416 /* poll_wait(file, ???, wait); */ 416 /* poll_wait(file, ???, wait); */
417 return POLLIN | POLLRDNORM | POLLOUT; 417 return EPOLLIN | EPOLLRDNORM | EPOLLOUT;
418 418
419 default: 419 default:
420 printk("DSP56k driver: Unknown minor device: %d\n", dev); 420 printk("DSP56k driver: Unknown minor device: %d\n", dev);
diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c
index 2697c22e3be2..f882460b5a44 100644
--- a/drivers/char/dtlk.c
+++ b/drivers/char/dtlk.c
@@ -62,7 +62,7 @@
62#include <linux/uaccess.h> /* for get_user, etc. */ 62#include <linux/uaccess.h> /* for get_user, etc. */
63#include <linux/wait.h> /* for wait_queue */ 63#include <linux/wait.h> /* for wait_queue */
64#include <linux/init.h> /* for __init, module_{init,exit} */ 64#include <linux/init.h> /* for __init, module_{init,exit} */
65#include <linux/poll.h> /* for POLLIN, etc. */ 65#include <linux/poll.h> /* for EPOLLIN, etc. */
66#include <linux/dtlk.h> /* local header file for DoubleTalk values */ 66#include <linux/dtlk.h> /* local header file for DoubleTalk values */
67 67
68#ifdef TRACING 68#ifdef TRACING
@@ -244,11 +244,11 @@ static __poll_t dtlk_poll(struct file *file, poll_table * wait)
244 244
245 if (dtlk_has_indexing && dtlk_readable()) { 245 if (dtlk_has_indexing && dtlk_readable()) {
246 del_timer(&dtlk_timer); 246 del_timer(&dtlk_timer);
247 mask = POLLIN | POLLRDNORM; 247 mask = EPOLLIN | EPOLLRDNORM;
248 } 248 }
249 if (dtlk_writeable()) { 249 if (dtlk_writeable()) {
250 del_timer(&dtlk_timer); 250 del_timer(&dtlk_timer);
251 mask |= POLLOUT | POLLWRNORM; 251 mask |= EPOLLOUT | EPOLLWRNORM;
252 } 252 }
253 /* there are no exception conditions */ 253 /* there are no exception conditions */
254 254
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index dbed4953f86c..be426eb2a353 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -359,7 +359,7 @@ static __poll_t hpet_poll(struct file *file, poll_table * wait)
359 spin_unlock_irq(&hpet_lock); 359 spin_unlock_irq(&hpet_lock);
360 360
361 if (v != 0) 361 if (v != 0)
362 return POLLIN | POLLRDNORM; 362 return EPOLLIN | EPOLLRDNORM;
363 363
364 return 0; 364 return 0;
365} 365}
diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c
index 7992c870b0a2..c95b93b7598b 100644
--- a/drivers/char/ipmi/bt-bmc.c
+++ b/drivers/char/ipmi/bt-bmc.c
@@ -349,10 +349,10 @@ static __poll_t bt_bmc_poll(struct file *file, poll_table *wait)
349 ctrl = bt_inb(bt_bmc, BT_CTRL); 349 ctrl = bt_inb(bt_bmc, BT_CTRL);
350 350
351 if (ctrl & BT_CTRL_H2B_ATN) 351 if (ctrl & BT_CTRL_H2B_ATN)
352 mask |= POLLIN; 352 mask |= EPOLLIN;
353 353
354 if (!(ctrl & (BT_CTRL_H_BUSY | BT_CTRL_B2H_ATN))) 354 if (!(ctrl & (BT_CTRL_H_BUSY | BT_CTRL_B2H_ATN)))
355 mask |= POLLOUT; 355 mask |= EPOLLOUT;
356 356
357 return mask; 357 return mask;
358} 358}
diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c
index a011a7739f5e..5f1bc9174735 100644
--- a/drivers/char/ipmi/ipmi_devintf.c
+++ b/drivers/char/ipmi/ipmi_devintf.c
@@ -89,7 +89,7 @@ static __poll_t ipmi_poll(struct file *file, poll_table *wait)
89 spin_lock_irqsave(&priv->recv_msg_lock, flags); 89 spin_lock_irqsave(&priv->recv_msg_lock, flags);
90 90
91 if (!list_empty(&(priv->recv_msgs))) 91 if (!list_empty(&(priv->recv_msgs)))
92 mask |= (POLLIN | POLLRDNORM); 92 mask |= (EPOLLIN | EPOLLRDNORM);
93 93
94 spin_unlock_irqrestore(&priv->recv_msg_lock, flags); 94 spin_unlock_irqrestore(&priv->recv_msg_lock, flags);
95 95
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c
index 34bc1f3ca414..a58acdcf7414 100644
--- a/drivers/char/ipmi/ipmi_watchdog.c
+++ b/drivers/char/ipmi/ipmi_watchdog.c
@@ -895,7 +895,7 @@ static __poll_t ipmi_poll(struct file *file, poll_table *wait)
895 895
896 spin_lock(&ipmi_read_lock); 896 spin_lock(&ipmi_read_lock);
897 if (data_to_read) 897 if (data_to_read)
898 mask |= (POLLIN | POLLRDNORM); 898 mask |= (EPOLLIN | EPOLLRDNORM);
899 spin_unlock(&ipmi_read_lock); 899 spin_unlock(&ipmi_read_lock);
900 900
901 return mask; 901 return mask;
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c
index 819fe37a3683..f80965407d3c 100644
--- a/drivers/char/pcmcia/cm4040_cs.c
+++ b/drivers/char/pcmcia/cm4040_cs.c
@@ -423,9 +423,9 @@ static __poll_t cm4040_poll(struct file *filp, poll_table *wait)
423 poll_wait(filp, &dev->poll_wait, wait); 423 poll_wait(filp, &dev->poll_wait, wait);
424 424
425 if (test_and_clear_bit(BS_READABLE, &dev->buffer_status)) 425 if (test_and_clear_bit(BS_READABLE, &dev->buffer_status))
426 mask |= POLLIN | POLLRDNORM; 426 mask |= EPOLLIN | EPOLLRDNORM;
427 if (test_and_clear_bit(BS_WRITABLE, &dev->buffer_status)) 427 if (test_and_clear_bit(BS_WRITABLE, &dev->buffer_status))
428 mask |= POLLOUT | POLLWRNORM; 428 mask |= EPOLLOUT | EPOLLWRNORM;
429 429
430 DEBUGP(2, dev, "<- cm4040_poll(%u)\n", mask); 430 DEBUGP(2, dev, "<- cm4040_poll(%u)\n", mask);
431 431
diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c
index 7a56d1a13ec3..1ae77b41050a 100644
--- a/drivers/char/ppdev.c
+++ b/drivers/char/ppdev.c
@@ -776,7 +776,7 @@ static __poll_t pp_poll(struct file *file, poll_table *wait)
776 776
777 poll_wait(file, &pp->irq_wait, wait); 777 poll_wait(file, &pp->irq_wait, wait);
778 if (atomic_read(&pp->irqc)) 778 if (atomic_read(&pp->irqc))
779 mask |= POLLIN | POLLRDNORM; 779 mask |= EPOLLIN | EPOLLRDNORM;
780 780
781 return mask; 781 return mask;
782} 782}
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 80f2c326db47..e5b3d3ba4660 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1793,9 +1793,9 @@ random_poll(struct file *file, poll_table * wait)
1793 poll_wait(file, &random_write_wait, wait); 1793 poll_wait(file, &random_write_wait, wait);
1794 mask = 0; 1794 mask = 0;
1795 if (ENTROPY_BITS(&input_pool) >= random_read_wakeup_bits) 1795 if (ENTROPY_BITS(&input_pool) >= random_read_wakeup_bits)
1796 mask |= POLLIN | POLLRDNORM; 1796 mask |= EPOLLIN | EPOLLRDNORM;
1797 if (ENTROPY_BITS(&input_pool) < random_write_wakeup_bits) 1797 if (ENTROPY_BITS(&input_pool) < random_write_wakeup_bits)
1798 mask |= POLLOUT | POLLWRNORM; 1798 mask |= EPOLLOUT | EPOLLWRNORM;
1799 return mask; 1799 return mask;
1800} 1800}
1801 1801
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index c6a317120a55..0c858d027bf3 100644
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -804,7 +804,7 @@ static __poll_t rtc_poll(struct file *file, poll_table *wait)
804 spin_unlock_irq(&rtc_lock); 804 spin_unlock_irq(&rtc_lock);
805 805
806 if (l != 0) 806 if (l != 0)
807 return POLLIN | POLLRDNORM; 807 return EPOLLIN | EPOLLRDNORM;
808 return 0; 808 return 0;
809} 809}
810#endif 810#endif
diff --git a/drivers/char/snsc.c b/drivers/char/snsc.c
index 7f49fa0f41d7..5918ea7499bb 100644
--- a/drivers/char/snsc.c
+++ b/drivers/char/snsc.c
@@ -340,10 +340,10 @@ scdrv_poll(struct file *file, struct poll_table_struct *wait)
340 340
341 if (status > 0) { 341 if (status > 0) {
342 if (status & SAL_IROUTER_INTR_RECV) { 342 if (status & SAL_IROUTER_INTR_RECV) {
343 mask |= POLLIN | POLLRDNORM; 343 mask |= EPOLLIN | EPOLLRDNORM;
344 } 344 }
345 if (status & SAL_IROUTER_INTR_XMIT) { 345 if (status & SAL_IROUTER_INTR_XMIT) {
346 mask |= POLLOUT | POLLWRNORM; 346 mask |= EPOLLOUT | EPOLLWRNORM;
347 } 347 }
348 } 348 }
349 349
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c
index fc041c462aa4..186689833231 100644
--- a/drivers/char/sonypi.c
+++ b/drivers/char/sonypi.c
@@ -944,7 +944,7 @@ static __poll_t sonypi_misc_poll(struct file *file, poll_table *wait)
944{ 944{
945 poll_wait(file, &sonypi_device.fifo_proc_list, wait); 945 poll_wait(file, &sonypi_device.fifo_proc_list, wait);
946 if (kfifo_len(&sonypi_device.fifo)) 946 if (kfifo_len(&sonypi_device.fifo))
947 return POLLIN | POLLRDNORM; 947 return EPOLLIN | EPOLLRDNORM;
948 return 0; 948 return 0;
949} 949}
950 950
diff --git a/drivers/char/tpm/tpm_vtpm_proxy.c b/drivers/char/tpm/tpm_vtpm_proxy.c
index 674218b50b13..e4f79f920450 100644
--- a/drivers/char/tpm/tpm_vtpm_proxy.c
+++ b/drivers/char/tpm/tpm_vtpm_proxy.c
@@ -180,15 +180,15 @@ static __poll_t vtpm_proxy_fops_poll(struct file *filp, poll_table *wait)
180 180
181 poll_wait(filp, &proxy_dev->wq, wait); 181 poll_wait(filp, &proxy_dev->wq, wait);
182 182
183 ret = POLLOUT; 183 ret = EPOLLOUT;
184 184
185 mutex_lock(&proxy_dev->buf_lock); 185 mutex_lock(&proxy_dev->buf_lock);
186 186
187 if (proxy_dev->req_len) 187 if (proxy_dev->req_len)
188 ret |= POLLIN | POLLRDNORM; 188 ret |= EPOLLIN | EPOLLRDNORM;
189 189
190 if (!(proxy_dev->state & STATE_OPENED_FLAG)) 190 if (!(proxy_dev->state & STATE_OPENED_FLAG))
191 ret |= POLLHUP; 191 ret |= EPOLLHUP;
192 192
193 mutex_unlock(&proxy_dev->buf_lock); 193 mutex_unlock(&proxy_dev->buf_lock);
194 194
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 813a2e46824d..468f06134012 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -992,15 +992,15 @@ static __poll_t port_fops_poll(struct file *filp, poll_table *wait)
992 992
993 if (!port->guest_connected) { 993 if (!port->guest_connected) {
994 /* Port got unplugged */ 994 /* Port got unplugged */
995 return POLLHUP; 995 return EPOLLHUP;
996 } 996 }
997 ret = 0; 997 ret = 0;
998 if (!will_read_block(port)) 998 if (!will_read_block(port))
999 ret |= POLLIN | POLLRDNORM; 999 ret |= EPOLLIN | EPOLLRDNORM;
1000 if (!will_write_block(port)) 1000 if (!will_write_block(port))
1001 ret |= POLLOUT; 1001 ret |= EPOLLOUT;
1002 if (!port->host_connected) 1002 if (!port->host_connected)
1003 ret |= POLLHUP; 1003 ret |= EPOLLHUP;
1004 1004
1005 return ret; 1005 return ret;
1006} 1006}
diff --git a/drivers/char/xillybus/xillybus_core.c b/drivers/char/xillybus/xillybus_core.c
index 88e1cf475d3f..a11af94e2e65 100644
--- a/drivers/char/xillybus/xillybus_core.c
+++ b/drivers/char/xillybus/xillybus_core.c
@@ -1758,15 +1758,15 @@ static __poll_t xillybus_poll(struct file *filp, poll_table *wait)
1758 1758
1759 spin_lock_irqsave(&channel->wr_spinlock, flags); 1759 spin_lock_irqsave(&channel->wr_spinlock, flags);
1760 if (!channel->wr_empty || channel->wr_ready) 1760 if (!channel->wr_empty || channel->wr_ready)
1761 mask |= POLLIN | POLLRDNORM; 1761 mask |= EPOLLIN | EPOLLRDNORM;
1762 1762
1763 if (channel->wr_hangup) 1763 if (channel->wr_hangup)
1764 /* 1764 /*
1765 * Not POLLHUP, because its behavior is in the 1765 * Not EPOLLHUP, because its behavior is in the
1766 * mist, and POLLIN does what we want: Wake up 1766 * mist, and EPOLLIN does what we want: Wake up
1767 * the read file descriptor so it sees EOF. 1767 * the read file descriptor so it sees EOF.
1768 */ 1768 */
1769 mask |= POLLIN | POLLRDNORM; 1769 mask |= EPOLLIN | EPOLLRDNORM;
1770 spin_unlock_irqrestore(&channel->wr_spinlock, flags); 1770 spin_unlock_irqrestore(&channel->wr_spinlock, flags);
1771 } 1771 }
1772 1772
@@ -1781,12 +1781,12 @@ static __poll_t xillybus_poll(struct file *filp, poll_table *wait)
1781 1781
1782 spin_lock_irqsave(&channel->rd_spinlock, flags); 1782 spin_lock_irqsave(&channel->rd_spinlock, flags);
1783 if (!channel->rd_full) 1783 if (!channel->rd_full)
1784 mask |= POLLOUT | POLLWRNORM; 1784 mask |= EPOLLOUT | EPOLLWRNORM;
1785 spin_unlock_irqrestore(&channel->rd_spinlock, flags); 1785 spin_unlock_irqrestore(&channel->rd_spinlock, flags);
1786 } 1786 }
1787 1787
1788 if (channel->endpoint->fatal_error) 1788 if (channel->endpoint->fatal_error)
1789 mask |= POLLERR; 1789 mask |= EPOLLERR;
1790 1790
1791 return mask; 1791 return mask;
1792} 1792}
diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index 539450713838..d78d5fc173dc 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -135,10 +135,10 @@ static loff_t dma_buf_llseek(struct file *file, loff_t offset, int whence)
135 * Userspace can query the state of these implicitly tracked fences using poll() 135 * Userspace can query the state of these implicitly tracked fences using poll()
136 * and related system calls: 136 * and related system calls:
137 * 137 *
138 * - Checking for POLLIN, i.e. read access, can be use to query the state of the 138 * - Checking for EPOLLIN, i.e. read access, can be use to query the state of the
139 * most recent write or exclusive fence. 139 * most recent write or exclusive fence.
140 * 140 *
141 * - Checking for POLLOUT, i.e. write access, can be used to query the state of 141 * - Checking for EPOLLOUT, i.e. write access, can be used to query the state of
142 * all attached fences, shared and exclusive ones. 142 * all attached fences, shared and exclusive ones.
143 * 143 *
144 * Note that this only signals the completion of the respective fences, i.e. the 144 * Note that this only signals the completion of the respective fences, i.e. the
@@ -168,13 +168,13 @@ static __poll_t dma_buf_poll(struct file *file, poll_table *poll)
168 168
169 dmabuf = file->private_data; 169 dmabuf = file->private_data;
170 if (!dmabuf || !dmabuf->resv) 170 if (!dmabuf || !dmabuf->resv)
171 return POLLERR; 171 return EPOLLERR;
172 172
173 resv = dmabuf->resv; 173 resv = dmabuf->resv;
174 174
175 poll_wait(file, &dmabuf->poll, poll); 175 poll_wait(file, &dmabuf->poll, poll);
176 176
177 events = poll_requested_events(poll) & (POLLIN | POLLOUT); 177 events = poll_requested_events(poll) & (EPOLLIN | EPOLLOUT);
178 if (!events) 178 if (!events)
179 return 0; 179 return 0;
180 180
@@ -193,12 +193,12 @@ retry:
193 goto retry; 193 goto retry;
194 } 194 }
195 195
196 if (fence_excl && (!(events & POLLOUT) || shared_count == 0)) { 196 if (fence_excl && (!(events & EPOLLOUT) || shared_count == 0)) {
197 struct dma_buf_poll_cb_t *dcb = &dmabuf->cb_excl; 197 struct dma_buf_poll_cb_t *dcb = &dmabuf->cb_excl;
198 __poll_t pevents = POLLIN; 198 __poll_t pevents = EPOLLIN;
199 199
200 if (shared_count == 0) 200 if (shared_count == 0)
201 pevents |= POLLOUT; 201 pevents |= EPOLLOUT;
202 202
203 spin_lock_irq(&dmabuf->poll.lock); 203 spin_lock_irq(&dmabuf->poll.lock);
204 if (dcb->active) { 204 if (dcb->active) {
@@ -228,19 +228,19 @@ retry:
228 } 228 }
229 } 229 }
230 230
231 if ((events & POLLOUT) && shared_count > 0) { 231 if ((events & EPOLLOUT) && shared_count > 0) {
232 struct dma_buf_poll_cb_t *dcb = &dmabuf->cb_shared; 232 struct dma_buf_poll_cb_t *dcb = &dmabuf->cb_shared;
233 int i; 233 int i;
234 234
235 /* Only queue a new callback if no event has fired yet */ 235 /* Only queue a new callback if no event has fired yet */
236 spin_lock_irq(&dmabuf->poll.lock); 236 spin_lock_irq(&dmabuf->poll.lock);
237 if (dcb->active) 237 if (dcb->active)
238 events &= ~POLLOUT; 238 events &= ~EPOLLOUT;
239 else 239 else
240 dcb->active = POLLOUT; 240 dcb->active = EPOLLOUT;
241 spin_unlock_irq(&dmabuf->poll.lock); 241 spin_unlock_irq(&dmabuf->poll.lock);
242 242
243 if (!(events & POLLOUT)) 243 if (!(events & EPOLLOUT))
244 goto out; 244 goto out;
245 245
246 for (i = 0; i < shared_count; ++i) { 246 for (i = 0; i < shared_count; ++i) {
@@ -253,14 +253,14 @@ retry:
253 * 253 *
254 * call dma_buf_poll_cb and force a recheck! 254 * call dma_buf_poll_cb and force a recheck!
255 */ 255 */
256 events &= ~POLLOUT; 256 events &= ~EPOLLOUT;
257 dma_buf_poll_cb(NULL, &dcb->cb); 257 dma_buf_poll_cb(NULL, &dcb->cb);
258 break; 258 break;
259 } 259 }
260 if (!dma_fence_add_callback(fence, &dcb->cb, 260 if (!dma_fence_add_callback(fence, &dcb->cb,
261 dma_buf_poll_cb)) { 261 dma_buf_poll_cb)) {
262 dma_fence_put(fence); 262 dma_fence_put(fence);
263 events &= ~POLLOUT; 263 events &= ~EPOLLOUT;
264 break; 264 break;
265 } 265 }
266 dma_fence_put(fence); 266 dma_fence_put(fence);
diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
index 8e8c4a12a0bc..35dd06479867 100644
--- a/drivers/dma-buf/sync_file.c
+++ b/drivers/dma-buf/sync_file.c
@@ -325,7 +325,7 @@ static __poll_t sync_file_poll(struct file *file, poll_table *wait)
325 wake_up_all(&sync_file->wq); 325 wake_up_all(&sync_file->wq);
326 } 326 }
327 327
328 return dma_fence_is_signaled(sync_file->fence) ? POLLIN : 0; 328 return dma_fence_is_signaled(sync_file->fence) ? EPOLLIN : 0;
329} 329}
330 330
331static long sync_file_ioctl_merge(struct sync_file *sync_file, 331static long sync_file_ioctl_merge(struct sync_file *sync_file,
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c
index 523391bb3fbe..f0587273940e 100644
--- a/drivers/firewire/core-cdev.c
+++ b/drivers/firewire/core-cdev.c
@@ -1792,9 +1792,9 @@ static __poll_t fw_device_op_poll(struct file *file, poll_table * pt)
1792 poll_wait(file, &client->wait, pt); 1792 poll_wait(file, &client->wait, pt);
1793 1793
1794 if (fw_device_is_shutdown(client->device)) 1794 if (fw_device_is_shutdown(client->device))
1795 mask |= POLLHUP | POLLERR; 1795 mask |= EPOLLHUP | EPOLLERR;
1796 if (!list_empty(&client->event_list)) 1796 if (!list_empty(&client->event_list))
1797 mask |= POLLIN | POLLRDNORM; 1797 mask |= EPOLLIN | EPOLLRDNORM;
1798 1798
1799 return mask; 1799 return mask;
1800} 1800}
diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c
index fee2e9e7ea20..a128dd1126ae 100644
--- a/drivers/firewire/nosy.c
+++ b/drivers/firewire/nosy.c
@@ -337,10 +337,10 @@ nosy_poll(struct file *file, poll_table *pt)
337 poll_wait(file, &client->buffer.wait, pt); 337 poll_wait(file, &client->buffer.wait, pt);
338 338
339 if (atomic_read(&client->buffer.size) > 0) 339 if (atomic_read(&client->buffer.size) > 0)
340 ret = POLLIN | POLLRDNORM; 340 ret = EPOLLIN | EPOLLRDNORM;
341 341
342 if (list_empty(&client->lynx->link)) 342 if (list_empty(&client->lynx->link))
343 ret |= POLLHUP; 343 ret |= EPOLLHUP;
344 344
345 return ret; 345 return ret;
346} 346}
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 36ca5064486e..d66de67ef307 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -630,7 +630,7 @@ static __poll_t lineevent_poll(struct file *filep,
630 poll_wait(filep, &le->wait, wait); 630 poll_wait(filep, &le->wait, wait);
631 631
632 if (!kfifo_is_empty(&le->events)) 632 if (!kfifo_is_empty(&le->events))
633 events = POLLIN | POLLRDNORM; 633 events = EPOLLIN | EPOLLRDNORM;
634 634
635 return events; 635 return events;
636} 636}
@@ -775,7 +775,7 @@ static irqreturn_t lineevent_irq_thread(int irq, void *p)
775 775
776 ret = kfifo_put(&le->events, ge); 776 ret = kfifo_put(&le->events, ge);
777 if (ret != 0) 777 if (ret != 0)
778 wake_up_poll(&le->wait, POLLIN); 778 wake_up_poll(&le->wait, EPOLLIN);
779 779
780 return IRQ_HANDLED; 780 return IRQ_HANDLED;
781} 781}
diff --git a/drivers/gpu/drm/drm_file.c b/drivers/gpu/drm/drm_file.c
index 9a17bd3639d1..e394799979a6 100644
--- a/drivers/gpu/drm/drm_file.c
+++ b/drivers/gpu/drm/drm_file.c
@@ -567,7 +567,7 @@ __poll_t drm_poll(struct file *filp, struct poll_table_struct *wait)
567 poll_wait(filp, &file_priv->event_wait, wait); 567 poll_wait(filp, &file_priv->event_wait, wait);
568 568
569 if (!list_empty(&file_priv->event_list)) 569 if (!list_empty(&file_priv->event_list))
570 mask |= POLLIN | POLLRDNORM; 570 mask |= EPOLLIN | EPOLLRDNORM;
571 571
572 return mask; 572 return mask;
573} 573}
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index e42d9a4de322..0be50e43507d 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -244,7 +244,7 @@
244 * The two separate pointers let us decouple read()s from tail pointer aging. 244 * The two separate pointers let us decouple read()s from tail pointer aging.
245 * 245 *
246 * The tail pointers are checked and updated at a limited rate within a hrtimer 246 * The tail pointers are checked and updated at a limited rate within a hrtimer
247 * callback (the same callback that is used for delivering POLLIN events) 247 * callback (the same callback that is used for delivering EPOLLIN events)
248 * 248 *
249 * Initially the tails are marked invalid with %INVALID_TAIL_PTR which 249 * Initially the tails are marked invalid with %INVALID_TAIL_PTR which
250 * indicates that an updated tail pointer is needed. 250 * indicates that an updated tail pointer is needed.
@@ -2292,13 +2292,13 @@ static ssize_t i915_perf_read(struct file *file,
2292 mutex_unlock(&dev_priv->perf.lock); 2292 mutex_unlock(&dev_priv->perf.lock);
2293 } 2293 }
2294 2294
2295 /* We allow the poll checking to sometimes report false positive POLLIN 2295 /* We allow the poll checking to sometimes report false positive EPOLLIN
2296 * events where we might actually report EAGAIN on read() if there's 2296 * events where we might actually report EAGAIN on read() if there's
2297 * not really any data available. In this situation though we don't 2297 * not really any data available. In this situation though we don't
2298 * want to enter a busy loop between poll() reporting a POLLIN event 2298 * want to enter a busy loop between poll() reporting a EPOLLIN event
2299 * and read() returning -EAGAIN. Clearing the oa.pollin state here 2299 * and read() returning -EAGAIN. Clearing the oa.pollin state here
2300 * effectively ensures we back off until the next hrtimer callback 2300 * effectively ensures we back off until the next hrtimer callback
2301 * before reporting another POLLIN event. 2301 * before reporting another EPOLLIN event.
2302 */ 2302 */
2303 if (ret >= 0 || ret == -EAGAIN) { 2303 if (ret >= 0 || ret == -EAGAIN) {
2304 /* Maybe make ->pollin per-stream state if we support multiple 2304 /* Maybe make ->pollin per-stream state if we support multiple
@@ -2358,7 +2358,7 @@ static __poll_t i915_perf_poll_locked(struct drm_i915_private *dev_priv,
2358 * samples to read. 2358 * samples to read.
2359 */ 2359 */
2360 if (dev_priv->perf.oa.pollin) 2360 if (dev_priv->perf.oa.pollin)
2361 events |= POLLIN; 2361 events |= EPOLLIN;
2362 2362
2363 return events; 2363 return events;
2364} 2364}
diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
index dfd8d0048980..1c5e74cb9279 100644
--- a/drivers/gpu/vga/vgaarb.c
+++ b/drivers/gpu/vga/vgaarb.c
@@ -1271,7 +1271,7 @@ static __poll_t vga_arb_fpoll(struct file *file, poll_table *wait)
1271 pr_debug("%s\n", __func__); 1271 pr_debug("%s\n", __func__);
1272 1272
1273 poll_wait(file, &vga_wait_queue, wait); 1273 poll_wait(file, &vga_wait_queue, wait);
1274 return POLLIN; 1274 return EPOLLIN;
1275} 1275}
1276 1276
1277static int vga_arb_open(struct inode *inode, struct file *file) 1277static int vga_arb_open(struct inode *inode, struct file *file)
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
index c783fd5ef809..4f4e7a08a07b 100644
--- a/drivers/hid/hid-debug.c
+++ b/drivers/hid/hid-debug.c
@@ -1185,9 +1185,9 @@ static __poll_t hid_debug_events_poll(struct file *file, poll_table *wait)
1185 1185
1186 poll_wait(file, &list->hdev->debug_wait, wait); 1186 poll_wait(file, &list->hdev->debug_wait, wait);
1187 if (list->head != list->tail) 1187 if (list->head != list->tail)
1188 return POLLIN | POLLRDNORM; 1188 return EPOLLIN | EPOLLRDNORM;
1189 if (!list->hdev->debug) 1189 if (!list->hdev->debug)
1190 return POLLERR | POLLHUP; 1190 return EPOLLERR | EPOLLHUP;
1191 return 0; 1191 return 0;
1192} 1192}
1193 1193
diff --git a/drivers/hid/hid-roccat.c b/drivers/hid/hid-roccat.c
index b7e86aba6f33..5be8de70c651 100644
--- a/drivers/hid/hid-roccat.c
+++ b/drivers/hid/hid-roccat.c
@@ -142,9 +142,9 @@ static __poll_t roccat_poll(struct file *file, poll_table *wait)
142 struct roccat_reader *reader = file->private_data; 142 struct roccat_reader *reader = file->private_data;
143 poll_wait(file, &reader->device->wait, wait); 143 poll_wait(file, &reader->device->wait, wait);
144 if (reader->cbuf_start != reader->device->cbuf_end) 144 if (reader->cbuf_start != reader->device->cbuf_end)
145 return POLLIN | POLLRDNORM; 145 return EPOLLIN | EPOLLRDNORM;
146 if (!reader->device->exist) 146 if (!reader->device->exist)
147 return POLLERR | POLLHUP; 147 return EPOLLERR | EPOLLHUP;
148 return 0; 148 return 0;
149} 149}
150 150
diff --git a/drivers/hid/hid-sensor-custom.c b/drivers/hid/hid-sensor-custom.c
index 21ed6c55c40a..e8a114157f87 100644
--- a/drivers/hid/hid-sensor-custom.c
+++ b/drivers/hid/hid-sensor-custom.c
@@ -714,7 +714,7 @@ static __poll_t hid_sensor_custom_poll(struct file *file,
714 poll_wait(file, &sensor_inst->wait, wait); 714 poll_wait(file, &sensor_inst->wait, wait);
715 715
716 if (!kfifo_is_empty(&sensor_inst->data_fifo)) 716 if (!kfifo_is_empty(&sensor_inst->data_fifo))
717 mask = POLLIN | POLLRDNORM; 717 mask = EPOLLIN | EPOLLRDNORM;
718 718
719 return mask; 719 return mask;
720} 720}
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index be210219f982..fbfcc8009432 100644
--- a/drivers/hid/hidraw.c
+++ b/drivers/hid/hidraw.c
@@ -255,9 +255,9 @@ static __poll_t hidraw_poll(struct file *file, poll_table *wait)
255 255
256 poll_wait(file, &list->hidraw->wait, wait); 256 poll_wait(file, &list->hidraw->wait, wait);
257 if (list->head != list->tail) 257 if (list->head != list->tail)
258 return POLLIN | POLLRDNORM; 258 return EPOLLIN | EPOLLRDNORM;
259 if (!list->hidraw->exist) 259 if (!list->hidraw->exist)
260 return POLLERR | POLLHUP; 260 return EPOLLERR | EPOLLHUP;
261 return 0; 261 return 0;
262} 262}
263 263
diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c
index fc43850a155e..4e0e7baf8513 100644
--- a/drivers/hid/uhid.c
+++ b/drivers/hid/uhid.c
@@ -760,7 +760,7 @@ static __poll_t uhid_char_poll(struct file *file, poll_table *wait)
760 poll_wait(file, &uhid->waitq, wait); 760 poll_wait(file, &uhid->waitq, wait);
761 761
762 if (uhid->head != uhid->tail) 762 if (uhid->head != uhid->tail)
763 return POLLIN | POLLRDNORM; 763 return EPOLLIN | EPOLLRDNORM;
764 764
765 return 0; 765 return 0;
766} 766}
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
index 0ff3e7e70c8d..e3ce233f8bdc 100644
--- a/drivers/hid/usbhid/hiddev.c
+++ b/drivers/hid/usbhid/hiddev.c
@@ -428,9 +428,9 @@ static __poll_t hiddev_poll(struct file *file, poll_table *wait)
428 428
429 poll_wait(file, &list->hiddev->wait, wait); 429 poll_wait(file, &list->hiddev->wait, wait);
430 if (list->head != list->tail) 430 if (list->head != list->tail)
431 return POLLIN | POLLRDNORM; 431 return EPOLLIN | EPOLLRDNORM;
432 if (!list->hiddev->exist) 432 if (!list->hiddev->exist)
433 return POLLERR | POLLHUP; 433 return EPOLLERR | EPOLLHUP;
434 return 0; 434 return 0;
435} 435}
436 436
diff --git a/drivers/hsi/clients/cmt_speech.c b/drivers/hsi/clients/cmt_speech.c
index 8fbbacb0fe21..324cb8ec9405 100644
--- a/drivers/hsi/clients/cmt_speech.c
+++ b/drivers/hsi/clients/cmt_speech.c
@@ -1132,9 +1132,9 @@ static __poll_t cs_char_poll(struct file *file, poll_table *wait)
1132 poll_wait(file, &cs_char_data.wait, wait); 1132 poll_wait(file, &cs_char_data.wait, wait);
1133 spin_lock_bh(&csdata->lock); 1133 spin_lock_bh(&csdata->lock);
1134 if (!list_empty(&csdata->chardev_queue)) 1134 if (!list_empty(&csdata->chardev_queue))
1135 ret = POLLIN | POLLRDNORM; 1135 ret = EPOLLIN | EPOLLRDNORM;
1136 else if (!list_empty(&csdata->dataind_queue)) 1136 else if (!list_empty(&csdata->dataind_queue))
1137 ret = POLLIN | POLLRDNORM; 1137 ret = EPOLLIN | EPOLLRDNORM;
1138 spin_unlock_bh(&csdata->lock); 1138 spin_unlock_bh(&csdata->lock);
1139 1139
1140 return ret; 1140 return ret;
diff --git a/drivers/hv/hv_utils_transport.c b/drivers/hv/hv_utils_transport.c
index 047959e74bb1..832777527936 100644
--- a/drivers/hv/hv_utils_transport.c
+++ b/drivers/hv/hv_utils_transport.c
@@ -113,10 +113,10 @@ static __poll_t hvt_op_poll(struct file *file, poll_table *wait)
113 poll_wait(file, &hvt->outmsg_q, wait); 113 poll_wait(file, &hvt->outmsg_q, wait);
114 114
115 if (hvt->mode == HVUTIL_TRANSPORT_DESTROY) 115 if (hvt->mode == HVUTIL_TRANSPORT_DESTROY)
116 return POLLERR | POLLHUP; 116 return EPOLLERR | EPOLLHUP;
117 117
118 if (hvt->outmsg_len > 0) 118 if (hvt->outmsg_len > 0)
119 return POLLIN | POLLRDNORM; 119 return EPOLLIN | EPOLLRDNORM;
120 120
121 return 0; 121 return 0;
122} 122}
diff --git a/drivers/iio/buffer/industrialio-buffer-dma.c b/drivers/iio/buffer/industrialio-buffer-dma.c
index ff03324dee13..05e0c353e089 100644
--- a/drivers/iio/buffer/industrialio-buffer-dma.c
+++ b/drivers/iio/buffer/industrialio-buffer-dma.c
@@ -222,7 +222,7 @@ void iio_dma_buffer_block_done(struct iio_dma_buffer_block *block)
222 spin_unlock_irqrestore(&queue->list_lock, flags); 222 spin_unlock_irqrestore(&queue->list_lock, flags);
223 223
224 iio_buffer_block_put_atomic(block); 224 iio_buffer_block_put_atomic(block);
225 wake_up_interruptible_poll(&queue->buffer.pollq, POLLIN | POLLRDNORM); 225 wake_up_interruptible_poll(&queue->buffer.pollq, EPOLLIN | EPOLLRDNORM);
226} 226}
227EXPORT_SYMBOL_GPL(iio_dma_buffer_block_done); 227EXPORT_SYMBOL_GPL(iio_dma_buffer_block_done);
228 228
@@ -251,7 +251,7 @@ void iio_dma_buffer_block_list_abort(struct iio_dma_buffer_queue *queue,
251 } 251 }
252 spin_unlock_irqrestore(&queue->list_lock, flags); 252 spin_unlock_irqrestore(&queue->list_lock, flags);
253 253
254 wake_up_interruptible_poll(&queue->buffer.pollq, POLLIN | POLLRDNORM); 254 wake_up_interruptible_poll(&queue->buffer.pollq, EPOLLIN | EPOLLRDNORM);
255} 255}
256EXPORT_SYMBOL_GPL(iio_dma_buffer_block_list_abort); 256EXPORT_SYMBOL_GPL(iio_dma_buffer_block_list_abort);
257 257
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index 6184c100a94a..79abf70a126d 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -166,7 +166,7 @@ ssize_t iio_buffer_read_first_n_outer(struct file *filp, char __user *buf,
166 * @wait: Poll table structure pointer for which the driver adds 166 * @wait: Poll table structure pointer for which the driver adds
167 * a wait queue 167 * a wait queue
168 * 168 *
169 * Return: (POLLIN | POLLRDNORM) if data is available for reading 169 * Return: (EPOLLIN | EPOLLRDNORM) if data is available for reading
170 * or 0 for other cases 170 * or 0 for other cases
171 */ 171 */
172__poll_t iio_buffer_poll(struct file *filp, 172__poll_t iio_buffer_poll(struct file *filp,
@@ -180,7 +180,7 @@ __poll_t iio_buffer_poll(struct file *filp,
180 180
181 poll_wait(filp, &rb->pollq, wait); 181 poll_wait(filp, &rb->pollq, wait);
182 if (iio_buffer_ready(indio_dev, rb, rb->watermark, 0)) 182 if (iio_buffer_ready(indio_dev, rb, rb->watermark, 0))
183 return POLLIN | POLLRDNORM; 183 return EPOLLIN | EPOLLRDNORM;
184 return 0; 184 return 0;
185} 185}
186 186
@@ -1396,7 +1396,7 @@ static int iio_push_to_buffer(struct iio_buffer *buffer, const void *data)
1396 * We can't just test for watermark to decide if we wake the poll queue 1396 * We can't just test for watermark to decide if we wake the poll queue
1397 * because read may request less samples than the watermark. 1397 * because read may request less samples than the watermark.
1398 */ 1398 */
1399 wake_up_interruptible_poll(&buffer->pollq, POLLIN | POLLRDNORM); 1399 wake_up_interruptible_poll(&buffer->pollq, EPOLLIN | EPOLLRDNORM);
1400 return 0; 1400 return 0;
1401} 1401}
1402 1402
diff --git a/drivers/iio/industrialio-event.c b/drivers/iio/industrialio-event.c
index 0bcf073e46db..c6dfdf0aaac5 100644
--- a/drivers/iio/industrialio-event.c
+++ b/drivers/iio/industrialio-event.c
@@ -80,7 +80,7 @@ int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp)
80 80
81 copied = kfifo_put(&ev_int->det_events, ev); 81 copied = kfifo_put(&ev_int->det_events, ev);
82 if (copied != 0) 82 if (copied != 0)
83 wake_up_poll(&ev_int->wait, POLLIN); 83 wake_up_poll(&ev_int->wait, EPOLLIN);
84 } 84 }
85 85
86 return 0; 86 return 0;
@@ -92,7 +92,7 @@ EXPORT_SYMBOL(iio_push_event);
92 * @filep: File structure pointer to identify the device 92 * @filep: File structure pointer to identify the device
93 * @wait: Poll table pointer to add the wait queue on 93 * @wait: Poll table pointer to add the wait queue on
94 * 94 *
95 * Return: (POLLIN | POLLRDNORM) if data is available for reading 95 * Return: (EPOLLIN | EPOLLRDNORM) if data is available for reading
96 * or a negative error code on failure 96 * or a negative error code on failure
97 */ 97 */
98static __poll_t iio_event_poll(struct file *filep, 98static __poll_t iio_event_poll(struct file *filep,
@@ -108,7 +108,7 @@ static __poll_t iio_event_poll(struct file *filep,
108 poll_wait(filep, &ev_int->wait, wait); 108 poll_wait(filep, &ev_int->wait, wait);
109 109
110 if (!kfifo_is_empty(&ev_int->det_events)) 110 if (!kfifo_is_empty(&ev_int->det_events))
111 events = POLLIN | POLLRDNORM; 111 events = EPOLLIN | EPOLLRDNORM;
112 112
113 return events; 113 return events;
114} 114}
diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c
index 8ae636bb09e5..01702265c1e1 100644
--- a/drivers/infiniband/core/ucm.c
+++ b/drivers/infiniband/core/ucm.c
@@ -1144,7 +1144,7 @@ static __poll_t ib_ucm_poll(struct file *filp,
1144 poll_wait(filp, &file->poll_wait, wait); 1144 poll_wait(filp, &file->poll_wait, wait);
1145 1145
1146 if (!list_empty(&file->events)) 1146 if (!list_empty(&file->events))
1147 mask = POLLIN | POLLRDNORM; 1147 mask = EPOLLIN | EPOLLRDNORM;
1148 1148
1149 return mask; 1149 return mask;
1150} 1150}
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index 6ba4231f2b07..f015f1bf88c9 100644
--- a/drivers/infiniband/core/ucma.c
+++ b/drivers/infiniband/core/ucma.c
@@ -1639,7 +1639,7 @@ static __poll_t ucma_poll(struct file *filp, struct poll_table_struct *wait)
1639 poll_wait(filp, &file->poll_wait, wait); 1639 poll_wait(filp, &file->poll_wait, wait);
1640 1640
1641 if (!list_empty(&file->event_list)) 1641 if (!list_empty(&file->event_list))
1642 mask = POLLIN | POLLRDNORM; 1642 mask = EPOLLIN | EPOLLRDNORM;
1643 1643
1644 return mask; 1644 return mask;
1645} 1645}
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
index 78c77962422e..bb98c9e4a7fd 100644
--- a/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -633,12 +633,12 @@ static __poll_t ib_umad_poll(struct file *filp, struct poll_table_struct *wait)
633 struct ib_umad_file *file = filp->private_data; 633 struct ib_umad_file *file = filp->private_data;
634 634
635 /* we will always be able to post a MAD send */ 635 /* we will always be able to post a MAD send */
636 __poll_t mask = POLLOUT | POLLWRNORM; 636 __poll_t mask = EPOLLOUT | EPOLLWRNORM;
637 637
638 poll_wait(filp, &file->recv_wait, wait); 638 poll_wait(filp, &file->recv_wait, wait);
639 639
640 if (!list_empty(&file->recv_list)) 640 if (!list_empty(&file->recv_list))
641 mask |= POLLIN | POLLRDNORM; 641 mask |= EPOLLIN | EPOLLRDNORM;
642 642
643 return mask; 643 return mask;
644} 644}
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 5b811bf574d6..395a3b091229 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -351,7 +351,7 @@ static __poll_t ib_uverbs_event_poll(struct ib_uverbs_event_queue *ev_queue,
351 351
352 spin_lock_irq(&ev_queue->lock); 352 spin_lock_irq(&ev_queue->lock);
353 if (!list_empty(&ev_queue->event_list)) 353 if (!list_empty(&ev_queue->event_list))
354 pollflags = POLLIN | POLLRDNORM; 354 pollflags = EPOLLIN | EPOLLRDNORM;
355 spin_unlock_irq(&ev_queue->lock); 355 spin_unlock_irq(&ev_queue->lock);
356 356
357 return pollflags; 357 return pollflags;
diff --git a/drivers/infiniband/hw/hfi1/file_ops.c b/drivers/infiniband/hw/hfi1/file_ops.c
index d9a0f2590294..41fafebe3b0d 100644
--- a/drivers/infiniband/hw/hfi1/file_ops.c
+++ b/drivers/infiniband/hw/hfi1/file_ops.c
@@ -612,13 +612,13 @@ static __poll_t hfi1_poll(struct file *fp, struct poll_table_struct *pt)
612 612
613 uctxt = ((struct hfi1_filedata *)fp->private_data)->uctxt; 613 uctxt = ((struct hfi1_filedata *)fp->private_data)->uctxt;
614 if (!uctxt) 614 if (!uctxt)
615 pollflag = POLLERR; 615 pollflag = EPOLLERR;
616 else if (uctxt->poll_type == HFI1_POLL_TYPE_URGENT) 616 else if (uctxt->poll_type == HFI1_POLL_TYPE_URGENT)
617 pollflag = poll_urgent(fp, pt); 617 pollflag = poll_urgent(fp, pt);
618 else if (uctxt->poll_type == HFI1_POLL_TYPE_ANYRCV) 618 else if (uctxt->poll_type == HFI1_POLL_TYPE_ANYRCV)
619 pollflag = poll_next(fp, pt); 619 pollflag = poll_next(fp, pt);
620 else /* invalid */ 620 else /* invalid */
621 pollflag = POLLERR; 621 pollflag = EPOLLERR;
622 622
623 return pollflag; 623 return pollflag;
624} 624}
@@ -1435,7 +1435,7 @@ static __poll_t poll_urgent(struct file *fp,
1435 1435
1436 spin_lock_irq(&dd->uctxt_lock); 1436 spin_lock_irq(&dd->uctxt_lock);
1437 if (uctxt->urgent != uctxt->urgent_poll) { 1437 if (uctxt->urgent != uctxt->urgent_poll) {
1438 pollflag = POLLIN | POLLRDNORM; 1438 pollflag = EPOLLIN | EPOLLRDNORM;
1439 uctxt->urgent_poll = uctxt->urgent; 1439 uctxt->urgent_poll = uctxt->urgent;
1440 } else { 1440 } else {
1441 pollflag = 0; 1441 pollflag = 0;
@@ -1462,7 +1462,7 @@ static __poll_t poll_next(struct file *fp,
1462 hfi1_rcvctrl(dd, HFI1_RCVCTRL_INTRAVAIL_ENB, uctxt); 1462 hfi1_rcvctrl(dd, HFI1_RCVCTRL_INTRAVAIL_ENB, uctxt);
1463 pollflag = 0; 1463 pollflag = 0;
1464 } else { 1464 } else {
1465 pollflag = POLLIN | POLLRDNORM; 1465 pollflag = EPOLLIN | EPOLLRDNORM;
1466 } 1466 }
1467 spin_unlock_irq(&dd->uctxt_lock); 1467 spin_unlock_irq(&dd->uctxt_lock);
1468 1468
diff --git a/drivers/infiniband/hw/qib/qib_file_ops.c b/drivers/infiniband/hw/qib/qib_file_ops.c
index f7593b5e2b76..52c29db3a2f4 100644
--- a/drivers/infiniband/hw/qib/qib_file_ops.c
+++ b/drivers/infiniband/hw/qib/qib_file_ops.c
@@ -1085,7 +1085,7 @@ static __poll_t qib_poll_urgent(struct qib_ctxtdata *rcd,
1085 1085
1086 spin_lock_irq(&dd->uctxt_lock); 1086 spin_lock_irq(&dd->uctxt_lock);
1087 if (rcd->urgent != rcd->urgent_poll) { 1087 if (rcd->urgent != rcd->urgent_poll) {
1088 pollflag = POLLIN | POLLRDNORM; 1088 pollflag = EPOLLIN | EPOLLRDNORM;
1089 rcd->urgent_poll = rcd->urgent; 1089 rcd->urgent_poll = rcd->urgent;
1090 } else { 1090 } else {
1091 pollflag = 0; 1091 pollflag = 0;
@@ -1111,7 +1111,7 @@ static __poll_t qib_poll_next(struct qib_ctxtdata *rcd,
1111 dd->f_rcvctrl(rcd->ppd, QIB_RCVCTRL_INTRAVAIL_ENB, rcd->ctxt); 1111 dd->f_rcvctrl(rcd->ppd, QIB_RCVCTRL_INTRAVAIL_ENB, rcd->ctxt);
1112 pollflag = 0; 1112 pollflag = 0;
1113 } else 1113 } else
1114 pollflag = POLLIN | POLLRDNORM; 1114 pollflag = EPOLLIN | EPOLLRDNORM;
1115 spin_unlock_irq(&dd->uctxt_lock); 1115 spin_unlock_irq(&dd->uctxt_lock);
1116 1116
1117 return pollflag; 1117 return pollflag;
@@ -1124,13 +1124,13 @@ static __poll_t qib_poll(struct file *fp, struct poll_table_struct *pt)
1124 1124
1125 rcd = ctxt_fp(fp); 1125 rcd = ctxt_fp(fp);
1126 if (!rcd) 1126 if (!rcd)
1127 pollflag = POLLERR; 1127 pollflag = EPOLLERR;
1128 else if (rcd->poll_type == QIB_POLL_TYPE_URGENT) 1128 else if (rcd->poll_type == QIB_POLL_TYPE_URGENT)
1129 pollflag = qib_poll_urgent(rcd, fp, pt); 1129 pollflag = qib_poll_urgent(rcd, fp, pt);
1130 else if (rcd->poll_type == QIB_POLL_TYPE_ANYRCV) 1130 else if (rcd->poll_type == QIB_POLL_TYPE_ANYRCV)
1131 pollflag = qib_poll_next(rcd, fp, pt); 1131 pollflag = qib_poll_next(rcd, fp, pt);
1132 else /* invalid */ 1132 else /* invalid */
1133 pollflag = POLLERR; 1133 pollflag = EPOLLERR;
1134 1134
1135 return pollflag; 1135 return pollflag;
1136} 1136}
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c
index 19624e023ebd..0336643c2ed6 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -874,7 +874,7 @@ iscsi_iser_ep_poll(struct iscsi_endpoint *ep, int timeout_ms)
874 iser_info("iser conn %p rc = %d\n", iser_conn, rc); 874 iser_info("iser conn %p rc = %d\n", iser_conn, rc);
875 875
876 if (rc > 0) 876 if (rc > 0)
877 return 1; /* success, this is the equivalent of POLLOUT */ 877 return 1; /* success, this is the equivalent of EPOLLOUT */
878 else if (!rc) 878 else if (!rc)
879 return 0; /* timeout */ 879 return 0; /* timeout */
880 else 880 else
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 94049fdc583c..c81c79d01d93 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -650,12 +650,12 @@ static __poll_t evdev_poll(struct file *file, poll_table *wait)
650 poll_wait(file, &evdev->wait, wait); 650 poll_wait(file, &evdev->wait, wait);
651 651
652 if (evdev->exist && !client->revoked) 652 if (evdev->exist && !client->revoked)
653 mask = POLLOUT | POLLWRNORM; 653 mask = EPOLLOUT | EPOLLWRNORM;
654 else 654 else
655 mask = POLLHUP | POLLERR; 655 mask = EPOLLHUP | EPOLLERR;
656 656
657 if (client->packet_head != client->tail) 657 if (client->packet_head != client->tail)
658 mask |= POLLIN | POLLRDNORM; 658 mask |= EPOLLIN | EPOLLRDNORM;
659 659
660 return mask; 660 return mask;
661} 661}
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 0d0b2ab1bb6b..9785546420a7 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -1053,7 +1053,7 @@ static __poll_t input_proc_devices_poll(struct file *file, poll_table *wait)
1053 poll_wait(file, &input_devices_poll_wait, wait); 1053 poll_wait(file, &input_devices_poll_wait, wait);
1054 if (file->f_version != input_devices_state) { 1054 if (file->f_version != input_devices_state) {
1055 file->f_version = input_devices_state; 1055 file->f_version = input_devices_state;
1056 return POLLIN | POLLRDNORM; 1056 return EPOLLIN | EPOLLRDNORM;
1057 } 1057 }
1058 1058
1059 return 0; 1059 return 0;
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index fe3255572886..4c1e427dfabb 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -442,8 +442,8 @@ static __poll_t joydev_poll(struct file *file, poll_table *wait)
442 struct joydev *joydev = client->joydev; 442 struct joydev *joydev = client->joydev;
443 443
444 poll_wait(file, &joydev->wait, wait); 444 poll_wait(file, &joydev->wait, wait);
445 return (joydev_data_pending(client) ? (POLLIN | POLLRDNORM) : 0) | 445 return (joydev_data_pending(client) ? (EPOLLIN | EPOLLRDNORM) : 0) |
446 (joydev->exist ? 0 : (POLLHUP | POLLERR)); 446 (joydev->exist ? 0 : (EPOLLHUP | EPOLLERR));
447} 447}
448 448
449static int joydev_handle_JSIOCSAXMAP(struct joydev *joydev, 449static int joydev_handle_JSIOCSAXMAP(struct joydev *joydev,
diff --git a/drivers/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c
index 9c3f7ec3bd3d..49b34de0aed4 100644
--- a/drivers/input/misc/hp_sdc_rtc.c
+++ b/drivers/input/misc/hp_sdc_rtc.c
@@ -414,7 +414,7 @@ static __poll_t hp_sdc_rtc_poll(struct file *file, poll_table *wait)
414 414
415 l = 0; 415 l = 0;
416 if (l != 0) 416 if (l != 0)
417 return POLLIN | POLLRDNORM; 417 return EPOLLIN | EPOLLRDNORM;
418 return 0; 418 return 0;
419} 419}
420 420
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index f640c591ef23..96a887f33698 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -704,7 +704,7 @@ static __poll_t uinput_poll(struct file *file, poll_table *wait)
704 poll_wait(file, &udev->waitq, wait); 704 poll_wait(file, &udev->waitq, wait);
705 705
706 if (udev->head != udev->tail) 706 if (udev->head != udev->tail)
707 return POLLIN | POLLRDNORM; 707 return EPOLLIN | EPOLLRDNORM;
708 708
709 return 0; 709 return 0;
710} 710}
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index 731d84ae5101..e08228061bcd 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -765,9 +765,9 @@ static __poll_t mousedev_poll(struct file *file, poll_table *wait)
765 765
766 poll_wait(file, &mousedev->wait, wait); 766 poll_wait(file, &mousedev->wait, wait);
767 767
768 mask = mousedev->exist ? POLLOUT | POLLWRNORM : POLLHUP | POLLERR; 768 mask = mousedev->exist ? EPOLLOUT | EPOLLWRNORM : EPOLLHUP | EPOLLERR;
769 if (client->ready || client->buffer) 769 if (client->ready || client->buffer)
770 mask |= POLLIN | POLLRDNORM; 770 mask |= EPOLLIN | EPOLLRDNORM;
771 771
772 return mask; 772 return mask;
773} 773}
diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c
index fccf55a380b2..17b7fbecd9fe 100644
--- a/drivers/input/serio/serio_raw.c
+++ b/drivers/input/serio/serio_raw.c
@@ -247,9 +247,9 @@ static __poll_t serio_raw_poll(struct file *file, poll_table *wait)
247 247
248 poll_wait(file, &serio_raw->wait, wait); 248 poll_wait(file, &serio_raw->wait, wait);
249 249
250 mask = serio_raw->dead ? POLLHUP | POLLERR : POLLOUT | POLLWRNORM; 250 mask = serio_raw->dead ? EPOLLHUP | EPOLLERR : EPOLLOUT | EPOLLWRNORM;
251 if (serio_raw->head != serio_raw->tail) 251 if (serio_raw->head != serio_raw->tail)
252 mask |= POLLIN | POLLRDNORM; 252 mask |= EPOLLIN | EPOLLRDNORM;
253 253
254 return mask; 254 return mask;
255} 255}
diff --git a/drivers/input/serio/userio.c b/drivers/input/serio/userio.c
index a63de06b08bc..9ab5c45c3a9f 100644
--- a/drivers/input/serio/userio.c
+++ b/drivers/input/serio/userio.c
@@ -255,7 +255,7 @@ static __poll_t userio_char_poll(struct file *file, poll_table *wait)
255 poll_wait(file, &userio->waitq, wait); 255 poll_wait(file, &userio->waitq, wait);
256 256
257 if (userio->head != userio->tail) 257 if (userio->head != userio->tail)
258 return POLLIN | POLLRDNORM; 258 return EPOLLIN | EPOLLRDNORM;
259 259
260 return 0; 260 return 0;
261} 261}
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index e268811dc544..19cd93783c87 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -731,12 +731,12 @@ capi_poll(struct file *file, poll_table *wait)
731 __poll_t mask = 0; 731 __poll_t mask = 0;
732 732
733 if (!cdev->ap.applid) 733 if (!cdev->ap.applid)
734 return POLLERR; 734 return EPOLLERR;
735 735
736 poll_wait(file, &(cdev->recvwait), wait); 736 poll_wait(file, &(cdev->recvwait), wait);
737 mask = POLLOUT | POLLWRNORM; 737 mask = EPOLLOUT | EPOLLWRNORM;
738 if (!skb_queue_empty(&cdev->recvqueue)) 738 if (!skb_queue_empty(&cdev->recvqueue))
739 mask |= POLLIN | POLLRDNORM; 739 mask |= EPOLLIN | EPOLLRDNORM;
740 return mask; 740 return mask;
741} 741}
742 742
diff --git a/drivers/isdn/divert/divert_procfs.c b/drivers/isdn/divert/divert_procfs.c
index 34b7704042a4..342585e04fd3 100644
--- a/drivers/isdn/divert/divert_procfs.c
+++ b/drivers/isdn/divert/divert_procfs.c
@@ -125,9 +125,9 @@ isdn_divert_poll(struct file *file, poll_table *wait)
125 __poll_t mask = 0; 125 __poll_t mask = 0;
126 126
127 poll_wait(file, &(rd_queue), wait); 127 poll_wait(file, &(rd_queue), wait);
128 /* mask = POLLOUT | POLLWRNORM; */ 128 /* mask = EPOLLOUT | EPOLLWRNORM; */
129 if (*((struct divert_info **) file->private_data)) { 129 if (*((struct divert_info **) file->private_data)) {
130 mask |= POLLIN | POLLRDNORM; 130 mask |= EPOLLIN | EPOLLRDNORM;
131 } 131 }
132 return mask; 132 return mask;
133} /* isdn_divert_poll */ 133} /* isdn_divert_poll */
diff --git a/drivers/isdn/hardware/eicon/divamnt.c b/drivers/isdn/hardware/eicon/divamnt.c
index 70f16102a001..5a95587b3117 100644
--- a/drivers/isdn/hardware/eicon/divamnt.c
+++ b/drivers/isdn/hardware/eicon/divamnt.c
@@ -103,9 +103,9 @@ static __poll_t maint_poll(struct file *file, poll_table *wait)
103 __poll_t mask = 0; 103 __poll_t mask = 0;
104 104
105 poll_wait(file, &msgwaitq, wait); 105 poll_wait(file, &msgwaitq, wait);
106 mask = POLLOUT | POLLWRNORM; 106 mask = EPOLLOUT | EPOLLWRNORM;
107 if (file->private_data || diva_dbg_q_length()) { 107 if (file->private_data || diva_dbg_q_length()) {
108 mask |= POLLIN | POLLRDNORM; 108 mask |= EPOLLIN | EPOLLRDNORM;
109 } 109 }
110 return (mask); 110 return (mask);
111} 111}
diff --git a/drivers/isdn/hardware/eicon/divasi.c b/drivers/isdn/hardware/eicon/divasi.c
index da5cc5ab7e2d..525518c945fe 100644
--- a/drivers/isdn/hardware/eicon/divasi.c
+++ b/drivers/isdn/hardware/eicon/divasi.c
@@ -370,31 +370,31 @@ static __poll_t um_idi_poll(struct file *file, poll_table *wait)
370 diva_um_idi_os_context_t *p_os; 370 diva_um_idi_os_context_t *p_os;
371 371
372 if (!file->private_data) { 372 if (!file->private_data) {
373 return (POLLERR); 373 return (EPOLLERR);
374 } 374 }
375 375
376 if ((!(p_os = 376 if ((!(p_os =
377 (diva_um_idi_os_context_t *) 377 (diva_um_idi_os_context_t *)
378 diva_um_id_get_os_context(file->private_data))) 378 diva_um_id_get_os_context(file->private_data)))
379 || p_os->aborted) { 379 || p_os->aborted) {
380 return (POLLERR); 380 return (EPOLLERR);
381 } 381 }
382 382
383 poll_wait(file, &p_os->read_wait, wait); 383 poll_wait(file, &p_os->read_wait, wait);
384 384
385 if (p_os->aborted) { 385 if (p_os->aborted) {
386 return (POLLERR); 386 return (EPOLLERR);
387 } 387 }
388 388
389 switch (diva_user_mode_idi_ind_ready(file->private_data, file)) { 389 switch (diva_user_mode_idi_ind_ready(file->private_data, file)) {
390 case (-1): 390 case (-1):
391 return (POLLERR); 391 return (EPOLLERR);
392 392
393 case 0: 393 case 0:
394 return (0); 394 return (0);
395 } 395 }
396 396
397 return (POLLIN | POLLRDNORM); 397 return (EPOLLIN | EPOLLRDNORM);
398} 398}
399 399
400static int um_idi_open(struct inode *inode, struct file *file) 400static int um_idi_open(struct inode *inode, struct file *file)
diff --git a/drivers/isdn/hardware/eicon/divasmain.c b/drivers/isdn/hardware/eicon/divasmain.c
index fbc788e6f0db..b9980e84f9db 100644
--- a/drivers/isdn/hardware/eicon/divasmain.c
+++ b/drivers/isdn/hardware/eicon/divasmain.c
@@ -653,9 +653,9 @@ static ssize_t divas_read(struct file *file, char __user *buf,
653static __poll_t divas_poll(struct file *file, poll_table *wait) 653static __poll_t divas_poll(struct file *file, poll_table *wait)
654{ 654{
655 if (!file->private_data) { 655 if (!file->private_data) {
656 return (POLLERR); 656 return (EPOLLERR);
657 } 657 }
658 return (POLLIN | POLLRDNORM); 658 return (EPOLLIN | EPOLLRDNORM);
659} 659}
660 660
661static const struct file_operations divas_fops = { 661static const struct file_operations divas_fops = {
diff --git a/drivers/isdn/hardware/eicon/divasproc.c b/drivers/isdn/hardware/eicon/divasproc.c
index 3478f6f099eb..f52f4622b10b 100644
--- a/drivers/isdn/hardware/eicon/divasproc.c
+++ b/drivers/isdn/hardware/eicon/divasproc.c
@@ -101,7 +101,7 @@ divas_write(struct file *file, const char __user *buf, size_t count, loff_t *off
101 101
102static __poll_t divas_poll(struct file *file, poll_table *wait) 102static __poll_t divas_poll(struct file *file, poll_table *wait)
103{ 103{
104 return (POLLERR); 104 return (EPOLLERR);
105} 105}
106 106
107static int divas_open(struct inode *inode, struct file *file) 107static int divas_open(struct inode *inode, struct file *file)
diff --git a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c
index 6abea6915f49..6e898b90e86e 100644
--- a/drivers/isdn/hysdn/hysdn_proclog.c
+++ b/drivers/isdn/hysdn/hysdn_proclog.c
@@ -294,7 +294,7 @@ hysdn_log_poll(struct file *file, poll_table *wait)
294 poll_wait(file, &(pd->rd_queue), wait); 294 poll_wait(file, &(pd->rd_queue), wait);
295 295
296 if (*((struct log_data **) file->private_data)) 296 if (*((struct log_data **) file->private_data))
297 mask |= POLLIN | POLLRDNORM; 297 mask |= EPOLLIN | EPOLLRDNORM;
298 298
299 return mask; 299 return mask;
300} /* hysdn_log_poll */ 300} /* hysdn_log_poll */
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index 0521c32949d4..7c6f3f5d9d9a 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -1237,22 +1237,22 @@ isdn_poll(struct file *file, poll_table *wait)
1237 mutex_lock(&isdn_mutex); 1237 mutex_lock(&isdn_mutex);
1238 if (minor == ISDN_MINOR_STATUS) { 1238 if (minor == ISDN_MINOR_STATUS) {
1239 poll_wait(file, &(dev->info_waitq), wait); 1239 poll_wait(file, &(dev->info_waitq), wait);
1240 /* mask = POLLOUT | POLLWRNORM; */ 1240 /* mask = EPOLLOUT | EPOLLWRNORM; */
1241 if (file->private_data) { 1241 if (file->private_data) {
1242 mask |= POLLIN | POLLRDNORM; 1242 mask |= EPOLLIN | EPOLLRDNORM;
1243 } 1243 }
1244 goto out; 1244 goto out;
1245 } 1245 }
1246 if (minor >= ISDN_MINOR_CTRL && minor <= ISDN_MINOR_CTRLMAX) { 1246 if (minor >= ISDN_MINOR_CTRL && minor <= ISDN_MINOR_CTRLMAX) {
1247 if (drvidx < 0) { 1247 if (drvidx < 0) {
1248 /* driver deregistered while file open */ 1248 /* driver deregistered while file open */
1249 mask = POLLHUP; 1249 mask = EPOLLHUP;
1250 goto out; 1250 goto out;
1251 } 1251 }
1252 poll_wait(file, &(dev->drv[drvidx]->st_waitq), wait); 1252 poll_wait(file, &(dev->drv[drvidx]->st_waitq), wait);
1253 mask = POLLOUT | POLLWRNORM; 1253 mask = EPOLLOUT | EPOLLWRNORM;
1254 if (dev->drv[drvidx]->stavail) { 1254 if (dev->drv[drvidx]->stavail) {
1255 mask |= POLLIN | POLLRDNORM; 1255 mask |= EPOLLIN | EPOLLRDNORM;
1256 } 1256 }
1257 goto out; 1257 goto out;
1258 } 1258 }
@@ -1262,7 +1262,7 @@ isdn_poll(struct file *file, poll_table *wait)
1262 goto out; 1262 goto out;
1263 } 1263 }
1264#endif 1264#endif
1265 mask = POLLERR; 1265 mask = EPOLLERR;
1266out: 1266out:
1267 mutex_unlock(&isdn_mutex); 1267 mutex_unlock(&isdn_mutex);
1268 return mask; 1268 return mask;
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
index 57884319b4b1..a7b275ea5de1 100644
--- a/drivers/isdn/i4l/isdn_ppp.c
+++ b/drivers/isdn/i4l/isdn_ppp.c
@@ -704,12 +704,12 @@ isdn_ppp_poll(struct file *file, poll_table *wait)
704 704
705 if (!(is->state & IPPP_OPEN)) { 705 if (!(is->state & IPPP_OPEN)) {
706 if (is->state == IPPP_CLOSEWAIT) 706 if (is->state == IPPP_CLOSEWAIT)
707 return POLLHUP; 707 return EPOLLHUP;
708 printk(KERN_DEBUG "isdn_ppp: device not open\n"); 708 printk(KERN_DEBUG "isdn_ppp: device not open\n");
709 return POLLERR; 709 return EPOLLERR;
710 } 710 }
711 /* we're always ready to send .. */ 711 /* we're always ready to send .. */
712 mask = POLLOUT | POLLWRNORM; 712 mask = EPOLLOUT | EPOLLWRNORM;
713 713
714 spin_lock_irqsave(&is->buflock, flags); 714 spin_lock_irqsave(&is->buflock, flags);
715 bl = is->last; 715 bl = is->last;
@@ -719,7 +719,7 @@ isdn_ppp_poll(struct file *file, poll_table *wait)
719 */ 719 */
720 if (bf->next != bl || (is->state & IPPP_NOBLOCK)) { 720 if (bf->next != bl || (is->state & IPPP_NOBLOCK)) {
721 is->state &= ~IPPP_NOBLOCK; 721 is->state &= ~IPPP_NOBLOCK;
722 mask |= POLLIN | POLLRDNORM; 722 mask |= EPOLLIN | EPOLLRDNORM;
723 } 723 }
724 spin_unlock_irqrestore(&is->buflock, flags); 724 spin_unlock_irqrestore(&is->buflock, flags);
725 return mask; 725 return mask;
diff --git a/drivers/isdn/mISDN/timerdev.c b/drivers/isdn/mISDN/timerdev.c
index f4272d4e0a26..211ed6cffd10 100644
--- a/drivers/isdn/mISDN/timerdev.c
+++ b/drivers/isdn/mISDN/timerdev.c
@@ -145,7 +145,7 @@ static __poll_t
145mISDN_poll(struct file *filep, poll_table *wait) 145mISDN_poll(struct file *filep, poll_table *wait)
146{ 146{
147 struct mISDNtimerdev *dev = filep->private_data; 147 struct mISDNtimerdev *dev = filep->private_data;
148 __poll_t mask = POLLERR; 148 __poll_t mask = EPOLLERR;
149 149
150 if (*debug & DEBUG_TIMER) 150 if (*debug & DEBUG_TIMER)
151 printk(KERN_DEBUG "%s(%p, %p)\n", __func__, filep, wait); 151 printk(KERN_DEBUG "%s(%p, %p)\n", __func__, filep, wait);
@@ -153,7 +153,7 @@ mISDN_poll(struct file *filep, poll_table *wait)
153 poll_wait(filep, &dev->wait, wait); 153 poll_wait(filep, &dev->wait, wait);
154 mask = 0; 154 mask = 0;
155 if (dev->work || !list_empty(&dev->expired)) 155 if (dev->work || !list_empty(&dev->expired))
156 mask |= (POLLIN | POLLRDNORM); 156 mask |= (EPOLLIN | EPOLLRDNORM);
157 if (*debug & DEBUG_TIMER) 157 if (*debug & DEBUG_TIMER)
158 printk(KERN_DEBUG "%s work(%d) empty(%d)\n", __func__, 158 printk(KERN_DEBUG "%s work(%d) empty(%d)\n", __func__,
159 dev->work, list_empty(&dev->expired)); 159 dev->work, list_empty(&dev->expired));
diff --git a/drivers/leds/uleds.c b/drivers/leds/uleds.c
index 5beacab05ed7..0c43bfac9598 100644
--- a/drivers/leds/uleds.c
+++ b/drivers/leds/uleds.c
@@ -183,7 +183,7 @@ static __poll_t uleds_poll(struct file *file, poll_table *wait)
183 poll_wait(file, &udev->waitq, wait); 183 poll_wait(file, &udev->waitq, wait);
184 184
185 if (udev->new_data) 185 if (udev->new_data)
186 return POLLIN | POLLRDNORM; 186 return EPOLLIN | EPOLLRDNORM;
187 187
188 return 0; 188 return 0;
189} 189}
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index 346e6f5f77be..e8ae2e54151c 100644
--- a/drivers/macintosh/smu.c
+++ b/drivers/macintosh/smu.c
@@ -1259,7 +1259,7 @@ static __poll_t smu_fpoll(struct file *file, poll_table *wait)
1259 1259
1260 spin_lock_irqsave(&pp->lock, flags); 1260 spin_lock_irqsave(&pp->lock, flags);
1261 if (pp->busy && pp->cmd.status != 1) 1261 if (pp->busy && pp->cmd.status != 1)
1262 mask |= POLLIN; 1262 mask |= EPOLLIN;
1263 spin_unlock_irqrestore(&pp->lock, flags); 1263 spin_unlock_irqrestore(&pp->lock, flags);
1264 } 1264 }
1265 if (pp->mode == smu_file_events) { 1265 if (pp->mode == smu_file_events) {
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index 08849e33c567..94c0f3f7df69 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -2169,7 +2169,7 @@ pmu_fpoll(struct file *filp, poll_table *wait)
2169 poll_wait(filp, &pp->wait, wait); 2169 poll_wait(filp, &pp->wait, wait);
2170 spin_lock_irqsave(&pp->lock, flags); 2170 spin_lock_irqsave(&pp->lock, flags);
2171 if (pp->rb_get != pp->rb_put) 2171 if (pp->rb_get != pp->rb_put)
2172 mask |= POLLIN; 2172 mask |= EPOLLIN;
2173 spin_unlock_irqrestore(&pp->lock, flags); 2173 spin_unlock_irqrestore(&pp->lock, flags);
2174 return mask; 2174 return mask;
2175} 2175}
diff --git a/drivers/mailbox/mailbox-test.c b/drivers/mailbox/mailbox-test.c
index f84730d63b1f..58bfafc34bc4 100644
--- a/drivers/mailbox/mailbox-test.c
+++ b/drivers/mailbox/mailbox-test.c
@@ -243,7 +243,7 @@ mbox_test_message_poll(struct file *filp, struct poll_table_struct *wait)
243 poll_wait(filp, &tdev->waitq, wait); 243 poll_wait(filp, &tdev->waitq, wait);
244 244
245 if (mbox_test_message_data_ready(tdev)) 245 if (mbox_test_message_data_ready(tdev))
246 return POLLIN | POLLRDNORM; 246 return EPOLLIN | EPOLLRDNORM;
247 return 0; 247 return 0;
248} 248}
249 249
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index 3f6791afd3e4..a89fd8f44453 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -1937,7 +1937,7 @@ static __poll_t dm_poll(struct file *filp, poll_table *wait)
1937 poll_wait(filp, &dm_global_eventq, wait); 1937 poll_wait(filp, &dm_global_eventq, wait);
1938 1938
1939 if ((int)(atomic_read(&dm_global_event_nr) - priv->global_event_nr) > 0) 1939 if ((int)(atomic_read(&dm_global_event_nr) - priv->global_event_nr) > 0)
1940 mask |= POLLIN; 1940 mask |= EPOLLIN;
1941 1941
1942 return mask; 1942 return mask;
1943} 1943}
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 0081ace39a64..bc67ab6844f0 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -7891,14 +7891,14 @@ static __poll_t mdstat_poll(struct file *filp, poll_table *wait)
7891 __poll_t mask; 7891 __poll_t mask;
7892 7892
7893 if (md_unloading) 7893 if (md_unloading)
7894 return POLLIN|POLLRDNORM|POLLERR|POLLPRI; 7894 return EPOLLIN|EPOLLRDNORM|EPOLLERR|EPOLLPRI;
7895 poll_wait(filp, &md_event_waiters, wait); 7895 poll_wait(filp, &md_event_waiters, wait);
7896 7896
7897 /* always allow read */ 7897 /* always allow read */
7898 mask = POLLIN | POLLRDNORM; 7898 mask = EPOLLIN | EPOLLRDNORM;
7899 7899
7900 if (seq->poll_event != atomic_read(&md_event_count)) 7900 if (seq->poll_event != atomic_read(&md_event_count))
7901 mask |= POLLERR | POLLPRI; 7901 mask |= EPOLLERR | EPOLLPRI;
7902 return mask; 7902 return mask;
7903} 7903}
7904 7904
diff --git a/drivers/media/cec/cec-api.c b/drivers/media/cec/cec-api.c
index ecc89d9a279b..492db12b8c4d 100644
--- a/drivers/media/cec/cec-api.c
+++ b/drivers/media/cec/cec-api.c
@@ -51,15 +51,15 @@ static __poll_t cec_poll(struct file *filp,
51 __poll_t res = 0; 51 __poll_t res = 0;
52 52
53 if (!cec_is_registered(adap)) 53 if (!cec_is_registered(adap))
54 return POLLERR | POLLHUP; 54 return EPOLLERR | EPOLLHUP;
55 mutex_lock(&adap->lock); 55 mutex_lock(&adap->lock);
56 if (adap->is_configured && 56 if (adap->is_configured &&
57 adap->transmit_queue_sz < CEC_MAX_MSG_TX_QUEUE_SZ) 57 adap->transmit_queue_sz < CEC_MAX_MSG_TX_QUEUE_SZ)
58 res |= POLLOUT | POLLWRNORM; 58 res |= EPOLLOUT | EPOLLWRNORM;
59 if (fh->queued_msgs) 59 if (fh->queued_msgs)
60 res |= POLLIN | POLLRDNORM; 60 res |= EPOLLIN | EPOLLRDNORM;
61 if (fh->total_queued_events) 61 if (fh->total_queued_events)
62 res |= POLLPRI; 62 res |= EPOLLPRI;
63 poll_wait(filp, &fh->wait, poll); 63 poll_wait(filp, &fh->wait, poll);
64 mutex_unlock(&adap->lock); 64 mutex_unlock(&adap->lock);
65 return res; 65 return res;
diff --git a/drivers/media/common/saa7146/saa7146_fops.c b/drivers/media/common/saa7146/saa7146_fops.c
index 8ee3eebef4db..d4987fd05d05 100644
--- a/drivers/media/common/saa7146/saa7146_fops.c
+++ b/drivers/media/common/saa7146/saa7146_fops.c
@@ -332,7 +332,7 @@ static __poll_t __fops_poll(struct file *file, struct poll_table_struct *wait)
332 332
333 if (vdev->vfl_type == VFL_TYPE_VBI) { 333 if (vdev->vfl_type == VFL_TYPE_VBI) {
334 if (fh->dev->ext_vv_data->capabilities & V4L2_CAP_SLICED_VBI_OUTPUT) 334 if (fh->dev->ext_vv_data->capabilities & V4L2_CAP_SLICED_VBI_OUTPUT)
335 return res | POLLOUT | POLLWRNORM; 335 return res | EPOLLOUT | EPOLLWRNORM;
336 if( 0 == fh->vbi_q.streaming ) 336 if( 0 == fh->vbi_q.streaming )
337 return res | videobuf_poll_stream(file, &fh->vbi_q, wait); 337 return res | videobuf_poll_stream(file, &fh->vbi_q, wait);
338 q = &fh->vbi_q; 338 q = &fh->vbi_q;
@@ -346,13 +346,13 @@ static __poll_t __fops_poll(struct file *file, struct poll_table_struct *wait)
346 346
347 if (!buf) { 347 if (!buf) {
348 DEB_D("buf == NULL!\n"); 348 DEB_D("buf == NULL!\n");
349 return res | POLLERR; 349 return res | EPOLLERR;
350 } 350 }
351 351
352 poll_wait(file, &buf->done, wait); 352 poll_wait(file, &buf->done, wait);
353 if (buf->state == VIDEOBUF_DONE || buf->state == VIDEOBUF_ERROR) { 353 if (buf->state == VIDEOBUF_DONE || buf->state == VIDEOBUF_ERROR) {
354 DEB_D("poll succeeded!\n"); 354 DEB_D("poll succeeded!\n");
355 return res | POLLIN | POLLRDNORM; 355 return res | EPOLLIN | EPOLLRDNORM;
356 } 356 }
357 357
358 DEB_D("nothing to poll for, buf->state:%d\n", buf->state); 358 DEB_D("nothing to poll for, buf->state:%d\n", buf->state);
diff --git a/drivers/media/common/siano/smsdvb-debugfs.c b/drivers/media/common/siano/smsdvb-debugfs.c
index 403645fe9079..40891f4f842b 100644
--- a/drivers/media/common/siano/smsdvb-debugfs.c
+++ b/drivers/media/common/siano/smsdvb-debugfs.c
@@ -371,7 +371,7 @@ static __poll_t smsdvb_stats_poll(struct file *file, poll_table *wait)
371 rc = smsdvb_stats_wait_read(debug_data); 371 rc = smsdvb_stats_wait_read(debug_data);
372 kref_put(&debug_data->refcount, smsdvb_debugfs_data_release); 372 kref_put(&debug_data->refcount, smsdvb_debugfs_data_release);
373 373
374 return rc > 0 ? POLLIN | POLLRDNORM : 0; 374 return rc > 0 ? EPOLLIN | EPOLLRDNORM : 0;
375} 375}
376 376
377static ssize_t smsdvb_stats_read(struct file *file, char __user *user_buf, 377static ssize_t smsdvb_stats_read(struct file *file, char __user *user_buf,
diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c
index 9a84c7092714..debe35fc66b4 100644
--- a/drivers/media/common/videobuf2/videobuf2-core.c
+++ b/drivers/media/common/videobuf2/videobuf2-core.c
@@ -2038,9 +2038,9 @@ __poll_t vb2_core_poll(struct vb2_queue *q, struct file *file,
2038 struct vb2_buffer *vb = NULL; 2038 struct vb2_buffer *vb = NULL;
2039 unsigned long flags; 2039 unsigned long flags;
2040 2040
2041 if (!q->is_output && !(req_events & (POLLIN | POLLRDNORM))) 2041 if (!q->is_output && !(req_events & (EPOLLIN | EPOLLRDNORM)))
2042 return 0; 2042 return 0;
2043 if (q->is_output && !(req_events & (POLLOUT | POLLWRNORM))) 2043 if (q->is_output && !(req_events & (EPOLLOUT | EPOLLWRNORM)))
2044 return 0; 2044 return 0;
2045 2045
2046 /* 2046 /*
@@ -2048,18 +2048,18 @@ __poll_t vb2_core_poll(struct vb2_queue *q, struct file *file,
2048 */ 2048 */
2049 if (q->num_buffers == 0 && !vb2_fileio_is_active(q)) { 2049 if (q->num_buffers == 0 && !vb2_fileio_is_active(q)) {
2050 if (!q->is_output && (q->io_modes & VB2_READ) && 2050 if (!q->is_output && (q->io_modes & VB2_READ) &&
2051 (req_events & (POLLIN | POLLRDNORM))) { 2051 (req_events & (EPOLLIN | EPOLLRDNORM))) {
2052 if (__vb2_init_fileio(q, 1)) 2052 if (__vb2_init_fileio(q, 1))
2053 return POLLERR; 2053 return EPOLLERR;
2054 } 2054 }
2055 if (q->is_output && (q->io_modes & VB2_WRITE) && 2055 if (q->is_output && (q->io_modes & VB2_WRITE) &&
2056 (req_events & (POLLOUT | POLLWRNORM))) { 2056 (req_events & (EPOLLOUT | EPOLLWRNORM))) {
2057 if (__vb2_init_fileio(q, 0)) 2057 if (__vb2_init_fileio(q, 0))
2058 return POLLERR; 2058 return EPOLLERR;
2059 /* 2059 /*
2060 * Write to OUTPUT queue can be done immediately. 2060 * Write to OUTPUT queue can be done immediately.
2061 */ 2061 */
2062 return POLLOUT | POLLWRNORM; 2062 return EPOLLOUT | EPOLLWRNORM;
2063 } 2063 }
2064 } 2064 }
2065 2065
@@ -2068,24 +2068,24 @@ __poll_t vb2_core_poll(struct vb2_queue *q, struct file *file,
2068 * error flag is set. 2068 * error flag is set.
2069 */ 2069 */
2070 if (!vb2_is_streaming(q) || q->error) 2070 if (!vb2_is_streaming(q) || q->error)
2071 return POLLERR; 2071 return EPOLLERR;
2072 2072
2073 /* 2073 /*
2074 * If this quirk is set and QBUF hasn't been called yet then 2074 * If this quirk is set and QBUF hasn't been called yet then
2075 * return POLLERR as well. This only affects capture queues, output 2075 * return EPOLLERR as well. This only affects capture queues, output
2076 * queues will always initialize waiting_for_buffers to false. 2076 * queues will always initialize waiting_for_buffers to false.
2077 * This quirk is set by V4L2 for backwards compatibility reasons. 2077 * This quirk is set by V4L2 for backwards compatibility reasons.
2078 */ 2078 */
2079 if (q->quirk_poll_must_check_waiting_for_buffers && 2079 if (q->quirk_poll_must_check_waiting_for_buffers &&
2080 q->waiting_for_buffers && (req_events & (POLLIN | POLLRDNORM))) 2080 q->waiting_for_buffers && (req_events & (EPOLLIN | EPOLLRDNORM)))
2081 return POLLERR; 2081 return EPOLLERR;
2082 2082
2083 /* 2083 /*
2084 * For output streams you can call write() as long as there are fewer 2084 * For output streams you can call write() as long as there are fewer
2085 * buffers queued than there are buffers available. 2085 * buffers queued than there are buffers available.
2086 */ 2086 */
2087 if (q->is_output && q->fileio && q->queued_count < q->num_buffers) 2087 if (q->is_output && q->fileio && q->queued_count < q->num_buffers)
2088 return POLLOUT | POLLWRNORM; 2088 return EPOLLOUT | EPOLLWRNORM;
2089 2089
2090 if (list_empty(&q->done_list)) { 2090 if (list_empty(&q->done_list)) {
2091 /* 2091 /*
@@ -2093,7 +2093,7 @@ __poll_t vb2_core_poll(struct vb2_queue *q, struct file *file,
2093 * return immediately. DQBUF will return -EPIPE. 2093 * return immediately. DQBUF will return -EPIPE.
2094 */ 2094 */
2095 if (q->last_buffer_dequeued) 2095 if (q->last_buffer_dequeued)
2096 return POLLIN | POLLRDNORM; 2096 return EPOLLIN | EPOLLRDNORM;
2097 2097
2098 poll_wait(file, &q->done_wq, wait); 2098 poll_wait(file, &q->done_wq, wait);
2099 } 2099 }
@@ -2110,8 +2110,8 @@ __poll_t vb2_core_poll(struct vb2_queue *q, struct file *file,
2110 if (vb && (vb->state == VB2_BUF_STATE_DONE 2110 if (vb && (vb->state == VB2_BUF_STATE_DONE
2111 || vb->state == VB2_BUF_STATE_ERROR)) { 2111 || vb->state == VB2_BUF_STATE_ERROR)) {
2112 return (q->is_output) ? 2112 return (q->is_output) ?
2113 POLLOUT | POLLWRNORM : 2113 EPOLLOUT | EPOLLWRNORM :
2114 POLLIN | POLLRDNORM; 2114 EPOLLIN | EPOLLRDNORM;
2115 } 2115 }
2116 return 0; 2116 return 0;
2117} 2117}
diff --git a/drivers/media/common/videobuf2/videobuf2-v4l2.c b/drivers/media/common/videobuf2/videobuf2-v4l2.c
index d9a487aab99c..886a2d8d5c6c 100644
--- a/drivers/media/common/videobuf2/videobuf2-v4l2.c
+++ b/drivers/media/common/videobuf2/videobuf2-v4l2.c
@@ -658,7 +658,7 @@ int vb2_queue_init(struct vb2_queue *q)
658 == V4L2_BUF_FLAG_TIMESTAMP_COPY; 658 == V4L2_BUF_FLAG_TIMESTAMP_COPY;
659 /* 659 /*
660 * For compatibility with vb1: if QBUF hasn't been called yet, then 660 * For compatibility with vb1: if QBUF hasn't been called yet, then
661 * return POLLERR as well. This only affects capture queues, output 661 * return EPOLLERR as well. This only affects capture queues, output
662 * queues will always initialize waiting_for_buffers to false. 662 * queues will always initialize waiting_for_buffers to false.
663 */ 663 */
664 q->quirk_poll_must_check_waiting_for_buffers = true; 664 q->quirk_poll_must_check_waiting_for_buffers = true;
@@ -683,8 +683,8 @@ __poll_t vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait)
683 struct v4l2_fh *fh = file->private_data; 683 struct v4l2_fh *fh = file->private_data;
684 684
685 if (v4l2_event_pending(fh)) 685 if (v4l2_event_pending(fh))
686 res = POLLPRI; 686 res = EPOLLPRI;
687 else if (req_events & POLLPRI) 687 else if (req_events & EPOLLPRI)
688 poll_wait(file, &fh->wait, wait); 688 poll_wait(file, &fh->wait, wait);
689 } 689 }
690 690
@@ -921,7 +921,7 @@ __poll_t vb2_fop_poll(struct file *file, poll_table *wait)
921 WARN_ON(!lock); 921 WARN_ON(!lock);
922 922
923 if (lock && mutex_lock_interruptible(lock)) 923 if (lock && mutex_lock_interruptible(lock))
924 return POLLERR; 924 return EPOLLERR;
925 925
926 fileio = q->fileio; 926 fileio = q->fileio;
927 927
diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c
index bc198f84b9cd..6d53af00190e 100644
--- a/drivers/media/dvb-core/dmxdev.c
+++ b/drivers/media/dvb-core/dmxdev.c
@@ -1179,7 +1179,7 @@ static __poll_t dvb_demux_poll(struct file *file, poll_table *wait)
1179 __poll_t mask = 0; 1179 __poll_t mask = 0;
1180 1180
1181 if ((!dmxdevfilter) || dmxdevfilter->dev->exit) 1181 if ((!dmxdevfilter) || dmxdevfilter->dev->exit)
1182 return POLLERR; 1182 return EPOLLERR;
1183 if (dvb_vb2_is_streaming(&dmxdevfilter->vb2_ctx)) 1183 if (dvb_vb2_is_streaming(&dmxdevfilter->vb2_ctx))
1184 return dvb_vb2_poll(&dmxdevfilter->vb2_ctx, file, wait); 1184 return dvb_vb2_poll(&dmxdevfilter->vb2_ctx, file, wait);
1185 1185
@@ -1191,10 +1191,10 @@ static __poll_t dvb_demux_poll(struct file *file, poll_table *wait)
1191 return 0; 1191 return 0;
1192 1192
1193 if (dmxdevfilter->buffer.error) 1193 if (dmxdevfilter->buffer.error)
1194 mask |= (POLLIN | POLLRDNORM | POLLPRI | POLLERR); 1194 mask |= (EPOLLIN | EPOLLRDNORM | EPOLLPRI | EPOLLERR);
1195 1195
1196 if (!dvb_ringbuffer_empty(&dmxdevfilter->buffer)) 1196 if (!dvb_ringbuffer_empty(&dmxdevfilter->buffer))
1197 mask |= (POLLIN | POLLRDNORM | POLLPRI); 1197 mask |= (EPOLLIN | EPOLLRDNORM | EPOLLPRI);
1198 1198
1199 return mask; 1199 return mask;
1200} 1200}
@@ -1331,7 +1331,7 @@ static __poll_t dvb_dvr_poll(struct file *file, poll_table *wait)
1331 dprintk("%s\n", __func__); 1331 dprintk("%s\n", __func__);
1332 1332
1333 if (dmxdev->exit) 1333 if (dmxdev->exit)
1334 return POLLERR; 1334 return EPOLLERR;
1335 if (dvb_vb2_is_streaming(&dmxdev->dvr_vb2_ctx)) 1335 if (dvb_vb2_is_streaming(&dmxdev->dvr_vb2_ctx))
1336 return dvb_vb2_poll(&dmxdev->dvr_vb2_ctx, file, wait); 1336 return dvb_vb2_poll(&dmxdev->dvr_vb2_ctx, file, wait);
1337 1337
@@ -1343,12 +1343,12 @@ static __poll_t dvb_dvr_poll(struct file *file, poll_table *wait)
1343#endif 1343#endif
1344 if (need_ringbuffer) { 1344 if (need_ringbuffer) {
1345 if (dmxdev->dvr_buffer.error) 1345 if (dmxdev->dvr_buffer.error)
1346 mask |= (POLLIN | POLLRDNORM | POLLPRI | POLLERR); 1346 mask |= (EPOLLIN | EPOLLRDNORM | EPOLLPRI | EPOLLERR);
1347 1347
1348 if (!dvb_ringbuffer_empty(&dmxdev->dvr_buffer)) 1348 if (!dvb_ringbuffer_empty(&dmxdev->dvr_buffer))
1349 mask |= (POLLIN | POLLRDNORM | POLLPRI); 1349 mask |= (EPOLLIN | EPOLLRDNORM | EPOLLPRI);
1350 } else 1350 } else
1351 mask |= (POLLOUT | POLLWRNORM | POLLPRI); 1351 mask |= (EPOLLOUT | EPOLLWRNORM | EPOLLPRI);
1352 1352
1353 return mask; 1353 return mask;
1354} 1354}
diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb-core/dvb_ca_en50221.c
index b462ebc0c544..204d0f6c678d 100644
--- a/drivers/media/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb-core/dvb_ca_en50221.c
@@ -1796,7 +1796,7 @@ static __poll_t dvb_ca_en50221_io_poll(struct file *file, poll_table *wait)
1796 dprintk("%s\n", __func__); 1796 dprintk("%s\n", __func__);
1797 1797
1798 if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) 1798 if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1)
1799 mask |= POLLIN; 1799 mask |= EPOLLIN;
1800 1800
1801 /* if there is something, return now */ 1801 /* if there is something, return now */
1802 if (mask) 1802 if (mask)
@@ -1806,7 +1806,7 @@ static __poll_t dvb_ca_en50221_io_poll(struct file *file, poll_table *wait)
1806 poll_wait(file, &ca->wait_queue, wait); 1806 poll_wait(file, &ca->wait_queue, wait);
1807 1807
1808 if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1) 1808 if (dvb_ca_en50221_io_read_condition(ca, &result, &slot) == 1)
1809 mask |= POLLIN; 1809 mask |= EPOLLIN;
1810 1810
1811 return mask; 1811 return mask;
1812} 1812}
diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
index 87fc1bcae5ae..a7ed16e0841d 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -2646,7 +2646,7 @@ static __poll_t dvb_frontend_poll(struct file *file, struct poll_table_struct *w
2646 poll_wait (file, &fepriv->events.wait_queue, wait); 2646 poll_wait (file, &fepriv->events.wait_queue, wait);
2647 2647
2648 if (fepriv->events.eventw != fepriv->events.eventr) 2648 if (fepriv->events.eventw != fepriv->events.eventr)
2649 return (POLLIN | POLLRDNORM | POLLPRI); 2649 return (EPOLLIN | EPOLLRDNORM | EPOLLPRI);
2650 2650
2651 return 0; 2651 return 0;
2652} 2652}
diff --git a/drivers/media/firewire/firedtv-ci.c b/drivers/media/firewire/firedtv-ci.c
index b4ddfff74267..8dc5a7495abe 100644
--- a/drivers/media/firewire/firedtv-ci.c
+++ b/drivers/media/firewire/firedtv-ci.c
@@ -209,7 +209,7 @@ static int fdtv_ca_ioctl(struct file *file, unsigned int cmd, void *arg)
209 209
210static __poll_t fdtv_ca_io_poll(struct file *file, poll_table *wait) 210static __poll_t fdtv_ca_io_poll(struct file *file, poll_table *wait)
211{ 211{
212 return POLLIN; 212 return EPOLLIN;
213} 213}
214 214
215static const struct file_operations fdtv_ca_fops = { 215static const struct file_operations fdtv_ca_fops = {
diff --git a/drivers/media/i2c/saa6588.c b/drivers/media/i2c/saa6588.c
index 00640233a5e3..c3089bd34df2 100644
--- a/drivers/media/i2c/saa6588.c
+++ b/drivers/media/i2c/saa6588.c
@@ -413,7 +413,7 @@ static long saa6588_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
413 case SAA6588_CMD_POLL: 413 case SAA6588_CMD_POLL:
414 a->result = 0; 414 a->result = 0;
415 if (s->data_available_for_read) 415 if (s->data_available_for_read)
416 a->result |= POLLIN | POLLRDNORM; 416 a->result |= EPOLLIN | EPOLLRDNORM;
417 poll_wait(a->instance, &s->read_queue, a->event_list); 417 poll_wait(a->instance, &s->read_queue, a->event_list);
418 break; 418 break;
419 419
diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c
index 3049b1f505e5..67ac51eff15c 100644
--- a/drivers/media/media-devnode.c
+++ b/drivers/media/media-devnode.c
@@ -105,7 +105,7 @@ static __poll_t media_poll(struct file *filp,
105 struct media_devnode *devnode = media_devnode_data(filp); 105 struct media_devnode *devnode = media_devnode_data(filp);
106 106
107 if (!media_devnode_is_registered(devnode)) 107 if (!media_devnode_is_registered(devnode))
108 return POLLERR | POLLHUP; 108 return EPOLLERR | EPOLLHUP;
109 if (!devnode->fops->poll) 109 if (!devnode->fops->poll)
110 return DEFAULT_POLLMASK; 110 return DEFAULT_POLLMASK;
111 return devnode->fops->poll(filp, poll); 111 return devnode->fops->poll(filp, poll);
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index c988669e22ff..f697698fe38d 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -2964,39 +2964,39 @@ static __poll_t bttv_poll(struct file *file, poll_table *wait)
2964 __poll_t req_events = poll_requested_events(wait); 2964 __poll_t req_events = poll_requested_events(wait);
2965 2965
2966 if (v4l2_event_pending(&fh->fh)) 2966 if (v4l2_event_pending(&fh->fh))
2967 rc = POLLPRI; 2967 rc = EPOLLPRI;
2968 else if (req_events & POLLPRI) 2968 else if (req_events & EPOLLPRI)
2969 poll_wait(file, &fh->fh.wait, wait); 2969 poll_wait(file, &fh->fh.wait, wait);
2970 2970
2971 if (!(req_events & (POLLIN | POLLRDNORM))) 2971 if (!(req_events & (EPOLLIN | EPOLLRDNORM)))
2972 return rc; 2972 return rc;
2973 2973
2974 if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) { 2974 if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) {
2975 if (!check_alloc_btres_lock(fh->btv,fh,RESOURCE_VBI)) 2975 if (!check_alloc_btres_lock(fh->btv,fh,RESOURCE_VBI))
2976 return rc | POLLERR; 2976 return rc | EPOLLERR;
2977 return rc | videobuf_poll_stream(file, &fh->vbi, wait); 2977 return rc | videobuf_poll_stream(file, &fh->vbi, wait);
2978 } 2978 }
2979 2979
2980 if (check_btres(fh,RESOURCE_VIDEO_STREAM)) { 2980 if (check_btres(fh,RESOURCE_VIDEO_STREAM)) {
2981 /* streaming capture */ 2981 /* streaming capture */
2982 if (list_empty(&fh->cap.stream)) 2982 if (list_empty(&fh->cap.stream))
2983 return rc | POLLERR; 2983 return rc | EPOLLERR;
2984 buf = list_entry(fh->cap.stream.next,struct bttv_buffer,vb.stream); 2984 buf = list_entry(fh->cap.stream.next,struct bttv_buffer,vb.stream);
2985 } else { 2985 } else {
2986 /* read() capture */ 2986 /* read() capture */
2987 if (NULL == fh->cap.read_buf) { 2987 if (NULL == fh->cap.read_buf) {
2988 /* need to capture a new frame */ 2988 /* need to capture a new frame */
2989 if (locked_btres(fh->btv,RESOURCE_VIDEO_STREAM)) 2989 if (locked_btres(fh->btv,RESOURCE_VIDEO_STREAM))
2990 return rc | POLLERR; 2990 return rc | EPOLLERR;
2991 fh->cap.read_buf = videobuf_sg_alloc(fh->cap.msize); 2991 fh->cap.read_buf = videobuf_sg_alloc(fh->cap.msize);
2992 if (NULL == fh->cap.read_buf) 2992 if (NULL == fh->cap.read_buf)
2993 return rc | POLLERR; 2993 return rc | EPOLLERR;
2994 fh->cap.read_buf->memory = V4L2_MEMORY_USERPTR; 2994 fh->cap.read_buf->memory = V4L2_MEMORY_USERPTR;
2995 field = videobuf_next_field(&fh->cap); 2995 field = videobuf_next_field(&fh->cap);
2996 if (0 != fh->cap.ops->buf_prepare(&fh->cap,fh->cap.read_buf,field)) { 2996 if (0 != fh->cap.ops->buf_prepare(&fh->cap,fh->cap.read_buf,field)) {
2997 kfree (fh->cap.read_buf); 2997 kfree (fh->cap.read_buf);
2998 fh->cap.read_buf = NULL; 2998 fh->cap.read_buf = NULL;
2999 return rc | POLLERR; 2999 return rc | EPOLLERR;
3000 } 3000 }
3001 fh->cap.ops->buf_queue(&fh->cap,fh->cap.read_buf); 3001 fh->cap.ops->buf_queue(&fh->cap,fh->cap.read_buf);
3002 fh->cap.read_off = 0; 3002 fh->cap.read_off = 0;
@@ -3007,7 +3007,7 @@ static __poll_t bttv_poll(struct file *file, poll_table *wait)
3007 poll_wait(file, &buf->vb.done, wait); 3007 poll_wait(file, &buf->vb.done, wait);
3008 if (buf->vb.state == VIDEOBUF_DONE || 3008 if (buf->vb.state == VIDEOBUF_DONE ||
3009 buf->vb.state == VIDEOBUF_ERROR) 3009 buf->vb.state == VIDEOBUF_ERROR)
3010 rc = rc | POLLIN|POLLRDNORM; 3010 rc = rc | EPOLLIN|EPOLLRDNORM;
3011 return rc; 3011 return rc;
3012} 3012}
3013 3013
@@ -3338,8 +3338,8 @@ static __poll_t radio_poll(struct file *file, poll_table *wait)
3338 __poll_t res = 0; 3338 __poll_t res = 0;
3339 3339
3340 if (v4l2_event_pending(&fh->fh)) 3340 if (v4l2_event_pending(&fh->fh))
3341 res = POLLPRI; 3341 res = EPOLLPRI;
3342 else if (req_events & POLLPRI) 3342 else if (req_events & EPOLLPRI)
3343 poll_wait(file, &fh->fh.wait, wait); 3343 poll_wait(file, &fh->fh.wait, wait);
3344 radio_enable(btv); 3344 radio_enable(btv);
3345 cmd.instance = file; 3345 cmd.instance = file;
diff --git a/drivers/media/pci/cx18/cx18-fileops.c b/drivers/media/pci/cx18/cx18-fileops.c
index a8dbb922ba4b..a3f44e30f821 100644
--- a/drivers/media/pci/cx18/cx18-fileops.c
+++ b/drivers/media/pci/cx18/cx18-fileops.c
@@ -613,7 +613,7 @@ __poll_t cx18_v4l2_enc_poll(struct file *filp, poll_table *wait)
613 613
614 /* Start a capture if there is none */ 614 /* Start a capture if there is none */
615 if (!eof && !test_bit(CX18_F_S_STREAMING, &s->s_flags) && 615 if (!eof && !test_bit(CX18_F_S_STREAMING, &s->s_flags) &&
616 (req_events & (POLLIN | POLLRDNORM))) { 616 (req_events & (EPOLLIN | EPOLLRDNORM))) {
617 int rc; 617 int rc;
618 618
619 mutex_lock(&cx->serialize_lock); 619 mutex_lock(&cx->serialize_lock);
@@ -622,7 +622,7 @@ __poll_t cx18_v4l2_enc_poll(struct file *filp, poll_table *wait)
622 if (rc) { 622 if (rc) {
623 CX18_DEBUG_INFO("Could not start capture for %s (%d)\n", 623 CX18_DEBUG_INFO("Could not start capture for %s (%d)\n",
624 s->name, rc); 624 s->name, rc);
625 return POLLERR; 625 return EPOLLERR;
626 } 626 }
627 CX18_DEBUG_FILE("Encoder poll started capture\n"); 627 CX18_DEBUG_FILE("Encoder poll started capture\n");
628 } 628 }
@@ -632,23 +632,23 @@ __poll_t cx18_v4l2_enc_poll(struct file *filp, poll_table *wait)
632 __poll_t videobuf_poll = videobuf_poll_stream(filp, &s->vbuf_q, wait); 632 __poll_t videobuf_poll = videobuf_poll_stream(filp, &s->vbuf_q, wait);
633 633
634 if (v4l2_event_pending(&id->fh)) 634 if (v4l2_event_pending(&id->fh))
635 res |= POLLPRI; 635 res |= EPOLLPRI;
636 if (eof && videobuf_poll == POLLERR) 636 if (eof && videobuf_poll == EPOLLERR)
637 return res | POLLHUP; 637 return res | EPOLLHUP;
638 return res | videobuf_poll; 638 return res | videobuf_poll;
639 } 639 }
640 640
641 /* add stream's waitq to the poll list */ 641 /* add stream's waitq to the poll list */
642 CX18_DEBUG_HI_FILE("Encoder poll\n"); 642 CX18_DEBUG_HI_FILE("Encoder poll\n");
643 if (v4l2_event_pending(&id->fh)) 643 if (v4l2_event_pending(&id->fh))
644 res |= POLLPRI; 644 res |= EPOLLPRI;
645 else 645 else
646 poll_wait(filp, &s->waitq, wait); 646 poll_wait(filp, &s->waitq, wait);
647 647
648 if (atomic_read(&s->q_full.depth)) 648 if (atomic_read(&s->q_full.depth))
649 return res | POLLIN | POLLRDNORM; 649 return res | EPOLLIN | EPOLLRDNORM;
650 if (eof) 650 if (eof)
651 return res | POLLHUP; 651 return res | EPOLLHUP;
652 return res; 652 return res;
653} 653}
654 654
diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c
index 42b42824382c..f9bee36f1cad 100644
--- a/drivers/media/pci/ddbridge/ddbridge-core.c
+++ b/drivers/media/pci/ddbridge/ddbridge-core.c
@@ -745,9 +745,9 @@ static __poll_t ts_poll(struct file *file, poll_table *wait)
745 poll_wait(file, &input->dma->wq, wait); 745 poll_wait(file, &input->dma->wq, wait);
746 poll_wait(file, &output->dma->wq, wait); 746 poll_wait(file, &output->dma->wq, wait);
747 if (ddb_input_avail(input) >= 188) 747 if (ddb_input_avail(input) >= 188)
748 mask |= POLLIN | POLLRDNORM; 748 mask |= EPOLLIN | EPOLLRDNORM;
749 if (ddb_output_free(output) >= 188) 749 if (ddb_output_free(output) >= 188)
750 mask |= POLLOUT | POLLWRNORM; 750 mask |= EPOLLOUT | EPOLLWRNORM;
751 return mask; 751 return mask;
752} 752}
753 753
diff --git a/drivers/media/pci/ivtv/ivtv-fileops.c b/drivers/media/pci/ivtv/ivtv-fileops.c
index 4aa773507201..6196daae4b3e 100644
--- a/drivers/media/pci/ivtv/ivtv-fileops.c
+++ b/drivers/media/pci/ivtv/ivtv-fileops.c
@@ -747,7 +747,7 @@ __poll_t ivtv_v4l2_dec_poll(struct file *filp, poll_table *wait)
747 /* Turn off the old-style vsync events */ 747 /* Turn off the old-style vsync events */
748 clear_bit(IVTV_F_I_EV_VSYNC_ENABLED, &itv->i_flags); 748 clear_bit(IVTV_F_I_EV_VSYNC_ENABLED, &itv->i_flags);
749 if (v4l2_event_pending(&id->fh)) 749 if (v4l2_event_pending(&id->fh))
750 res = POLLPRI; 750 res = EPOLLPRI;
751 } else { 751 } else {
752 /* This is the old-style API which is here only for backwards 752 /* This is the old-style API which is here only for backwards
753 compatibility. */ 753 compatibility. */
@@ -755,12 +755,12 @@ __poll_t ivtv_v4l2_dec_poll(struct file *filp, poll_table *wait)
755 set_bit(IVTV_F_I_EV_VSYNC_ENABLED, &itv->i_flags); 755 set_bit(IVTV_F_I_EV_VSYNC_ENABLED, &itv->i_flags);
756 if (test_bit(IVTV_F_I_EV_VSYNC, &itv->i_flags) || 756 if (test_bit(IVTV_F_I_EV_VSYNC, &itv->i_flags) ||
757 test_bit(IVTV_F_I_EV_DEC_STOPPED, &itv->i_flags)) 757 test_bit(IVTV_F_I_EV_DEC_STOPPED, &itv->i_flags))
758 res = POLLPRI; 758 res = EPOLLPRI;
759 } 759 }
760 760
761 /* Allow write if buffers are available for writing */ 761 /* Allow write if buffers are available for writing */
762 if (s->q_free.buffers) 762 if (s->q_free.buffers)
763 res |= POLLOUT | POLLWRNORM; 763 res |= EPOLLOUT | EPOLLWRNORM;
764 return res; 764 return res;
765} 765}
766 766
@@ -776,7 +776,7 @@ __poll_t ivtv_v4l2_enc_poll(struct file *filp, poll_table *wait)
776 /* Start a capture if there is none */ 776 /* Start a capture if there is none */
777 if (!eof && !test_bit(IVTV_F_S_STREAMING, &s->s_flags) && 777 if (!eof && !test_bit(IVTV_F_S_STREAMING, &s->s_flags) &&
778 s->type != IVTV_ENC_STREAM_TYPE_RAD && 778 s->type != IVTV_ENC_STREAM_TYPE_RAD &&
779 (req_events & (POLLIN | POLLRDNORM))) { 779 (req_events & (EPOLLIN | EPOLLRDNORM))) {
780 int rc; 780 int rc;
781 781
782 mutex_lock(&itv->serialize_lock); 782 mutex_lock(&itv->serialize_lock);
@@ -785,7 +785,7 @@ __poll_t ivtv_v4l2_enc_poll(struct file *filp, poll_table *wait)
785 if (rc) { 785 if (rc) {
786 IVTV_DEBUG_INFO("Could not start capture for %s (%d)\n", 786 IVTV_DEBUG_INFO("Could not start capture for %s (%d)\n",
787 s->name, rc); 787 s->name, rc);
788 return POLLERR; 788 return EPOLLERR;
789 } 789 }
790 IVTV_DEBUG_FILE("Encoder poll started capture\n"); 790 IVTV_DEBUG_FILE("Encoder poll started capture\n");
791 } 791 }
@@ -794,14 +794,14 @@ __poll_t ivtv_v4l2_enc_poll(struct file *filp, poll_table *wait)
794 IVTV_DEBUG_HI_FILE("Encoder poll\n"); 794 IVTV_DEBUG_HI_FILE("Encoder poll\n");
795 poll_wait(filp, &s->waitq, wait); 795 poll_wait(filp, &s->waitq, wait);
796 if (v4l2_event_pending(&id->fh)) 796 if (v4l2_event_pending(&id->fh))
797 res |= POLLPRI; 797 res |= EPOLLPRI;
798 else 798 else
799 poll_wait(filp, &id->fh.wait, wait); 799 poll_wait(filp, &id->fh.wait, wait);
800 800
801 if (s->q_full.length || s->q_io.length) 801 if (s->q_full.length || s->q_io.length)
802 return res | POLLIN | POLLRDNORM; 802 return res | EPOLLIN | EPOLLRDNORM;
803 if (eof) 803 if (eof)
804 return res | POLLHUP; 804 return res | EPOLLHUP;
805 return res; 805 return res;
806} 806}
807 807
diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c
index ae83293723ba..dedcdb573427 100644
--- a/drivers/media/pci/meye/meye.c
+++ b/drivers/media/pci/meye/meye.c
@@ -1430,7 +1430,7 @@ static __poll_t meye_poll(struct file *file, poll_table *wait)
1430 mutex_lock(&meye.lock); 1430 mutex_lock(&meye.lock);
1431 poll_wait(file, &meye.proc_list, wait); 1431 poll_wait(file, &meye.proc_list, wait);
1432 if (kfifo_len(&meye.doneq)) 1432 if (kfifo_len(&meye.doneq))
1433 res |= POLLIN | POLLRDNORM; 1433 res |= EPOLLIN | EPOLLRDNORM;
1434 mutex_unlock(&meye.lock); 1434 mutex_unlock(&meye.lock);
1435 return res; 1435 return res;
1436} 1436}
diff --git a/drivers/media/pci/saa7164/saa7164-encoder.c b/drivers/media/pci/saa7164/saa7164-encoder.c
index e7b31a5b14fd..32136ebe4f61 100644
--- a/drivers/media/pci/saa7164/saa7164-encoder.c
+++ b/drivers/media/pci/saa7164/saa7164-encoder.c
@@ -925,13 +925,13 @@ static __poll_t fops_poll(struct file *file, poll_table *wait)
925 saa7164_histogram_update(&port->poll_interval, 925 saa7164_histogram_update(&port->poll_interval,
926 port->last_poll_msecs_diff); 926 port->last_poll_msecs_diff);
927 927
928 if (!(req_events & (POLLIN | POLLRDNORM))) 928 if (!(req_events & (EPOLLIN | EPOLLRDNORM)))
929 return mask; 929 return mask;
930 930
931 if (atomic_cmpxchg(&fh->v4l_reading, 0, 1) == 0) { 931 if (atomic_cmpxchg(&fh->v4l_reading, 0, 1) == 0) {
932 if (atomic_inc_return(&port->v4l_reader_count) == 1) { 932 if (atomic_inc_return(&port->v4l_reader_count) == 1) {
933 if (saa7164_encoder_initialize(port) < 0) 933 if (saa7164_encoder_initialize(port) < 0)
934 return mask | POLLERR; 934 return mask | EPOLLERR;
935 saa7164_encoder_start_streaming(port); 935 saa7164_encoder_start_streaming(port);
936 msleep(200); 936 msleep(200);
937 } 937 }
@@ -939,7 +939,7 @@ static __poll_t fops_poll(struct file *file, poll_table *wait)
939 939
940 /* Pull the first buffer from the used list */ 940 /* Pull the first buffer from the used list */
941 if (!list_empty(&port->list_buf_used.list)) 941 if (!list_empty(&port->list_buf_used.list))
942 mask |= POLLIN | POLLRDNORM; 942 mask |= EPOLLIN | EPOLLRDNORM;
943 943
944 return mask; 944 return mask;
945} 945}
diff --git a/drivers/media/pci/saa7164/saa7164-vbi.c b/drivers/media/pci/saa7164/saa7164-vbi.c
index 6f97c8f2e00d..64ab91c24c18 100644
--- a/drivers/media/pci/saa7164/saa7164-vbi.c
+++ b/drivers/media/pci/saa7164/saa7164-vbi.c
@@ -650,7 +650,7 @@ static __poll_t fops_poll(struct file *file, poll_table *wait)
650 650
651 /* Pull the first buffer from the used list */ 651 /* Pull the first buffer from the used list */
652 if (!list_empty(&port->list_buf_used.list)) 652 if (!list_empty(&port->list_buf_used.list))
653 mask |= POLLIN | POLLRDNORM; 653 mask |= EPOLLIN | EPOLLRDNORM;
654 654
655 return mask; 655 return mask;
656} 656}
diff --git a/drivers/media/pci/ttpci/av7110_av.c b/drivers/media/pci/ttpci/av7110_av.c
index 4d10e2f979d2..4daba76ec240 100644
--- a/drivers/media/pci/ttpci/av7110_av.c
+++ b/drivers/media/pci/ttpci/av7110_av.c
@@ -951,15 +951,15 @@ static __poll_t dvb_video_poll(struct file *file, poll_table *wait)
951 poll_wait(file, &av7110->video_events.wait_queue, wait); 951 poll_wait(file, &av7110->video_events.wait_queue, wait);
952 952
953 if (av7110->video_events.eventw != av7110->video_events.eventr) 953 if (av7110->video_events.eventw != av7110->video_events.eventr)
954 mask = POLLPRI; 954 mask = EPOLLPRI;
955 955
956 if ((file->f_flags & O_ACCMODE) != O_RDONLY) { 956 if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
957 if (av7110->playing) { 957 if (av7110->playing) {
958 if (FREE_COND) 958 if (FREE_COND)
959 mask |= (POLLOUT | POLLWRNORM); 959 mask |= (EPOLLOUT | EPOLLWRNORM);
960 } else { 960 } else {
961 /* if not playing: may play if asked for */ 961 /* if not playing: may play if asked for */
962 mask |= (POLLOUT | POLLWRNORM); 962 mask |= (EPOLLOUT | EPOLLWRNORM);
963 } 963 }
964 } 964 }
965 965
@@ -1001,9 +1001,9 @@ static __poll_t dvb_audio_poll(struct file *file, poll_table *wait)
1001 1001
1002 if (av7110->playing) { 1002 if (av7110->playing) {
1003 if (dvb_ringbuffer_free(&av7110->aout) >= 20 * 1024) 1003 if (dvb_ringbuffer_free(&av7110->aout) >= 20 * 1024)
1004 mask |= (POLLOUT | POLLWRNORM); 1004 mask |= (EPOLLOUT | EPOLLWRNORM);
1005 } else /* if not playing: may play if asked for */ 1005 } else /* if not playing: may play if asked for */
1006 mask = (POLLOUT | POLLWRNORM); 1006 mask = (EPOLLOUT | EPOLLWRNORM);
1007 1007
1008 return mask; 1008 return mask;
1009} 1009}
diff --git a/drivers/media/pci/ttpci/av7110_ca.c b/drivers/media/pci/ttpci/av7110_ca.c
index 96ca227cf51b..d8c2f1b34d74 100644
--- a/drivers/media/pci/ttpci/av7110_ca.c
+++ b/drivers/media/pci/ttpci/av7110_ca.c
@@ -237,10 +237,10 @@ static __poll_t dvb_ca_poll (struct file *file, poll_table *wait)
237 poll_wait(file, &wbuf->queue, wait); 237 poll_wait(file, &wbuf->queue, wait);
238 238
239 if (!dvb_ringbuffer_empty(rbuf)) 239 if (!dvb_ringbuffer_empty(rbuf))
240 mask |= (POLLIN | POLLRDNORM); 240 mask |= (EPOLLIN | EPOLLRDNORM);
241 241
242 if (dvb_ringbuffer_free(wbuf) > 1024) 242 if (dvb_ringbuffer_free(wbuf) > 1024)
243 mask |= (POLLOUT | POLLWRNORM); 243 mask |= (EPOLLOUT | EPOLLWRNORM);
244 244
245 return mask; 245 return mask;
246} 246}
diff --git a/drivers/media/pci/zoran/zoran_driver.c b/drivers/media/pci/zoran/zoran_driver.c
index c464dae0389c..8d4e7d930a66 100644
--- a/drivers/media/pci/zoran/zoran_driver.c
+++ b/drivers/media/pci/zoran/zoran_driver.c
@@ -2513,10 +2513,10 @@ zoran_poll (struct file *file,
2513 2513
2514 /* we should check whether buffers are ready to be synced on 2514 /* we should check whether buffers are ready to be synced on
2515 * (w/o waits - O_NONBLOCK) here 2515 * (w/o waits - O_NONBLOCK) here
2516 * if ready for read (sync), return POLLIN|POLLRDNORM, 2516 * if ready for read (sync), return EPOLLIN|EPOLLRDNORM,
2517 * if ready for write (sync), return POLLOUT|POLLWRNORM, 2517 * if ready for write (sync), return EPOLLOUT|EPOLLWRNORM,
2518 * if error, return POLLERR, 2518 * if error, return EPOLLERR,
2519 * if no buffers queued or so, return POLLNVAL 2519 * if no buffers queued or so, return EPOLLNVAL
2520 */ 2520 */
2521 2521
2522 switch (fh->map_mode) { 2522 switch (fh->map_mode) {
@@ -2536,7 +2536,7 @@ zoran_poll (struct file *file,
2536 if (fh->buffers.active != ZORAN_FREE && 2536 if (fh->buffers.active != ZORAN_FREE &&
2537 /* Buffer ready to DQBUF? */ 2537 /* Buffer ready to DQBUF? */
2538 zr->v4l_buffers.buffer[frame].state == BUZ_STATE_DONE) 2538 zr->v4l_buffers.buffer[frame].state == BUZ_STATE_DONE)
2539 res |= POLLIN | POLLRDNORM; 2539 res |= EPOLLIN | EPOLLRDNORM;
2540 spin_unlock_irqrestore(&zr->spinlock, flags); 2540 spin_unlock_irqrestore(&zr->spinlock, flags);
2541 2541
2542 break; 2542 break;
@@ -2557,9 +2557,9 @@ zoran_poll (struct file *file,
2557 if (fh->buffers.active != ZORAN_FREE && 2557 if (fh->buffers.active != ZORAN_FREE &&
2558 zr->jpg_buffers.buffer[frame].state == BUZ_STATE_DONE) { 2558 zr->jpg_buffers.buffer[frame].state == BUZ_STATE_DONE) {
2559 if (fh->map_mode == ZORAN_MAP_MODE_JPG_REC) 2559 if (fh->map_mode == ZORAN_MAP_MODE_JPG_REC)
2560 res |= POLLIN | POLLRDNORM; 2560 res |= EPOLLIN | EPOLLRDNORM;
2561 else 2561 else
2562 res |= POLLOUT | POLLWRNORM; 2562 res |= EPOLLOUT | EPOLLWRNORM;
2563 } 2563 }
2564 spin_unlock_irqrestore(&zr->spinlock, flags); 2564 spin_unlock_irqrestore(&zr->spinlock, flags);
2565 2565
@@ -2570,7 +2570,7 @@ zoran_poll (struct file *file,
2570 KERN_ERR 2570 KERN_ERR
2571 "%s: %s - internal error, unknown map_mode=%d\n", 2571 "%s: %s - internal error, unknown map_mode=%d\n",
2572 ZR_DEVNAME(zr), __func__, fh->map_mode); 2572 ZR_DEVNAME(zr), __func__, fh->map_mode);
2573 res |= POLLERR; 2573 res |= EPOLLERR;
2574 } 2574 }
2575 2575
2576 return res; 2576 return res;
diff --git a/drivers/media/platform/fsl-viu.c b/drivers/media/platform/fsl-viu.c
index de285a269390..200c47c69a75 100644
--- a/drivers/media/platform/fsl-viu.c
+++ b/drivers/media/platform/fsl-viu.c
@@ -1272,9 +1272,9 @@ static __poll_t viu_poll(struct file *file, struct poll_table_struct *wait)
1272 __poll_t res = v4l2_ctrl_poll(file, wait); 1272 __poll_t res = v4l2_ctrl_poll(file, wait);
1273 1273
1274 if (V4L2_BUF_TYPE_VIDEO_CAPTURE != fh->type) 1274 if (V4L2_BUF_TYPE_VIDEO_CAPTURE != fh->type)
1275 return POLLERR; 1275 return EPOLLERR;
1276 1276
1277 if (!(req_events & (POLLIN | POLLRDNORM))) 1277 if (!(req_events & (EPOLLIN | EPOLLRDNORM)))
1278 return res; 1278 return res;
1279 1279
1280 mutex_lock(&dev->lock); 1280 mutex_lock(&dev->lock);
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index f15cf24c1c63..d5b94fc0040e 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -1008,7 +1008,7 @@ static __poll_t s5p_mfc_poll(struct file *file,
1008 */ 1008 */
1009 if ((!src_q->streaming || list_empty(&src_q->queued_list)) 1009 if ((!src_q->streaming || list_empty(&src_q->queued_list))
1010 && (!dst_q->streaming || list_empty(&dst_q->queued_list))) { 1010 && (!dst_q->streaming || list_empty(&dst_q->queued_list))) {
1011 rc = POLLERR; 1011 rc = EPOLLERR;
1012 goto end; 1012 goto end;
1013 } 1013 }
1014 mutex_unlock(&dev->mfc_mutex); 1014 mutex_unlock(&dev->mfc_mutex);
@@ -1017,14 +1017,14 @@ static __poll_t s5p_mfc_poll(struct file *file,
1017 poll_wait(file, &dst_q->done_wq, wait); 1017 poll_wait(file, &dst_q->done_wq, wait);
1018 mutex_lock(&dev->mfc_mutex); 1018 mutex_lock(&dev->mfc_mutex);
1019 if (v4l2_event_pending(&ctx->fh)) 1019 if (v4l2_event_pending(&ctx->fh))
1020 rc |= POLLPRI; 1020 rc |= EPOLLPRI;
1021 spin_lock_irqsave(&src_q->done_lock, flags); 1021 spin_lock_irqsave(&src_q->done_lock, flags);
1022 if (!list_empty(&src_q->done_list)) 1022 if (!list_empty(&src_q->done_list))
1023 src_vb = list_first_entry(&src_q->done_list, struct vb2_buffer, 1023 src_vb = list_first_entry(&src_q->done_list, struct vb2_buffer,
1024 done_entry); 1024 done_entry);
1025 if (src_vb && (src_vb->state == VB2_BUF_STATE_DONE 1025 if (src_vb && (src_vb->state == VB2_BUF_STATE_DONE
1026 || src_vb->state == VB2_BUF_STATE_ERROR)) 1026 || src_vb->state == VB2_BUF_STATE_ERROR))
1027 rc |= POLLOUT | POLLWRNORM; 1027 rc |= EPOLLOUT | EPOLLWRNORM;
1028 spin_unlock_irqrestore(&src_q->done_lock, flags); 1028 spin_unlock_irqrestore(&src_q->done_lock, flags);
1029 spin_lock_irqsave(&dst_q->done_lock, flags); 1029 spin_lock_irqsave(&dst_q->done_lock, flags);
1030 if (!list_empty(&dst_q->done_list)) 1030 if (!list_empty(&dst_q->done_list))
@@ -1032,7 +1032,7 @@ static __poll_t s5p_mfc_poll(struct file *file,
1032 done_entry); 1032 done_entry);
1033 if (dst_vb && (dst_vb->state == VB2_BUF_STATE_DONE 1033 if (dst_vb && (dst_vb->state == VB2_BUF_STATE_DONE
1034 || dst_vb->state == VB2_BUF_STATE_ERROR)) 1034 || dst_vb->state == VB2_BUF_STATE_ERROR))
1035 rc |= POLLIN | POLLRDNORM; 1035 rc |= EPOLLIN | EPOLLRDNORM;
1036 spin_unlock_irqrestore(&dst_q->done_lock, flags); 1036 spin_unlock_irqrestore(&dst_q->done_lock, flags);
1037end: 1037end:
1038 mutex_unlock(&dev->mfc_mutex); 1038 mutex_unlock(&dev->mfc_mutex);
diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index 70fc5f01942d..c86dd2fdab84 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -809,10 +809,10 @@ static __poll_t soc_camera_poll(struct file *file, poll_table *pt)
809{ 809{
810 struct soc_camera_device *icd = file->private_data; 810 struct soc_camera_device *icd = file->private_data;
811 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); 811 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
812 __poll_t res = POLLERR; 812 __poll_t res = EPOLLERR;
813 813
814 if (icd->streamer != file) 814 if (icd->streamer != file)
815 return POLLERR; 815 return EPOLLERR;
816 816
817 mutex_lock(&ici->host_lock); 817 mutex_lock(&ici->host_lock);
818 res = ici->ops->poll(file, pt); 818 res = ici->ops->poll(file, pt);
diff --git a/drivers/media/platform/vivid/vivid-radio-rx.c b/drivers/media/platform/vivid/vivid-radio-rx.c
index fcb7a9f015b6..f834f7df8cf9 100644
--- a/drivers/media/platform/vivid/vivid-radio-rx.c
+++ b/drivers/media/platform/vivid/vivid-radio-rx.c
@@ -142,7 +142,7 @@ retry:
142 142
143__poll_t vivid_radio_rx_poll(struct file *file, struct poll_table_struct *wait) 143__poll_t vivid_radio_rx_poll(struct file *file, struct poll_table_struct *wait)
144{ 144{
145 return POLLIN | POLLRDNORM | v4l2_ctrl_poll(file, wait); 145 return EPOLLIN | EPOLLRDNORM | v4l2_ctrl_poll(file, wait);
146} 146}
147 147
148int vivid_radio_rx_enum_freq_bands(struct file *file, void *fh, struct v4l2_frequency_band *band) 148int vivid_radio_rx_enum_freq_bands(struct file *file, void *fh, struct v4l2_frequency_band *band)
diff --git a/drivers/media/platform/vivid/vivid-radio-tx.c b/drivers/media/platform/vivid/vivid-radio-tx.c
index af4907a197a3..308b13f85dc0 100644
--- a/drivers/media/platform/vivid/vivid-radio-tx.c
+++ b/drivers/media/platform/vivid/vivid-radio-tx.c
@@ -105,7 +105,7 @@ retry:
105 105
106__poll_t vivid_radio_tx_poll(struct file *file, struct poll_table_struct *wait) 106__poll_t vivid_radio_tx_poll(struct file *file, struct poll_table_struct *wait)
107{ 107{
108 return POLLOUT | POLLWRNORM | v4l2_ctrl_poll(file, wait); 108 return EPOLLOUT | EPOLLWRNORM | v4l2_ctrl_poll(file, wait);
109} 109}
110 110
111int vidioc_g_modulator(struct file *file, void *fh, struct v4l2_modulator *a) 111int vidioc_g_modulator(struct file *file, void *fh, struct v4l2_modulator *a)
diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c
index af7c68b344d1..5b82e63885cd 100644
--- a/drivers/media/radio/radio-cadet.c
+++ b/drivers/media/radio/radio-cadet.c
@@ -488,14 +488,14 @@ static __poll_t cadet_poll(struct file *file, struct poll_table_struct *wait)
488 __poll_t res = v4l2_ctrl_poll(file, wait); 488 __poll_t res = v4l2_ctrl_poll(file, wait);
489 489
490 poll_wait(file, &dev->read_queue, wait); 490 poll_wait(file, &dev->read_queue, wait);
491 if (dev->rdsstat == 0 && (req_events & (POLLIN | POLLRDNORM))) { 491 if (dev->rdsstat == 0 && (req_events & (EPOLLIN | EPOLLRDNORM))) {
492 mutex_lock(&dev->lock); 492 mutex_lock(&dev->lock);
493 if (dev->rdsstat == 0) 493 if (dev->rdsstat == 0)
494 cadet_start_rds(dev); 494 cadet_start_rds(dev);
495 mutex_unlock(&dev->lock); 495 mutex_unlock(&dev->lock);
496 } 496 }
497 if (cadet_has_rds_data(dev)) 497 if (cadet_has_rds_data(dev))
498 res |= POLLIN | POLLRDNORM; 498 res |= EPOLLIN | EPOLLRDNORM;
499 return res; 499 return res;
500} 500}
501 501
diff --git a/drivers/media/radio/radio-si476x.c b/drivers/media/radio/radio-si476x.c
index bff9789ae9bc..b52e678c6901 100644
--- a/drivers/media/radio/radio-si476x.c
+++ b/drivers/media/radio/radio-si476x.c
@@ -1158,15 +1158,15 @@ static __poll_t si476x_radio_fops_poll(struct file *file,
1158 __poll_t req_events = poll_requested_events(pts); 1158 __poll_t req_events = poll_requested_events(pts);
1159 __poll_t err = v4l2_ctrl_poll(file, pts); 1159 __poll_t err = v4l2_ctrl_poll(file, pts);
1160 1160
1161 if (req_events & (POLLIN | POLLRDNORM)) { 1161 if (req_events & (EPOLLIN | EPOLLRDNORM)) {
1162 if (atomic_read(&radio->core->is_alive)) 1162 if (atomic_read(&radio->core->is_alive))
1163 poll_wait(file, &radio->core->rds_read_queue, pts); 1163 poll_wait(file, &radio->core->rds_read_queue, pts);
1164 1164
1165 if (!atomic_read(&radio->core->is_alive)) 1165 if (!atomic_read(&radio->core->is_alive))
1166 err = POLLHUP; 1166 err = EPOLLHUP;
1167 1167
1168 if (!kfifo_is_empty(&radio->core->rds_fifo)) 1168 if (!kfifo_is_empty(&radio->core->rds_fifo))
1169 err = POLLIN | POLLRDNORM; 1169 err = EPOLLIN | EPOLLRDNORM;
1170 } 1170 }
1171 1171
1172 return err; 1172 return err;
diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c
index f92b0f9241a9..58e944591602 100644
--- a/drivers/media/radio/radio-wl1273.c
+++ b/drivers/media/radio/radio-wl1273.c
@@ -1104,10 +1104,10 @@ static __poll_t wl1273_fm_fops_poll(struct file *file,
1104 poll_wait(file, &radio->read_queue, pts); 1104 poll_wait(file, &radio->read_queue, pts);
1105 1105
1106 if (radio->rd_index != radio->wr_index) 1106 if (radio->rd_index != radio->wr_index)
1107 return POLLIN | POLLRDNORM; 1107 return EPOLLIN | EPOLLRDNORM;
1108 1108
1109 } else if (core->mode == WL1273_MODE_TX) { 1109 } else if (core->mode == WL1273_MODE_TX) {
1110 return POLLOUT | POLLWRNORM; 1110 return EPOLLOUT | EPOLLWRNORM;
1111 } 1111 }
1112 1112
1113 return 0; 1113 return 0;
diff --git a/drivers/media/radio/si470x/radio-si470x-common.c b/drivers/media/radio/si470x/radio-si470x-common.c
index 5b477b7d6a66..e0054e0f410d 100644
--- a/drivers/media/radio/si470x/radio-si470x-common.c
+++ b/drivers/media/radio/si470x/radio-si470x-common.c
@@ -514,7 +514,7 @@ static __poll_t si470x_fops_poll(struct file *file,
514 __poll_t req_events = poll_requested_events(pts); 514 __poll_t req_events = poll_requested_events(pts);
515 __poll_t retval = v4l2_ctrl_poll(file, pts); 515 __poll_t retval = v4l2_ctrl_poll(file, pts);
516 516
517 if (req_events & (POLLIN | POLLRDNORM)) { 517 if (req_events & (EPOLLIN | EPOLLRDNORM)) {
518 /* switch on rds reception */ 518 /* switch on rds reception */
519 if ((radio->registers[SYSCONFIG1] & SYSCONFIG1_RDS) == 0) 519 if ((radio->registers[SYSCONFIG1] & SYSCONFIG1_RDS) == 0)
520 si470x_rds_on(radio); 520 si470x_rds_on(radio);
@@ -522,7 +522,7 @@ static __poll_t si470x_fops_poll(struct file *file,
522 poll_wait(file, &radio->read_queue, pts); 522 poll_wait(file, &radio->read_queue, pts);
523 523
524 if (radio->rd_index != radio->wr_index) 524 if (radio->rd_index != radio->wr_index)
525 retval |= POLLIN | POLLRDNORM; 525 retval |= EPOLLIN | EPOLLRDNORM;
526 } 526 }
527 527
528 return retval; 528 return retval;
diff --git a/drivers/media/radio/wl128x/fmdrv_v4l2.c b/drivers/media/radio/wl128x/fmdrv_v4l2.c
index fd603c1b96bb..dccdf6558e6a 100644
--- a/drivers/media/radio/wl128x/fmdrv_v4l2.c
+++ b/drivers/media/radio/wl128x/fmdrv_v4l2.c
@@ -112,7 +112,7 @@ static __poll_t fm_v4l2_fops_poll(struct file *file, struct poll_table_struct *p
112 ret = fmc_is_rds_data_available(fmdev, file, pts); 112 ret = fmc_is_rds_data_available(fmdev, file, pts);
113 mutex_unlock(&fmdev->mutex); 113 mutex_unlock(&fmdev->mutex);
114 if (ret < 0) 114 if (ret < 0)
115 return POLLIN | POLLRDNORM; 115 return EPOLLIN | EPOLLRDNORM;
116 116
117 return 0; 117 return 0;
118} 118}
diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
index b3544988586e..cc863044c880 100644
--- a/drivers/media/rc/lirc_dev.c
+++ b/drivers/media/rc/lirc_dev.c
@@ -109,7 +109,7 @@ void ir_lirc_raw_event(struct rc_dev *dev, struct ir_raw_event ev)
109 if (LIRC_IS_TIMEOUT(sample) && !fh->send_timeout_reports) 109 if (LIRC_IS_TIMEOUT(sample) && !fh->send_timeout_reports)
110 continue; 110 continue;
111 if (kfifo_put(&fh->rawir, sample)) 111 if (kfifo_put(&fh->rawir, sample))
112 wake_up_poll(&fh->wait_poll, POLLIN | POLLRDNORM); 112 wake_up_poll(&fh->wait_poll, EPOLLIN | EPOLLRDNORM);
113 } 113 }
114 spin_unlock_irqrestore(&dev->lirc_fh_lock, flags); 114 spin_unlock_irqrestore(&dev->lirc_fh_lock, flags);
115} 115}
@@ -130,7 +130,7 @@ void ir_lirc_scancode_event(struct rc_dev *dev, struct lirc_scancode *lsc)
130 spin_lock_irqsave(&dev->lirc_fh_lock, flags); 130 spin_lock_irqsave(&dev->lirc_fh_lock, flags);
131 list_for_each_entry(fh, &dev->lirc_fh, list) { 131 list_for_each_entry(fh, &dev->lirc_fh, list) {
132 if (kfifo_put(&fh->scancodes, *lsc)) 132 if (kfifo_put(&fh->scancodes, *lsc))
133 wake_up_poll(&fh->wait_poll, POLLIN | POLLRDNORM); 133 wake_up_poll(&fh->wait_poll, EPOLLIN | EPOLLRDNORM);
134 } 134 }
135 spin_unlock_irqrestore(&dev->lirc_fh_lock, flags); 135 spin_unlock_irqrestore(&dev->lirc_fh_lock, flags);
136} 136}
@@ -603,15 +603,15 @@ static __poll_t ir_lirc_poll(struct file *file, struct poll_table_struct *wait)
603 poll_wait(file, &fh->wait_poll, wait); 603 poll_wait(file, &fh->wait_poll, wait);
604 604
605 if (!rcdev->registered) { 605 if (!rcdev->registered) {
606 events = POLLHUP | POLLERR; 606 events = EPOLLHUP | EPOLLERR;
607 } else if (rcdev->driver_type != RC_DRIVER_IR_RAW_TX) { 607 } else if (rcdev->driver_type != RC_DRIVER_IR_RAW_TX) {
608 if (fh->rec_mode == LIRC_MODE_SCANCODE && 608 if (fh->rec_mode == LIRC_MODE_SCANCODE &&
609 !kfifo_is_empty(&fh->scancodes)) 609 !kfifo_is_empty(&fh->scancodes))
610 events = POLLIN | POLLRDNORM; 610 events = EPOLLIN | EPOLLRDNORM;
611 611
612 if (fh->rec_mode == LIRC_MODE_MODE2 && 612 if (fh->rec_mode == LIRC_MODE_MODE2 &&
613 !kfifo_is_empty(&fh->rawir)) 613 !kfifo_is_empty(&fh->rawir))
614 events = POLLIN | POLLRDNORM; 614 events = EPOLLIN | EPOLLRDNORM;
615 } 615 }
616 616
617 return events; 617 return events;
@@ -779,7 +779,7 @@ void ir_lirc_unregister(struct rc_dev *dev)
779 779
780 spin_lock_irqsave(&dev->lirc_fh_lock, flags); 780 spin_lock_irqsave(&dev->lirc_fh_lock, flags);
781 list_for_each_entry(fh, &dev->lirc_fh, list) 781 list_for_each_entry(fh, &dev->lirc_fh, list)
782 wake_up_poll(&fh->wait_poll, POLLHUP | POLLERR); 782 wake_up_poll(&fh->wait_poll, EPOLLHUP | EPOLLERR);
783 spin_unlock_irqrestore(&dev->lirc_fh_lock, flags); 783 spin_unlock_irqrestore(&dev->lirc_fh_lock, flags);
784 784
785 cdev_device_del(&dev->lirc_cdev, &dev->lirc_dev); 785 cdev_device_del(&dev->lirc_cdev, &dev->lirc_dev);
diff --git a/drivers/media/usb/cpia2/cpia2_core.c b/drivers/media/usb/cpia2/cpia2_core.c
index e7524920c618..3dfbb545c0e3 100644
--- a/drivers/media/usb/cpia2/cpia2_core.c
+++ b/drivers/media/usb/cpia2/cpia2_core.c
@@ -2375,7 +2375,7 @@ __poll_t cpia2_poll(struct camera_data *cam, struct file *filp,
2375{ 2375{
2376 __poll_t status = v4l2_ctrl_poll(filp, wait); 2376 __poll_t status = v4l2_ctrl_poll(filp, wait);
2377 2377
2378 if ((poll_requested_events(wait) & (POLLIN | POLLRDNORM)) && 2378 if ((poll_requested_events(wait) & (EPOLLIN | EPOLLRDNORM)) &&
2379 !cam->streaming) { 2379 !cam->streaming) {
2380 /* Start streaming */ 2380 /* Start streaming */
2381 cpia2_usb_stream_start(cam, 2381 cpia2_usb_stream_start(cam,
@@ -2385,7 +2385,7 @@ __poll_t cpia2_poll(struct camera_data *cam, struct file *filp,
2385 poll_wait(filp, &cam->wq_stream, wait); 2385 poll_wait(filp, &cam->wq_stream, wait);
2386 2386
2387 if (cam->curbuff->status == FRAME_READY) 2387 if (cam->curbuff->status == FRAME_READY)
2388 status |= POLLIN | POLLRDNORM; 2388 status |= EPOLLIN | EPOLLRDNORM;
2389 2389
2390 return status; 2390 return status;
2391} 2391}
diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c b/drivers/media/usb/cx231xx/cx231xx-417.c
index 103e3299b77f..b80e6857e2eb 100644
--- a/drivers/media/usb/cx231xx/cx231xx-417.c
+++ b/drivers/media/usb/cx231xx/cx231xx-417.c
@@ -1821,11 +1821,11 @@ static __poll_t mpeg_poll(struct file *file,
1821 __poll_t res = 0; 1821 __poll_t res = 0;
1822 1822
1823 if (v4l2_event_pending(&fh->fh)) 1823 if (v4l2_event_pending(&fh->fh))
1824 res |= POLLPRI; 1824 res |= EPOLLPRI;
1825 else 1825 else
1826 poll_wait(file, &fh->fh.wait, wait); 1826 poll_wait(file, &fh->fh.wait, wait);
1827 1827
1828 if (!(req_events & (POLLIN | POLLRDNORM))) 1828 if (!(req_events & (EPOLLIN | EPOLLRDNORM)))
1829 return res; 1829 return res;
1830 1830
1831 mutex_lock(&dev->lock); 1831 mutex_lock(&dev->lock);
diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c
index 271f35208c49..5b321b8ada3a 100644
--- a/drivers/media/usb/cx231xx/cx231xx-video.c
+++ b/drivers/media/usb/cx231xx/cx231xx-video.c
@@ -2018,19 +2018,19 @@ static __poll_t cx231xx_v4l2_poll(struct file *filp, poll_table *wait)
2018 2018
2019 rc = check_dev(dev); 2019 rc = check_dev(dev);
2020 if (rc < 0) 2020 if (rc < 0)
2021 return POLLERR; 2021 return EPOLLERR;
2022 2022
2023 rc = res_get(fh); 2023 rc = res_get(fh);
2024 2024
2025 if (unlikely(rc < 0)) 2025 if (unlikely(rc < 0))
2026 return POLLERR; 2026 return EPOLLERR;
2027 2027
2028 if (v4l2_event_pending(&fh->fh)) 2028 if (v4l2_event_pending(&fh->fh))
2029 res |= POLLPRI; 2029 res |= EPOLLPRI;
2030 else 2030 else
2031 poll_wait(filp, &fh->fh.wait, wait); 2031 poll_wait(filp, &fh->fh.wait, wait);
2032 2032
2033 if (!(req_events & (POLLIN | POLLRDNORM))) 2033 if (!(req_events & (EPOLLIN | EPOLLRDNORM)))
2034 return res; 2034 return res;
2035 2035
2036 if ((V4L2_BUF_TYPE_VIDEO_CAPTURE == fh->type) || 2036 if ((V4L2_BUF_TYPE_VIDEO_CAPTURE == fh->type) ||
@@ -2040,7 +2040,7 @@ static __poll_t cx231xx_v4l2_poll(struct file *filp, poll_table *wait)
2040 mutex_unlock(&dev->lock); 2040 mutex_unlock(&dev->lock);
2041 return res; 2041 return res;
2042 } 2042 }
2043 return res | POLLERR; 2043 return res | EPOLLERR;
2044} 2044}
2045 2045
2046/* 2046/*
diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c
index 87e18d0c5766..d29773b8f696 100644
--- a/drivers/media/usb/gspca/gspca.c
+++ b/drivers/media/usb/gspca/gspca.c
@@ -1877,14 +1877,14 @@ static __poll_t dev_poll(struct file *file, poll_table *wait)
1877 1877
1878 gspca_dbg(gspca_dev, D_FRAM, "poll\n"); 1878 gspca_dbg(gspca_dev, D_FRAM, "poll\n");
1879 1879
1880 if (req_events & POLLPRI) 1880 if (req_events & EPOLLPRI)
1881 ret |= v4l2_ctrl_poll(file, wait); 1881 ret |= v4l2_ctrl_poll(file, wait);
1882 1882
1883 if (req_events & (POLLIN | POLLRDNORM)) { 1883 if (req_events & (EPOLLIN | EPOLLRDNORM)) {
1884 /* if reqbufs is not done, the user would use read() */ 1884 /* if reqbufs is not done, the user would use read() */
1885 if (gspca_dev->memory == GSPCA_MEMORY_NO) { 1885 if (gspca_dev->memory == GSPCA_MEMORY_NO) {
1886 if (read_alloc(gspca_dev, file) != 0) { 1886 if (read_alloc(gspca_dev, file) != 0) {
1887 ret |= POLLERR; 1887 ret |= EPOLLERR;
1888 goto out; 1888 goto out;
1889 } 1889 }
1890 } 1890 }
@@ -1893,17 +1893,17 @@ static __poll_t dev_poll(struct file *file, poll_table *wait)
1893 1893
1894 /* check if an image has been received */ 1894 /* check if an image has been received */
1895 if (mutex_lock_interruptible(&gspca_dev->queue_lock) != 0) { 1895 if (mutex_lock_interruptible(&gspca_dev->queue_lock) != 0) {
1896 ret |= POLLERR; 1896 ret |= EPOLLERR;
1897 goto out; 1897 goto out;
1898 } 1898 }
1899 if (gspca_dev->fr_o != atomic_read(&gspca_dev->fr_i)) 1899 if (gspca_dev->fr_o != atomic_read(&gspca_dev->fr_i))
1900 ret |= POLLIN | POLLRDNORM; 1900 ret |= EPOLLIN | EPOLLRDNORM;
1901 mutex_unlock(&gspca_dev->queue_lock); 1901 mutex_unlock(&gspca_dev->queue_lock);
1902 } 1902 }
1903 1903
1904out: 1904out:
1905 if (!gspca_dev->present) 1905 if (!gspca_dev->present)
1906 ret |= POLLHUP; 1906 ret |= EPOLLHUP;
1907 1907
1908 return ret; 1908 return ret;
1909} 1909}
diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c
index 660d4a65401f..77c3d331ff31 100644
--- a/drivers/media/usb/hdpvr/hdpvr-video.c
+++ b/drivers/media/usb/hdpvr/hdpvr-video.c
@@ -528,7 +528,7 @@ static __poll_t hdpvr_poll(struct file *filp, poll_table *wait)
528 struct hdpvr_device *dev = video_drvdata(filp); 528 struct hdpvr_device *dev = video_drvdata(filp);
529 __poll_t mask = v4l2_ctrl_poll(filp, wait); 529 __poll_t mask = v4l2_ctrl_poll(filp, wait);
530 530
531 if (!(req_events & (POLLIN | POLLRDNORM))) 531 if (!(req_events & (EPOLLIN | EPOLLRDNORM)))
532 return mask; 532 return mask;
533 533
534 mutex_lock(&dev->io_mutex); 534 mutex_lock(&dev->io_mutex);
@@ -553,7 +553,7 @@ static __poll_t hdpvr_poll(struct file *filp, poll_table *wait)
553 buf = hdpvr_get_next_buffer(dev); 553 buf = hdpvr_get_next_buffer(dev);
554 } 554 }
555 if (buf && buf->status == BUFSTAT_READY) 555 if (buf && buf->status == BUFSTAT_READY)
556 mask |= POLLIN | POLLRDNORM; 556 mask |= EPOLLIN | EPOLLRDNORM;
557 557
558 return mask; 558 return mask;
559} 559}
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
index ad6290e1b699..9fdc57c1658f 100644
--- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
@@ -1181,19 +1181,19 @@ static __poll_t pvr2_v4l2_poll(struct file *file, poll_table *wait)
1181 int ret; 1181 int ret;
1182 1182
1183 if (fh->fw_mode_flag) { 1183 if (fh->fw_mode_flag) {
1184 mask |= POLLIN | POLLRDNORM; 1184 mask |= EPOLLIN | EPOLLRDNORM;
1185 return mask; 1185 return mask;
1186 } 1186 }
1187 1187
1188 if (!fh->rhp) { 1188 if (!fh->rhp) {
1189 ret = pvr2_v4l2_iosetup(fh); 1189 ret = pvr2_v4l2_iosetup(fh);
1190 if (ret) return POLLERR; 1190 if (ret) return EPOLLERR;
1191 } 1191 }
1192 1192
1193 poll_wait(file,&fh->wait_data,wait); 1193 poll_wait(file,&fh->wait_data,wait);
1194 1194
1195 if (pvr2_ioread_avail(fh->rhp) >= 0) { 1195 if (pvr2_ioread_avail(fh->rhp) >= 0) {
1196 mask |= POLLIN | POLLRDNORM; 1196 mask |= EPOLLIN | EPOLLRDNORM;
1197 } 1197 }
1198 1198
1199 return mask; 1199 return mask;
diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c
index 17ad978c0172..22389b56ec24 100644
--- a/drivers/media/usb/stkwebcam/stk-webcam.c
+++ b/drivers/media/usb/stkwebcam/stk-webcam.c
@@ -729,10 +729,10 @@ static __poll_t v4l_stk_poll(struct file *fp, poll_table *wait)
729 poll_wait(fp, &dev->wait_frame, wait); 729 poll_wait(fp, &dev->wait_frame, wait);
730 730
731 if (!is_present(dev)) 731 if (!is_present(dev))
732 return POLLERR; 732 return EPOLLERR;
733 733
734 if (!list_empty(&dev->sio_full)) 734 if (!list_empty(&dev->sio_full))
735 return res | POLLIN | POLLRDNORM; 735 return res | EPOLLIN | EPOLLRDNORM;
736 736
737 return res; 737 return res;
738} 738}
diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c
index 96266fa4738c..8314d3fa9241 100644
--- a/drivers/media/usb/tm6000/tm6000-video.c
+++ b/drivers/media/usb/tm6000/tm6000-video.c
@@ -1424,25 +1424,25 @@ __tm6000_poll(struct file *file, struct poll_table_struct *wait)
1424 __poll_t res = 0; 1424 __poll_t res = 0;
1425 1425
1426 if (v4l2_event_pending(&fh->fh)) 1426 if (v4l2_event_pending(&fh->fh))
1427 res = POLLPRI; 1427 res = EPOLLPRI;
1428 else if (req_events & POLLPRI) 1428 else if (req_events & EPOLLPRI)
1429 poll_wait(file, &fh->fh.wait, wait); 1429 poll_wait(file, &fh->fh.wait, wait);
1430 if (V4L2_BUF_TYPE_VIDEO_CAPTURE != fh->type) 1430 if (V4L2_BUF_TYPE_VIDEO_CAPTURE != fh->type)
1431 return res | POLLERR; 1431 return res | EPOLLERR;
1432 1432
1433 if (!!is_res_streaming(fh->dev, fh)) 1433 if (!!is_res_streaming(fh->dev, fh))
1434 return res | POLLERR; 1434 return res | EPOLLERR;
1435 1435
1436 if (!is_res_read(fh->dev, fh)) { 1436 if (!is_res_read(fh->dev, fh)) {
1437 /* streaming capture */ 1437 /* streaming capture */
1438 if (list_empty(&fh->vb_vidq.stream)) 1438 if (list_empty(&fh->vb_vidq.stream))
1439 return res | POLLERR; 1439 return res | EPOLLERR;
1440 buf = list_entry(fh->vb_vidq.stream.next, struct tm6000_buffer, vb.stream); 1440 buf = list_entry(fh->vb_vidq.stream.next, struct tm6000_buffer, vb.stream);
1441 poll_wait(file, &buf->vb.done, wait); 1441 poll_wait(file, &buf->vb.done, wait);
1442 if (buf->vb.state == VIDEOBUF_DONE || 1442 if (buf->vb.state == VIDEOBUF_DONE ||
1443 buf->vb.state == VIDEOBUF_ERROR) 1443 buf->vb.state == VIDEOBUF_ERROR)
1444 return res | POLLIN | POLLRDNORM; 1444 return res | EPOLLIN | EPOLLRDNORM;
1445 } else if (req_events & (POLLIN | POLLRDNORM)) { 1445 } else if (req_events & (EPOLLIN | EPOLLRDNORM)) {
1446 /* read() capture */ 1446 /* read() capture */
1447 return res | videobuf_poll_stream(file, &fh->vb_vidq, wait); 1447 return res | videobuf_poll_stream(file, &fh->vb_vidq, wait);
1448 } 1448 }
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index b07657149434..ce08b50b8290 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -3462,7 +3462,7 @@ __poll_t v4l2_ctrl_poll(struct file *file, struct poll_table_struct *wait)
3462 struct v4l2_fh *fh = file->private_data; 3462 struct v4l2_fh *fh = file->private_data;
3463 3463
3464 if (v4l2_event_pending(fh)) 3464 if (v4l2_event_pending(fh))
3465 return POLLPRI; 3465 return EPOLLPRI;
3466 poll_wait(file, &fh->wait, wait); 3466 poll_wait(file, &fh->wait, wait);
3467 return 0; 3467 return 0;
3468} 3468}
diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c
index cd8127d3f863..0301fe426a43 100644
--- a/drivers/media/v4l2-core/v4l2-dev.c
+++ b/drivers/media/v4l2-core/v4l2-dev.c
@@ -334,7 +334,7 @@ static ssize_t v4l2_write(struct file *filp, const char __user *buf,
334static __poll_t v4l2_poll(struct file *filp, struct poll_table_struct *poll) 334static __poll_t v4l2_poll(struct file *filp, struct poll_table_struct *poll)
335{ 335{
336 struct video_device *vdev = video_devdata(filp); 336 struct video_device *vdev = video_devdata(filp);
337 __poll_t res = POLLERR | POLLHUP; 337 __poll_t res = EPOLLERR | EPOLLHUP;
338 338
339 if (!vdev->fops->poll) 339 if (!vdev->fops->poll)
340 return DEFAULT_POLLMASK; 340 return DEFAULT_POLLMASK;
diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c
index 186156f8952a..c4f963d96a79 100644
--- a/drivers/media/v4l2-core/v4l2-mem2mem.c
+++ b/drivers/media/v4l2-core/v4l2-mem2mem.c
@@ -514,10 +514,10 @@ __poll_t v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
514 struct v4l2_fh *fh = file->private_data; 514 struct v4l2_fh *fh = file->private_data;
515 515
516 if (v4l2_event_pending(fh)) 516 if (v4l2_event_pending(fh))
517 rc = POLLPRI; 517 rc = EPOLLPRI;
518 else if (req_events & POLLPRI) 518 else if (req_events & EPOLLPRI)
519 poll_wait(file, &fh->wait, wait); 519 poll_wait(file, &fh->wait, wait);
520 if (!(req_events & (POLLOUT | POLLWRNORM | POLLIN | POLLRDNORM))) 520 if (!(req_events & (EPOLLOUT | EPOLLWRNORM | EPOLLIN | EPOLLRDNORM)))
521 return rc; 521 return rc;
522 } 522 }
523 523
@@ -531,7 +531,7 @@ __poll_t v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
531 */ 531 */
532 if ((!src_q->streaming || list_empty(&src_q->queued_list)) 532 if ((!src_q->streaming || list_empty(&src_q->queued_list))
533 && (!dst_q->streaming || list_empty(&dst_q->queued_list))) { 533 && (!dst_q->streaming || list_empty(&dst_q->queued_list))) {
534 rc |= POLLERR; 534 rc |= EPOLLERR;
535 goto end; 535 goto end;
536 } 536 }
537 537
@@ -548,7 +548,7 @@ __poll_t v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
548 */ 548 */
549 if (dst_q->last_buffer_dequeued) { 549 if (dst_q->last_buffer_dequeued) {
550 spin_unlock_irqrestore(&dst_q->done_lock, flags); 550 spin_unlock_irqrestore(&dst_q->done_lock, flags);
551 return rc | POLLIN | POLLRDNORM; 551 return rc | EPOLLIN | EPOLLRDNORM;
552 } 552 }
553 553
554 poll_wait(file, &dst_q->done_wq, wait); 554 poll_wait(file, &dst_q->done_wq, wait);
@@ -561,7 +561,7 @@ __poll_t v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
561 done_entry); 561 done_entry);
562 if (src_vb && (src_vb->state == VB2_BUF_STATE_DONE 562 if (src_vb && (src_vb->state == VB2_BUF_STATE_DONE
563 || src_vb->state == VB2_BUF_STATE_ERROR)) 563 || src_vb->state == VB2_BUF_STATE_ERROR))
564 rc |= POLLOUT | POLLWRNORM; 564 rc |= EPOLLOUT | EPOLLWRNORM;
565 spin_unlock_irqrestore(&src_q->done_lock, flags); 565 spin_unlock_irqrestore(&src_q->done_lock, flags);
566 566
567 spin_lock_irqsave(&dst_q->done_lock, flags); 567 spin_lock_irqsave(&dst_q->done_lock, flags);
@@ -570,7 +570,7 @@ __poll_t v4l2_m2m_poll(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
570 done_entry); 570 done_entry);
571 if (dst_vb && (dst_vb->state == VB2_BUF_STATE_DONE 571 if (dst_vb && (dst_vb->state == VB2_BUF_STATE_DONE
572 || dst_vb->state == VB2_BUF_STATE_ERROR)) 572 || dst_vb->state == VB2_BUF_STATE_ERROR))
573 rc |= POLLIN | POLLRDNORM; 573 rc |= EPOLLIN | EPOLLRDNORM;
574 spin_unlock_irqrestore(&dst_q->done_lock, flags); 574 spin_unlock_irqrestore(&dst_q->done_lock, flags);
575 575
576end: 576end:
diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index 28966fa8c610..c5639817db34 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -476,12 +476,12 @@ static __poll_t subdev_poll(struct file *file, poll_table *wait)
476 struct v4l2_fh *fh = file->private_data; 476 struct v4l2_fh *fh = file->private_data;
477 477
478 if (!(sd->flags & V4L2_SUBDEV_FL_HAS_EVENTS)) 478 if (!(sd->flags & V4L2_SUBDEV_FL_HAS_EVENTS))
479 return POLLERR; 479 return EPOLLERR;
480 480
481 poll_wait(file, &fh->wait, wait); 481 poll_wait(file, &fh->wait, wait);
482 482
483 if (v4l2_event_pending(fh)) 483 if (v4l2_event_pending(fh))
484 return POLLPRI; 484 return EPOLLPRI;
485 485
486 return 0; 486 return 0;
487} 487}
diff --git a/drivers/media/v4l2-core/videobuf-core.c b/drivers/media/v4l2-core/videobuf-core.c
index 9a89d3ae170f..2b3981842b4b 100644
--- a/drivers/media/v4l2-core/videobuf-core.c
+++ b/drivers/media/v4l2-core/videobuf-core.c
@@ -1131,11 +1131,11 @@ __poll_t videobuf_poll_stream(struct file *file,
1131 if (!list_empty(&q->stream)) 1131 if (!list_empty(&q->stream))
1132 buf = list_entry(q->stream.next, 1132 buf = list_entry(q->stream.next,
1133 struct videobuf_buffer, stream); 1133 struct videobuf_buffer, stream);
1134 } else if (req_events & (POLLIN | POLLRDNORM)) { 1134 } else if (req_events & (EPOLLIN | EPOLLRDNORM)) {
1135 if (!q->reading) 1135 if (!q->reading)
1136 __videobuf_read_start(q); 1136 __videobuf_read_start(q);
1137 if (!q->reading) { 1137 if (!q->reading) {
1138 rc = POLLERR; 1138 rc = EPOLLERR;
1139 } else if (NULL == q->read_buf) { 1139 } else if (NULL == q->read_buf) {
1140 q->read_buf = list_entry(q->stream.next, 1140 q->read_buf = list_entry(q->stream.next,
1141 struct videobuf_buffer, 1141 struct videobuf_buffer,
@@ -1146,7 +1146,7 @@ __poll_t videobuf_poll_stream(struct file *file,
1146 buf = q->read_buf; 1146 buf = q->read_buf;
1147 } 1147 }
1148 if (!buf) 1148 if (!buf)
1149 rc = POLLERR; 1149 rc = EPOLLERR;
1150 1150
1151 if (0 == rc) { 1151 if (0 == rc) {
1152 poll_wait(file, &buf->done, wait); 1152 poll_wait(file, &buf->done, wait);
@@ -1157,10 +1157,10 @@ __poll_t videobuf_poll_stream(struct file *file,
1157 case V4L2_BUF_TYPE_VBI_OUTPUT: 1157 case V4L2_BUF_TYPE_VBI_OUTPUT:
1158 case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: 1158 case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT:
1159 case V4L2_BUF_TYPE_SDR_OUTPUT: 1159 case V4L2_BUF_TYPE_SDR_OUTPUT:
1160 rc = POLLOUT | POLLWRNORM; 1160 rc = EPOLLOUT | EPOLLWRNORM;
1161 break; 1161 break;
1162 default: 1162 default:
1163 rc = POLLIN | POLLRDNORM; 1163 rc = EPOLLIN | EPOLLRDNORM;
1164 break; 1164 break;
1165 } 1165 }
1166 } 1166 }
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c
index fcb3a92ae85f..8ba41073dd89 100644
--- a/drivers/mfd/ab8500-debugfs.c
+++ b/drivers/mfd/ab8500-debugfs.c
@@ -1267,7 +1267,7 @@ static irqreturn_t ab8500_debug_handler(int irq, void *data)
1267 if (irq_abb < num_irqs) 1267 if (irq_abb < num_irqs)
1268 irq_count[irq_abb]++; 1268 irq_count[irq_abb]++;
1269 /* 1269 /*
1270 * This makes it possible to use poll for events (POLLPRI | POLLERR) 1270 * This makes it possible to use poll for events (EPOLLPRI | EPOLLERR)
1271 * from userspace on sysfs file named <irq-nr> 1271 * from userspace on sysfs file named <irq-nr>
1272 */ 1272 */
1273 sprintf(buf, "%d", irq); 1273 sprintf(buf, "%d", irq);
diff --git a/drivers/misc/cxl/file.c b/drivers/misc/cxl/file.c
index 0162516f5e57..bd6ddbdb5cd1 100644
--- a/drivers/misc/cxl/file.c
+++ b/drivers/misc/cxl/file.c
@@ -378,11 +378,11 @@ __poll_t afu_poll(struct file *file, struct poll_table_struct *poll)
378 378
379 spin_lock_irqsave(&ctx->lock, flags); 379 spin_lock_irqsave(&ctx->lock, flags);
380 if (ctx_event_pending(ctx)) 380 if (ctx_event_pending(ctx))
381 mask |= POLLIN | POLLRDNORM; 381 mask |= EPOLLIN | EPOLLRDNORM;
382 else if (ctx->status == CLOSED) 382 else if (ctx->status == CLOSED)
383 /* Only error on closed when there are no futher events pending 383 /* Only error on closed when there are no futher events pending
384 */ 384 */
385 mask |= POLLERR; 385 mask |= EPOLLERR;
386 spin_unlock_irqrestore(&ctx->lock, flags); 386 spin_unlock_irqrestore(&ctx->lock, flags);
387 387
388 pr_devel("afu_poll pe: %i returning %#x\n", ctx->pe, mask); 388 pr_devel("afu_poll pe: %i returning %#x\n", ctx->pe, mask);
diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c
index 35693c0a78e2..e9c9ef52c76a 100644
--- a/drivers/misc/hpilo.c
+++ b/drivers/misc/hpilo.c
@@ -519,9 +519,9 @@ static __poll_t ilo_poll(struct file *fp, poll_table *wait)
519 poll_wait(fp, &data->ccb_waitq, wait); 519 poll_wait(fp, &data->ccb_waitq, wait);
520 520
521 if (is_channel_reset(driver_ccb)) 521 if (is_channel_reset(driver_ccb))
522 return POLLERR; 522 return EPOLLERR;
523 else if (ilo_pkt_recv(data->ilo_hw, driver_ccb)) 523 else if (ilo_pkt_recv(data->ilo_hw, driver_ccb))
524 return POLLIN | POLLRDNORM; 524 return EPOLLIN | EPOLLRDNORM;
525 525
526 return 0; 526 return 0;
527} 527}
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c
index e49888eab87d..e9bb1cfa6a7a 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d.c
@@ -658,7 +658,7 @@ static __poll_t lis3lv02d_misc_poll(struct file *file, poll_table *wait)
658 658
659 poll_wait(file, &lis3->misc_wait, wait); 659 poll_wait(file, &lis3->misc_wait, wait);
660 if (atomic_read(&lis3->count)) 660 if (atomic_read(&lis3->count))
661 return POLLIN | POLLRDNORM; 661 return EPOLLIN | EPOLLRDNORM;
662 return 0; 662 return 0;
663} 663}
664 664
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c
index 505b710291e6..758dc73602d5 100644
--- a/drivers/misc/mei/main.c
+++ b/drivers/misc/mei/main.c
@@ -551,31 +551,31 @@ static __poll_t mei_poll(struct file *file, poll_table *wait)
551 bool notify_en; 551 bool notify_en;
552 552
553 if (WARN_ON(!cl || !cl->dev)) 553 if (WARN_ON(!cl || !cl->dev))
554 return POLLERR; 554 return EPOLLERR;
555 555
556 dev = cl->dev; 556 dev = cl->dev;
557 557
558 mutex_lock(&dev->device_lock); 558 mutex_lock(&dev->device_lock);
559 559
560 notify_en = cl->notify_en && (req_events & POLLPRI); 560 notify_en = cl->notify_en && (req_events & EPOLLPRI);
561 561
562 if (dev->dev_state != MEI_DEV_ENABLED || 562 if (dev->dev_state != MEI_DEV_ENABLED ||
563 !mei_cl_is_connected(cl)) { 563 !mei_cl_is_connected(cl)) {
564 mask = POLLERR; 564 mask = EPOLLERR;
565 goto out; 565 goto out;
566 } 566 }
567 567
568 if (notify_en) { 568 if (notify_en) {
569 poll_wait(file, &cl->ev_wait, wait); 569 poll_wait(file, &cl->ev_wait, wait);
570 if (cl->notify_ev) 570 if (cl->notify_ev)
571 mask |= POLLPRI; 571 mask |= EPOLLPRI;
572 } 572 }
573 573
574 if (req_events & (POLLIN | POLLRDNORM)) { 574 if (req_events & (EPOLLIN | EPOLLRDNORM)) {
575 poll_wait(file, &cl->rx_wait, wait); 575 poll_wait(file, &cl->rx_wait, wait);
576 576
577 if (!list_empty(&cl->rd_completed)) 577 if (!list_empty(&cl->rd_completed))
578 mask |= POLLIN | POLLRDNORM; 578 mask |= EPOLLIN | EPOLLRDNORM;
579 else 579 else
580 mei_cl_read_start(cl, mei_cl_mtu(cl), file); 580 mei_cl_read_start(cl, mei_cl_mtu(cl), file);
581 } 581 }
diff --git a/drivers/misc/mic/cosm/cosm_scif_server.c b/drivers/misc/mic/cosm/cosm_scif_server.c
index 85f7d09cc65f..05a63286741c 100644
--- a/drivers/misc/mic/cosm/cosm_scif_server.c
+++ b/drivers/misc/mic/cosm/cosm_scif_server.c
@@ -55,7 +55,7 @@
55 * message being sent to host SCIF. SCIF_DISCNCT message processing on the 55 * message being sent to host SCIF. SCIF_DISCNCT message processing on the
56 * host SCIF sets the host COSM SCIF endpoint state to DISCONNECTED and wakes 56 * host SCIF sets the host COSM SCIF endpoint state to DISCONNECTED and wakes
57 * up the host COSM thread blocked in scif_poll(..) resulting in 57 * up the host COSM thread blocked in scif_poll(..) resulting in
58 * scif_poll(..) returning POLLHUP. 58 * scif_poll(..) returning EPOLLHUP.
59 * 5. On the card, scif_peer_release_dev is next called which results in an 59 * 5. On the card, scif_peer_release_dev is next called which results in an
60 * SCIF_EXIT message being sent to the host and after receiving the 60 * SCIF_EXIT message being sent to the host and after receiving the
61 * SCIF_EXIT_ACK from the host the peer device teardown on the card is 61 * SCIF_EXIT_ACK from the host the peer device teardown on the card is
@@ -79,7 +79,7 @@
79 * processing. This results in the COSM endpoint on the card being closed and 79 * processing. This results in the COSM endpoint on the card being closed and
80 * the SCIF host peer device on the card getting unregistered similar to 80 * the SCIF host peer device on the card getting unregistered similar to
81 * steps 3, 4 and 5 for the card shutdown case above. scif_poll(..) on the 81 * steps 3, 4 and 5 for the card shutdown case above. scif_poll(..) on the
82 * host returns POLLHUP as a result. 82 * host returns EPOLLHUP as a result.
83 * 4. On the host, card peer device unregister and SCIF HW remove(..) also 83 * 4. On the host, card peer device unregister and SCIF HW remove(..) also
84 * subsequently complete. 84 * subsequently complete.
85 * 85 *
@@ -87,11 +87,11 @@
87 * ---------- 87 * ----------
88 * If a reset is issued after the card has crashed, there is no SCIF_DISCNT 88 * If a reset is issued after the card has crashed, there is no SCIF_DISCNT
89 * message from the card which would result in scif_poll(..) returning 89 * message from the card which would result in scif_poll(..) returning
90 * POLLHUP. In this case when the host SCIF driver sends a SCIF_REMOVE_NODE 90 * EPOLLHUP. In this case when the host SCIF driver sends a SCIF_REMOVE_NODE
91 * message to itself resulting in the card SCIF peer device being unregistered, 91 * message to itself resulting in the card SCIF peer device being unregistered,
92 * this results in a scif_peer_release_dev -> scif_cleanup_scifdev-> 92 * this results in a scif_peer_release_dev -> scif_cleanup_scifdev->
93 * scif_invalidate_ep call sequence which sets the endpoint state to 93 * scif_invalidate_ep call sequence which sets the endpoint state to
94 * DISCONNECTED and results in scif_poll(..) returning POLLHUP. 94 * DISCONNECTED and results in scif_poll(..) returning EPOLLHUP.
95 */ 95 */
96 96
97#define COSM_SCIF_BACKLOG 16 97#define COSM_SCIF_BACKLOG 16
@@ -190,7 +190,7 @@ static void cosm_send_time(struct cosm_device *cdev)
190 190
191/* 191/*
192 * Close this cosm_device's endpoint after its peer endpoint on the card has 192 * Close this cosm_device's endpoint after its peer endpoint on the card has
193 * been closed. In all cases except MIC card crash POLLHUP on the host is 193 * been closed. In all cases except MIC card crash EPOLLHUP on the host is
194 * triggered by the client's endpoint being closed. 194 * triggered by the client's endpoint being closed.
195 */ 195 */
196static void cosm_scif_close(struct cosm_device *cdev) 196static void cosm_scif_close(struct cosm_device *cdev)
@@ -252,7 +252,7 @@ void cosm_scif_work(struct work_struct *work)
252 252
253 while (1) { 253 while (1) {
254 pollepd.epd = cdev->epd; 254 pollepd.epd = cdev->epd;
255 pollepd.events = POLLIN; 255 pollepd.events = EPOLLIN;
256 256
257 /* Drop the mutex before blocking in scif_poll(..) */ 257 /* Drop the mutex before blocking in scif_poll(..) */
258 mutex_unlock(&cdev->cosm_mutex); 258 mutex_unlock(&cdev->cosm_mutex);
@@ -266,11 +266,11 @@ void cosm_scif_work(struct work_struct *work)
266 } 266 }
267 267
268 /* There is a message from the card */ 268 /* There is a message from the card */
269 if (pollepd.revents & POLLIN) 269 if (pollepd.revents & EPOLLIN)
270 cosm_scif_recv(cdev); 270 cosm_scif_recv(cdev);
271 271
272 /* The peer endpoint is closed or this endpoint disconnected */ 272 /* The peer endpoint is closed or this endpoint disconnected */
273 if (pollepd.revents & POLLHUP) { 273 if (pollepd.revents & EPOLLHUP) {
274 cosm_scif_close(cdev); 274 cosm_scif_close(cdev);
275 break; 275 break;
276 } 276 }
diff --git a/drivers/misc/mic/cosm_client/cosm_scif_client.c b/drivers/misc/mic/cosm_client/cosm_scif_client.c
index aa530fcceaa9..beafc0da4027 100644
--- a/drivers/misc/mic/cosm_client/cosm_scif_client.c
+++ b/drivers/misc/mic/cosm_client/cosm_scif_client.c
@@ -160,7 +160,7 @@ static int cosm_scif_client(void *unused)
160 160
161 while (!kthread_should_stop()) { 161 while (!kthread_should_stop()) {
162 pollepd.epd = client_epd; 162 pollepd.epd = client_epd;
163 pollepd.events = POLLIN; 163 pollepd.events = EPOLLIN;
164 164
165 rc = scif_poll(&pollepd, 1, COSM_HEARTBEAT_SEND_MSEC); 165 rc = scif_poll(&pollepd, 1, COSM_HEARTBEAT_SEND_MSEC);
166 if (rc < 0) { 166 if (rc < 0) {
@@ -171,7 +171,7 @@ static int cosm_scif_client(void *unused)
171 continue; 171 continue;
172 } 172 }
173 173
174 if (pollepd.revents & POLLIN) 174 if (pollepd.revents & EPOLLIN)
175 cosm_client_recv(); 175 cosm_client_recv();
176 176
177 msg.id = COSM_MSG_HEARTBEAT; 177 msg.id = COSM_MSG_HEARTBEAT;
diff --git a/drivers/misc/mic/scif/scif_api.c b/drivers/misc/mic/scif/scif_api.c
index 8a3e48ec37dd..7b2dddcdd46d 100644
--- a/drivers/misc/mic/scif/scif_api.c
+++ b/drivers/misc/mic/scif/scif_api.c
@@ -1328,7 +1328,7 @@ __scif_pollfd(struct file *f, poll_table *wait, struct scif_endpt *ep)
1328 if (ep->state == SCIFEP_CONNECTED || 1328 if (ep->state == SCIFEP_CONNECTED ||
1329 ep->state == SCIFEP_DISCONNECTED || 1329 ep->state == SCIFEP_DISCONNECTED ||
1330 ep->conn_err) 1330 ep->conn_err)
1331 mask |= POLLOUT; 1331 mask |= EPOLLOUT;
1332 goto exit; 1332 goto exit;
1333 } 1333 }
1334 } 1334 }
@@ -1338,34 +1338,34 @@ __scif_pollfd(struct file *f, poll_table *wait, struct scif_endpt *ep)
1338 _scif_poll_wait(f, &ep->conwq, wait, ep); 1338 _scif_poll_wait(f, &ep->conwq, wait, ep);
1339 if (ep->state == SCIFEP_LISTENING) { 1339 if (ep->state == SCIFEP_LISTENING) {
1340 if (ep->conreqcnt) 1340 if (ep->conreqcnt)
1341 mask |= POLLIN; 1341 mask |= EPOLLIN;
1342 goto exit; 1342 goto exit;
1343 } 1343 }
1344 } 1344 }
1345 1345
1346 /* Endpoint is connected or disconnected */ 1346 /* Endpoint is connected or disconnected */
1347 if (ep->state == SCIFEP_CONNECTED || ep->state == SCIFEP_DISCONNECTED) { 1347 if (ep->state == SCIFEP_CONNECTED || ep->state == SCIFEP_DISCONNECTED) {
1348 if (poll_requested_events(wait) & POLLIN) 1348 if (poll_requested_events(wait) & EPOLLIN)
1349 _scif_poll_wait(f, &ep->recvwq, wait, ep); 1349 _scif_poll_wait(f, &ep->recvwq, wait, ep);
1350 if (poll_requested_events(wait) & POLLOUT) 1350 if (poll_requested_events(wait) & EPOLLOUT)
1351 _scif_poll_wait(f, &ep->sendwq, wait, ep); 1351 _scif_poll_wait(f, &ep->sendwq, wait, ep);
1352 if (ep->state == SCIFEP_CONNECTED || 1352 if (ep->state == SCIFEP_CONNECTED ||
1353 ep->state == SCIFEP_DISCONNECTED) { 1353 ep->state == SCIFEP_DISCONNECTED) {
1354 /* Data can be read without blocking */ 1354 /* Data can be read without blocking */
1355 if (scif_rb_count(&ep->qp_info.qp->inbound_q, 1)) 1355 if (scif_rb_count(&ep->qp_info.qp->inbound_q, 1))
1356 mask |= POLLIN; 1356 mask |= EPOLLIN;
1357 /* Data can be written without blocking */ 1357 /* Data can be written without blocking */
1358 if (scif_rb_space(&ep->qp_info.qp->outbound_q)) 1358 if (scif_rb_space(&ep->qp_info.qp->outbound_q))
1359 mask |= POLLOUT; 1359 mask |= EPOLLOUT;
1360 /* Return POLLHUP if endpoint is disconnected */ 1360 /* Return EPOLLHUP if endpoint is disconnected */
1361 if (ep->state == SCIFEP_DISCONNECTED) 1361 if (ep->state == SCIFEP_DISCONNECTED)
1362 mask |= POLLHUP; 1362 mask |= EPOLLHUP;
1363 goto exit; 1363 goto exit;
1364 } 1364 }
1365 } 1365 }
1366 1366
1367 /* Return POLLERR if the endpoint is in none of the above states */ 1367 /* Return EPOLLERR if the endpoint is in none of the above states */
1368 mask |= POLLERR; 1368 mask |= EPOLLERR;
1369exit: 1369exit:
1370 spin_unlock(&ep->lock); 1370 spin_unlock(&ep->lock);
1371 return mask; 1371 return mask;
@@ -1398,10 +1398,10 @@ scif_poll(struct scif_pollepd *ufds, unsigned int nfds, long timeout_msecs)
1398 pt = &table.pt; 1398 pt = &table.pt;
1399 while (1) { 1399 while (1) {
1400 for (i = 0; i < nfds; i++) { 1400 for (i = 0; i < nfds; i++) {
1401 pt->_key = ufds[i].events | POLLERR | POLLHUP; 1401 pt->_key = ufds[i].events | EPOLLERR | EPOLLHUP;
1402 mask = __scif_pollfd(ufds[i].epd->anon, 1402 mask = __scif_pollfd(ufds[i].epd->anon,
1403 pt, ufds[i].epd); 1403 pt, ufds[i].epd);
1404 mask &= ufds[i].events | POLLERR | POLLHUP; 1404 mask &= ufds[i].events | EPOLLERR | EPOLLHUP;
1405 if (mask) { 1405 if (mask) {
1406 count++; 1406 count++;
1407 pt->_qproc = NULL; 1407 pt->_qproc = NULL;
diff --git a/drivers/misc/mic/vop/vop_vringh.c b/drivers/misc/mic/vop/vop_vringh.c
index 01d1f2ba7bb8..cbc8ebcff5cf 100644
--- a/drivers/misc/mic/vop/vop_vringh.c
+++ b/drivers/misc/mic/vop/vop_vringh.c
@@ -1010,7 +1010,7 @@ __unlock_ret:
1010} 1010}
1011 1011
1012/* 1012/*
1013 * We return POLLIN | POLLOUT from poll when new buffers are enqueued, and 1013 * We return EPOLLIN | EPOLLOUT from poll when new buffers are enqueued, and
1014 * not when previously enqueued buffers may be available. This means that 1014 * not when previously enqueued buffers may be available. This means that
1015 * in the card->host (TX) path, when userspace is unblocked by poll it 1015 * in the card->host (TX) path, when userspace is unblocked by poll it
1016 * must drain all available descriptors or it can stall. 1016 * must drain all available descriptors or it can stall.
@@ -1022,15 +1022,15 @@ static __poll_t vop_poll(struct file *f, poll_table *wait)
1022 1022
1023 mutex_lock(&vdev->vdev_mutex); 1023 mutex_lock(&vdev->vdev_mutex);
1024 if (vop_vdev_inited(vdev)) { 1024 if (vop_vdev_inited(vdev)) {
1025 mask = POLLERR; 1025 mask = EPOLLERR;
1026 goto done; 1026 goto done;
1027 } 1027 }
1028 poll_wait(f, &vdev->waitq, wait); 1028 poll_wait(f, &vdev->waitq, wait);
1029 if (vop_vdev_inited(vdev)) { 1029 if (vop_vdev_inited(vdev)) {
1030 mask = POLLERR; 1030 mask = EPOLLERR;
1031 } else if (vdev->poll_wake) { 1031 } else if (vdev->poll_wake) {
1032 vdev->poll_wake = 0; 1032 vdev->poll_wake = 0;
1033 mask = POLLIN | POLLOUT; 1033 mask = EPOLLIN | EPOLLOUT;
1034 } 1034 }
1035done: 1035done:
1036 mutex_unlock(&vdev->vdev_mutex); 1036 mutex_unlock(&vdev->vdev_mutex);
diff --git a/drivers/misc/ocxl/file.c b/drivers/misc/ocxl/file.c
index c90c1a578d2f..d9aa407db06a 100644
--- a/drivers/misc/ocxl/file.c
+++ b/drivers/misc/ocxl/file.c
@@ -215,9 +215,9 @@ static unsigned int afu_poll(struct file *file, struct poll_table_struct *wait)
215 mutex_unlock(&ctx->status_mutex); 215 mutex_unlock(&ctx->status_mutex);
216 216
217 if (afu_events_pending(ctx)) 217 if (afu_events_pending(ctx))
218 mask = POLLIN | POLLRDNORM; 218 mask = EPOLLIN | EPOLLRDNORM;
219 else if (closed) 219 else if (closed)
220 mask = POLLERR; 220 mask = EPOLLERR;
221 221
222 return mask; 222 return mask;
223} 223}
diff --git a/drivers/misc/phantom.c b/drivers/misc/phantom.c
index 8fa68cf308e0..b084245f6238 100644
--- a/drivers/misc/phantom.c
+++ b/drivers/misc/phantom.c
@@ -265,9 +265,9 @@ static __poll_t phantom_poll(struct file *file, poll_table *wait)
265 poll_wait(file, &dev->wait, wait); 265 poll_wait(file, &dev->wait, wait);
266 266
267 if (!(dev->status & PHB_RUNNING)) 267 if (!(dev->status & PHB_RUNNING))
268 mask = POLLERR; 268 mask = EPOLLERR;
269 else if (atomic_read(&dev->counter)) 269 else if (atomic_read(&dev->counter))
270 mask = POLLIN | POLLRDNORM; 270 mask = EPOLLIN | EPOLLRDNORM;
271 271
272 pr_debug("phantom_poll end: %x/%d\n", mask, atomic_read(&dev->counter)); 272 pr_debug("phantom_poll end: %x/%d\n", mask, atomic_read(&dev->counter));
273 273
diff --git a/drivers/misc/vmw_vmci/vmci_host.c b/drivers/misc/vmw_vmci/vmci_host.c
index 6640e7651533..83e0c95d20a4 100644
--- a/drivers/misc/vmw_vmci/vmci_host.c
+++ b/drivers/misc/vmw_vmci/vmci_host.c
@@ -182,7 +182,7 @@ static __poll_t vmci_host_poll(struct file *filp, poll_table *wait)
182 if (context->pending_datagrams > 0 || 182 if (context->pending_datagrams > 0 ||
183 vmci_handle_arr_get_size( 183 vmci_handle_arr_get_size(
184 context->pending_doorbell_array) > 0) { 184 context->pending_doorbell_array) > 0) {
185 mask = POLLIN; 185 mask = EPOLLIN;
186 } 186 }
187 spin_unlock(&context->lock); 187 spin_unlock(&context->lock);
188 } 188 }
diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
index e412dfdda7dd..377af43b81b3 100644
--- a/drivers/net/ieee802154/ca8210.c
+++ b/drivers/net/ieee802154/ca8210.c
@@ -2648,11 +2648,11 @@ static __poll_t ca8210_test_int_poll(
2648 2648
2649 poll_wait(filp, &priv->test.readq, ptable); 2649 poll_wait(filp, &priv->test.readq, ptable);
2650 if (!kfifo_is_empty(&priv->test.up_fifo)) 2650 if (!kfifo_is_empty(&priv->test.up_fifo))
2651 return_flags |= (POLLIN | POLLRDNORM); 2651 return_flags |= (EPOLLIN | EPOLLRDNORM);
2652 if (wait_event_interruptible( 2652 if (wait_event_interruptible(
2653 priv->test.readq, 2653 priv->test.readq,
2654 !kfifo_is_empty(&priv->test.up_fifo))) { 2654 !kfifo_is_empty(&priv->test.up_fifo))) {
2655 return POLLERR; 2655 return EPOLLERR;
2656 } 2656 }
2657 return return_flags; 2657 return return_flags;
2658} 2658}
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index ef6b2126b23a..255a5def56e9 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -539,11 +539,11 @@ static __poll_t ppp_poll(struct file *file, poll_table *wait)
539 if (!pf) 539 if (!pf)
540 return 0; 540 return 0;
541 poll_wait(file, &pf->rwait, wait); 541 poll_wait(file, &pf->rwait, wait);
542 mask = POLLOUT | POLLWRNORM; 542 mask = EPOLLOUT | EPOLLWRNORM;
543 if (skb_peek(&pf->rq)) 543 if (skb_peek(&pf->rq))
544 mask |= POLLIN | POLLRDNORM; 544 mask |= EPOLLIN | EPOLLRDNORM;
545 if (pf->dead) 545 if (pf->dead)
546 mask |= POLLHUP; 546 mask |= EPOLLHUP;
547 else if (pf->kind == INTERFACE) { 547 else if (pf->kind == INTERFACE) {
548 /* see comment in ppp_read */ 548 /* see comment in ppp_read */
549 struct ppp *ppp = PF_TO_PPP(pf); 549 struct ppp *ppp = PF_TO_PPP(pf);
@@ -551,7 +551,7 @@ static __poll_t ppp_poll(struct file *file, poll_table *wait)
551 ppp_recv_lock(ppp); 551 ppp_recv_lock(ppp);
552 if (ppp->n_channels == 0 && 552 if (ppp->n_channels == 0 &&
553 (ppp->flags & SC_LOOP_TRAFFIC) == 0) 553 (ppp->flags & SC_LOOP_TRAFFIC) == 0)
554 mask |= POLLIN | POLLRDNORM; 554 mask |= EPOLLIN | EPOLLRDNORM;
555 ppp_recv_unlock(ppp); 555 ppp_recv_unlock(ppp);
556 } 556 }
557 557
diff --git a/drivers/net/tap.c b/drivers/net/tap.c
index 0a5ed004781c..9b6cb780affe 100644
--- a/drivers/net/tap.c
+++ b/drivers/net/tap.c
@@ -377,7 +377,7 @@ rx_handler_result_t tap_handle_frame(struct sk_buff **pskb)
377 } 377 }
378 378
379wake_up: 379wake_up:
380 wake_up_interruptible_poll(sk_sleep(&q->sk), POLLIN | POLLRDNORM | POLLRDBAND); 380 wake_up_interruptible_poll(sk_sleep(&q->sk), EPOLLIN | EPOLLRDNORM | EPOLLRDBAND);
381 return RX_HANDLER_CONSUMED; 381 return RX_HANDLER_CONSUMED;
382 382
383drop: 383drop:
@@ -487,7 +487,7 @@ static void tap_sock_write_space(struct sock *sk)
487 487
488 wqueue = sk_sleep(sk); 488 wqueue = sk_sleep(sk);
489 if (wqueue && waitqueue_active(wqueue)) 489 if (wqueue && waitqueue_active(wqueue))
490 wake_up_interruptible_poll(wqueue, POLLOUT | POLLWRNORM | POLLWRBAND); 490 wake_up_interruptible_poll(wqueue, EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND);
491} 491}
492 492
493static void tap_sock_destruct(struct sock *sk) 493static void tap_sock_destruct(struct sock *sk)
@@ -572,7 +572,7 @@ static int tap_release(struct inode *inode, struct file *file)
572static __poll_t tap_poll(struct file *file, poll_table *wait) 572static __poll_t tap_poll(struct file *file, poll_table *wait)
573{ 573{
574 struct tap_queue *q = file->private_data; 574 struct tap_queue *q = file->private_data;
575 __poll_t mask = POLLERR; 575 __poll_t mask = EPOLLERR;
576 576
577 if (!q) 577 if (!q)
578 goto out; 578 goto out;
@@ -581,12 +581,12 @@ static __poll_t tap_poll(struct file *file, poll_table *wait)
581 poll_wait(file, &q->wq.wait, wait); 581 poll_wait(file, &q->wq.wait, wait);
582 582
583 if (!ptr_ring_empty(&q->ring)) 583 if (!ptr_ring_empty(&q->ring))
584 mask |= POLLIN | POLLRDNORM; 584 mask |= EPOLLIN | EPOLLRDNORM;
585 585
586 if (sock_writeable(&q->sk) || 586 if (sock_writeable(&q->sk) ||
587 (!test_and_set_bit(SOCKWQ_ASYNC_NOSPACE, &q->sock.flags) && 587 (!test_and_set_bit(SOCKWQ_ASYNC_NOSPACE, &q->sock.flags) &&
588 sock_writeable(&q->sk))) 588 sock_writeable(&q->sk)))
589 mask |= POLLOUT | POLLWRNORM; 589 mask |= EPOLLOUT | EPOLLWRNORM;
590 590
591out: 591out:
592 return mask; 592 return mask;
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 17e496b88f81..81e6cc951e7f 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1437,7 +1437,7 @@ static __poll_t tun_chr_poll(struct file *file, poll_table *wait)
1437 __poll_t mask = 0; 1437 __poll_t mask = 0;
1438 1438
1439 if (!tun) 1439 if (!tun)
1440 return POLLERR; 1440 return EPOLLERR;
1441 1441
1442 sk = tfile->socket.sk; 1442 sk = tfile->socket.sk;
1443 1443
@@ -1446,16 +1446,16 @@ static __poll_t tun_chr_poll(struct file *file, poll_table *wait)
1446 poll_wait(file, sk_sleep(sk), wait); 1446 poll_wait(file, sk_sleep(sk), wait);
1447 1447
1448 if (!ptr_ring_empty(&tfile->tx_ring)) 1448 if (!ptr_ring_empty(&tfile->tx_ring))
1449 mask |= POLLIN | POLLRDNORM; 1449 mask |= EPOLLIN | EPOLLRDNORM;
1450 1450
1451 if (tun->dev->flags & IFF_UP && 1451 if (tun->dev->flags & IFF_UP &&
1452 (sock_writeable(sk) || 1452 (sock_writeable(sk) ||
1453 (!test_and_set_bit(SOCKWQ_ASYNC_NOSPACE, &sk->sk_socket->flags) && 1453 (!test_and_set_bit(SOCKWQ_ASYNC_NOSPACE, &sk->sk_socket->flags) &&
1454 sock_writeable(sk)))) 1454 sock_writeable(sk))))
1455 mask |= POLLOUT | POLLWRNORM; 1455 mask |= EPOLLOUT | EPOLLWRNORM;
1456 1456
1457 if (tun->dev->reg_state != NETREG_REGISTERED) 1457 if (tun->dev->reg_state != NETREG_REGISTERED)
1458 mask = POLLERR; 1458 mask = EPOLLERR;
1459 1459
1460 tun_put(tun); 1460 tun_put(tun);
1461 return mask; 1461 return mask;
@@ -2310,8 +2310,8 @@ static void tun_sock_write_space(struct sock *sk)
2310 2310
2311 wqueue = sk_sleep(sk); 2311 wqueue = sk_sleep(sk);
2312 if (wqueue && waitqueue_active(wqueue)) 2312 if (wqueue && waitqueue_active(wqueue))
2313 wake_up_interruptible_sync_poll(wqueue, POLLOUT | 2313 wake_up_interruptible_sync_poll(wqueue, EPOLLOUT |
2314 POLLWRNORM | POLLWRBAND); 2314 EPOLLWRNORM | EPOLLWRBAND);
2315 2315
2316 tfile = container_of(sk, struct tun_file, sk); 2316 tfile = container_of(sk, struct tun_file, sk);
2317 kill_fasync(&tfile->fasync, SIGIO, POLL_OUT); 2317 kill_fasync(&tfile->fasync, SIGIO, POLL_OUT);
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c b/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c
index 72c55d1f8903..ac2572943ed0 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00debug.c
@@ -309,7 +309,7 @@ static __poll_t rt2x00debug_poll_queue_dump(struct file *file,
309 poll_wait(file, &intf->frame_dump_waitqueue, wait); 309 poll_wait(file, &intf->frame_dump_waitqueue, wait);
310 310
311 if (!skb_queue_empty(&intf->frame_dump_skbqueue)) 311 if (!skb_queue_empty(&intf->frame_dump_skbqueue))
312 return POLLOUT | POLLWRNORM; 312 return EPOLLOUT | EPOLLWRNORM;
313 313
314 return 0; 314 return 0;
315} 315}
diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
index a60c0ab7883d..47cd0c037433 100644
--- a/drivers/pci/switch/switchtec.c
+++ b/drivers/pci/switch/switchtec.c
@@ -511,15 +511,15 @@ static __poll_t switchtec_dev_poll(struct file *filp, poll_table *wait)
511 poll_wait(filp, &stdev->event_wq, wait); 511 poll_wait(filp, &stdev->event_wq, wait);
512 512
513 if (lock_mutex_and_test_alive(stdev)) 513 if (lock_mutex_and_test_alive(stdev))
514 return POLLIN | POLLRDHUP | POLLOUT | POLLERR | POLLHUP; 514 return EPOLLIN | EPOLLRDHUP | EPOLLOUT | EPOLLERR | EPOLLHUP;
515 515
516 mutex_unlock(&stdev->mrpc_mutex); 516 mutex_unlock(&stdev->mrpc_mutex);
517 517
518 if (try_wait_for_completion(&stuser->comp)) 518 if (try_wait_for_completion(&stuser->comp))
519 ret |= POLLIN | POLLRDNORM; 519 ret |= EPOLLIN | EPOLLRDNORM;
520 520
521 if (stuser->event_cnt != atomic_read(&stdev->event_cnt)) 521 if (stuser->event_cnt != atomic_read(&stdev->event_cnt))
522 ret |= POLLPRI | POLLRDBAND; 522 ret |= EPOLLPRI | EPOLLRDBAND;
523 523
524 return ret; 524 return ret;
525} 525}
diff --git a/drivers/platform/chrome/cros_ec_debugfs.c b/drivers/platform/chrome/cros_ec_debugfs.c
index 5473e602f7e0..0e88e18362c1 100644
--- a/drivers/platform/chrome/cros_ec_debugfs.c
+++ b/drivers/platform/chrome/cros_ec_debugfs.c
@@ -200,7 +200,7 @@ static __poll_t cros_ec_console_log_poll(struct file *file,
200 if (CIRC_CNT(debug_info->log_buffer.head, 200 if (CIRC_CNT(debug_info->log_buffer.head,
201 debug_info->log_buffer.tail, 201 debug_info->log_buffer.tail,
202 LOG_SIZE)) 202 LOG_SIZE))
203 mask |= POLLIN | POLLRDNORM; 203 mask |= EPOLLIN | EPOLLRDNORM;
204 mutex_unlock(&debug_info->log_mutex); 204 mutex_unlock(&debug_info->log_mutex);
205 205
206 return mask; 206 return mask;
diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c
index 999f1152655a..3e32a4c14d5f 100644
--- a/drivers/platform/goldfish/goldfish_pipe.c
+++ b/drivers/platform/goldfish/goldfish_pipe.c
@@ -549,13 +549,13 @@ static __poll_t goldfish_pipe_poll(struct file *filp, poll_table *wait)
549 return -ERESTARTSYS; 549 return -ERESTARTSYS;
550 550
551 if (status & PIPE_POLL_IN) 551 if (status & PIPE_POLL_IN)
552 mask |= POLLIN | POLLRDNORM; 552 mask |= EPOLLIN | EPOLLRDNORM;
553 if (status & PIPE_POLL_OUT) 553 if (status & PIPE_POLL_OUT)
554 mask |= POLLOUT | POLLWRNORM; 554 mask |= EPOLLOUT | EPOLLWRNORM;
555 if (status & PIPE_POLL_HUP) 555 if (status & PIPE_POLL_HUP)
556 mask |= POLLHUP; 556 mask |= EPOLLHUP;
557 if (test_bit(BIT_CLOSED_ON_HOST, &pipe->flags)) 557 if (test_bit(BIT_CLOSED_ON_HOST, &pipe->flags))
558 mask |= POLLERR; 558 mask |= EPOLLERR;
559 559
560 return mask; 560 return mask;
561} 561}
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index a4fabf9d75f3..b205b037fd61 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -4128,7 +4128,7 @@ static __poll_t sonypi_misc_poll(struct file *file, poll_table *wait)
4128{ 4128{
4129 poll_wait(file, &sonypi_compat.fifo_proc_list, wait); 4129 poll_wait(file, &sonypi_compat.fifo_proc_list, wait);
4130 if (kfifo_len(&sonypi_compat.fifo)) 4130 if (kfifo_len(&sonypi_compat.fifo))
4131 return POLLIN | POLLRDNORM; 4131 return EPOLLIN | EPOLLRDNORM;
4132 return 0; 4132 return 0;
4133} 4133}
4134 4134
diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c
index 1d42385b1aa5..8febacb8fc54 100644
--- a/drivers/pps/pps.c
+++ b/drivers/pps/pps.c
@@ -55,7 +55,7 @@ static __poll_t pps_cdev_poll(struct file *file, poll_table *wait)
55 55
56 poll_wait(file, &pps->queue, wait); 56 poll_wait(file, &pps->queue, wait);
57 57
58 return POLLIN | POLLRDNORM; 58 return EPOLLIN | EPOLLRDNORM;
59} 59}
60 60
61static int pps_cdev_fasync(int fd, struct file *file, int on) 61static int pps_cdev_fasync(int fd, struct file *file, int on)
diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c
index a593b4cf47bf..767c485af59b 100644
--- a/drivers/ptp/ptp_chardev.c
+++ b/drivers/ptp/ptp_chardev.c
@@ -286,7 +286,7 @@ __poll_t ptp_poll(struct posix_clock *pc, struct file *fp, poll_table *wait)
286 286
287 poll_wait(fp, &ptp->tsev_wq, wait); 287 poll_wait(fp, &ptp->tsev_wq, wait);
288 288
289 return queue_cnt(&ptp->tsevq) ? POLLIN : 0; 289 return queue_cnt(&ptp->tsevq) ? EPOLLIN : 0;
290} 290}
291 291
292#define EXTTS_BUFSIZE (PTP_BUF_TIMESTAMPS * sizeof(struct ptp_extts_event)) 292#define EXTTS_BUFSIZE (PTP_BUF_TIMESTAMPS * sizeof(struct ptp_extts_event))
diff --git a/drivers/rapidio/devices/rio_mport_cdev.c b/drivers/rapidio/devices/rio_mport_cdev.c
index 6092b3a5978e..cfb54e01d758 100644
--- a/drivers/rapidio/devices/rio_mport_cdev.c
+++ b/drivers/rapidio/devices/rio_mport_cdev.c
@@ -2325,7 +2325,7 @@ static __poll_t mport_cdev_poll(struct file *filp, poll_table *wait)
2325 2325
2326 poll_wait(filp, &priv->event_rx_wait, wait); 2326 poll_wait(filp, &priv->event_rx_wait, wait);
2327 if (kfifo_len(&priv->event_fifo)) 2327 if (kfifo_len(&priv->event_fifo))
2328 return POLLIN | POLLRDNORM; 2328 return EPOLLIN | EPOLLRDNORM;
2329 2329
2330 return 0; 2330 return 0;
2331} 2331}
diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
index 8428eba8cb73..92d0c6a7a837 100644
--- a/drivers/rpmsg/qcom_smd.c
+++ b/drivers/rpmsg/qcom_smd.c
@@ -967,7 +967,7 @@ static __poll_t qcom_smd_poll(struct rpmsg_endpoint *ept,
967 poll_wait(filp, &channel->fblockread_event, wait); 967 poll_wait(filp, &channel->fblockread_event, wait);
968 968
969 if (qcom_smd_get_tx_avail(channel) > 20) 969 if (qcom_smd_get_tx_avail(channel) > 20)
970 mask |= POLLOUT | POLLWRNORM; 970 mask |= EPOLLOUT | EPOLLWRNORM;
971 971
972 return mask; 972 return mask;
973} 973}
diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c
index e622fcda30fa..64b6de9763ee 100644
--- a/drivers/rpmsg/rpmsg_char.c
+++ b/drivers/rpmsg/rpmsg_char.c
@@ -262,12 +262,12 @@ static __poll_t rpmsg_eptdev_poll(struct file *filp, poll_table *wait)
262 __poll_t mask = 0; 262 __poll_t mask = 0;
263 263
264 if (!eptdev->ept) 264 if (!eptdev->ept)
265 return POLLERR; 265 return EPOLLERR;
266 266
267 poll_wait(filp, &eptdev->readq, wait); 267 poll_wait(filp, &eptdev->readq, wait);
268 268
269 if (!skb_queue_empty(&eptdev->queue)) 269 if (!skb_queue_empty(&eptdev->queue))
270 mask |= POLLIN | POLLRDNORM; 270 mask |= EPOLLIN | EPOLLRDNORM;
271 271
272 mask |= rpmsg_poll(eptdev->ept, filp, wait); 272 mask |= rpmsg_poll(eptdev->ept, filp, wait);
273 273
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c
index 5a7b30d0773b..efa221e8bc22 100644
--- a/drivers/rtc/rtc-dev.c
+++ b/drivers/rtc/rtc-dev.c
@@ -203,7 +203,7 @@ static __poll_t rtc_dev_poll(struct file *file, poll_table *wait)
203 203
204 data = rtc->irq_data; 204 data = rtc->irq_data;
205 205
206 return (data != 0) ? (POLLIN | POLLRDNORM) : 0; 206 return (data != 0) ? (EPOLLIN | EPOLLRDNORM) : 0;
207} 207}
208 208
209static long rtc_dev_ioctl(struct file *file, 209static long rtc_dev_ioctl(struct file *file,
diff --git a/drivers/s390/block/dasd_eer.c b/drivers/s390/block/dasd_eer.c
index 0c075d100252..fb2c3599d95c 100644
--- a/drivers/s390/block/dasd_eer.c
+++ b/drivers/s390/block/dasd_eer.c
@@ -671,7 +671,7 @@ static __poll_t dasd_eer_poll(struct file *filp, poll_table *ptable)
671 poll_wait(filp, &dasd_eer_read_wait_queue, ptable); 671 poll_wait(filp, &dasd_eer_read_wait_queue, ptable);
672 spin_lock_irqsave(&bufferlock, flags); 672 spin_lock_irqsave(&bufferlock, flags);
673 if (eerb->head != eerb->tail) 673 if (eerb->head != eerb->tail)
674 mask = POLLIN | POLLRDNORM ; 674 mask = EPOLLIN | EPOLLRDNORM ;
675 else 675 else
676 mask = 0; 676 mask = 0;
677 spin_unlock_irqrestore(&bufferlock, flags); 677 spin_unlock_irqrestore(&bufferlock, flags);
diff --git a/drivers/s390/char/monreader.c b/drivers/s390/char/monreader.c
index 956f662908a6..7bc616b253f1 100644
--- a/drivers/s390/char/monreader.c
+++ b/drivers/s390/char/monreader.c
@@ -435,9 +435,9 @@ static __poll_t mon_poll(struct file *filp, struct poll_table_struct *p)
435 435
436 poll_wait(filp, &mon_read_wait_queue, p); 436 poll_wait(filp, &mon_read_wait_queue, p);
437 if (unlikely(atomic_read(&monpriv->iucv_severed))) 437 if (unlikely(atomic_read(&monpriv->iucv_severed)))
438 return POLLERR; 438 return EPOLLERR;
439 if (atomic_read(&monpriv->read_ready)) 439 if (atomic_read(&monpriv->read_ready))
440 return POLLIN | POLLRDNORM; 440 return EPOLLIN | EPOLLRDNORM;
441 return 0; 441 return 0;
442} 442}
443 443
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 2791141bd035..a71ee67df084 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -7041,7 +7041,7 @@ static __poll_t megasas_mgmt_poll(struct file *file, poll_table *wait)
7041 poll_wait(file, &megasas_poll_wait, wait); 7041 poll_wait(file, &megasas_poll_wait, wait);
7042 spin_lock_irqsave(&poll_aen_lock, flags); 7042 spin_lock_irqsave(&poll_aen_lock, flags);
7043 if (megasas_poll_wait_aen) 7043 if (megasas_poll_wait_aen)
7044 mask = (POLLIN | POLLRDNORM); 7044 mask = (EPOLLIN | EPOLLRDNORM);
7045 else 7045 else
7046 mask = 0; 7046 mask = 0;
7047 megasas_poll_wait_aen = 0; 7047 megasas_poll_wait_aen = 0;
diff --git a/drivers/scsi/mpt3sas/mpt3sas_ctl.c b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
index 9cddc3074cd1..523971aeb4c1 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_ctl.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_ctl.c
@@ -546,7 +546,7 @@ _ctl_poll(struct file *filep, poll_table *wait)
546 list_for_each_entry(ioc, &mpt3sas_ioc_list, list) { 546 list_for_each_entry(ioc, &mpt3sas_ioc_list, list) {
547 if (ioc->aen_event_read_flag) { 547 if (ioc->aen_event_read_flag) {
548 spin_unlock(&gioc_lock); 548 spin_unlock(&gioc_lock);
549 return POLLIN | POLLRDNORM; 549 return EPOLLIN | EPOLLRDNORM;
550 } 550 }
551 } 551 }
552 spin_unlock(&gioc_lock); 552 spin_unlock(&gioc_lock);
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 0c434453aab3..c198b96368dd 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1152,27 +1152,27 @@ sg_poll(struct file *filp, poll_table * wait)
1152 1152
1153 sfp = filp->private_data; 1153 sfp = filp->private_data;
1154 if (!sfp) 1154 if (!sfp)
1155 return POLLERR; 1155 return EPOLLERR;
1156 sdp = sfp->parentdp; 1156 sdp = sfp->parentdp;
1157 if (!sdp) 1157 if (!sdp)
1158 return POLLERR; 1158 return EPOLLERR;
1159 poll_wait(filp, &sfp->read_wait, wait); 1159 poll_wait(filp, &sfp->read_wait, wait);
1160 read_lock_irqsave(&sfp->rq_list_lock, iflags); 1160 read_lock_irqsave(&sfp->rq_list_lock, iflags);
1161 list_for_each_entry(srp, &sfp->rq_list, entry) { 1161 list_for_each_entry(srp, &sfp->rq_list, entry) {
1162 /* if any read waiting, flag it */ 1162 /* if any read waiting, flag it */
1163 if ((0 == res) && (1 == srp->done) && (!srp->sg_io_owned)) 1163 if ((0 == res) && (1 == srp->done) && (!srp->sg_io_owned))
1164 res = POLLIN | POLLRDNORM; 1164 res = EPOLLIN | EPOLLRDNORM;
1165 ++count; 1165 ++count;
1166 } 1166 }
1167 read_unlock_irqrestore(&sfp->rq_list_lock, iflags); 1167 read_unlock_irqrestore(&sfp->rq_list_lock, iflags);
1168 1168
1169 if (atomic_read(&sdp->detaching)) 1169 if (atomic_read(&sdp->detaching))
1170 res |= POLLHUP; 1170 res |= EPOLLHUP;
1171 else if (!sfp->cmd_q) { 1171 else if (!sfp->cmd_q) {
1172 if (0 == count) 1172 if (0 == count)
1173 res |= POLLOUT | POLLWRNORM; 1173 res |= EPOLLOUT | EPOLLWRNORM;
1174 } else if (count < SG_MAX_QUEUE) 1174 } else if (count < SG_MAX_QUEUE)
1175 res |= POLLOUT | POLLWRNORM; 1175 res |= EPOLLOUT | EPOLLWRNORM;
1176 SCSI_LOG_TIMEOUT(3, sg_printk(KERN_INFO, sdp, 1176 SCSI_LOG_TIMEOUT(3, sg_printk(KERN_INFO, sdp,
1177 "sg_poll: res=0x%x\n", (__force u32) res)); 1177 "sg_poll: res=0x%x\n", (__force u32) res));
1178 return res; 1178 return res;
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index ef733847eebe..c13772a0df58 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2288,7 +2288,7 @@ static __poll_t comedi_poll(struct file *file, poll_table *wait)
2288 if (s->busy != file || !comedi_is_subdevice_running(s) || 2288 if (s->busy != file || !comedi_is_subdevice_running(s) ||
2289 (s->async->cmd.flags & CMDF_WRITE) || 2289 (s->async->cmd.flags & CMDF_WRITE) ||
2290 comedi_buf_read_n_available(s) > 0) 2290 comedi_buf_read_n_available(s) > 0)
2291 mask |= POLLIN | POLLRDNORM; 2291 mask |= EPOLLIN | EPOLLRDNORM;
2292 } 2292 }
2293 2293
2294 s = comedi_file_write_subdevice(file); 2294 s = comedi_file_write_subdevice(file);
@@ -2300,7 +2300,7 @@ static __poll_t comedi_poll(struct file *file, poll_table *wait)
2300 if (s->busy != file || !comedi_is_subdevice_running(s) || 2300 if (s->busy != file || !comedi_is_subdevice_running(s) ||
2301 !(s->async->cmd.flags & CMDF_WRITE) || 2301 !(s->async->cmd.flags & CMDF_WRITE) ||
2302 comedi_buf_write_n_available(s) >= bps) 2302 comedi_buf_write_n_available(s) >= bps)
2303 mask |= POLLOUT | POLLWRNORM; 2303 mask |= EPOLLOUT | EPOLLWRNORM;
2304 } 2304 }
2305 2305
2306done: 2306done:
diff --git a/drivers/staging/comedi/drivers/serial2002.c b/drivers/staging/comedi/drivers/serial2002.c
index ab69eeb2c1f1..b3f3b4a201af 100644
--- a/drivers/staging/comedi/drivers/serial2002.c
+++ b/drivers/staging/comedi/drivers/serial2002.c
@@ -114,8 +114,8 @@ static void serial2002_tty_read_poll_wait(struct file *f, int timeout)
114 __poll_t mask; 114 __poll_t mask;
115 115
116 mask = f->f_op->poll(f, &table.pt); 116 mask = f->f_op->poll(f, &table.pt);
117 if (mask & (POLLRDNORM | POLLRDBAND | POLLIN | 117 if (mask & (EPOLLRDNORM | EPOLLRDBAND | EPOLLIN |
118 POLLHUP | POLLERR)) { 118 EPOLLHUP | EPOLLERR)) {
119 break; 119 break;
120 } 120 }
121 now = ktime_get(); 121 now = ktime_get();
diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
index 1993b03a6f2d..e8bfe5520bc7 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -37,7 +37,7 @@ module_param_named(loop, create_loop_dev, bool, 0644);
37/* 37/*
38 * Threshold below which the tty is woken for writing 38 * Threshold below which the tty is woken for writing
39 * - should be equal to WAKEUP_CHARS in drivers/tty/n_tty.c because 39 * - should be equal to WAKEUP_CHARS in drivers/tty/n_tty.c because
40 * even if the writer is woken, n_tty_poll() won't set POLLOUT until 40 * even if the writer is woken, n_tty_poll() won't set EPOLLOUT until
41 * our fifo is below this level 41 * our fifo is below this level
42 */ 42 */
43#define WAKEUP_CHARS 256 43#define WAKEUP_CHARS 256
diff --git a/drivers/staging/greybus/tools/loopback_test.c b/drivers/staging/greybus/tools/loopback_test.c
index c51610ce24af..b82e2befe935 100644
--- a/drivers/staging/greybus/tools/loopback_test.c
+++ b/drivers/staging/greybus/tools/loopback_test.c
@@ -663,7 +663,7 @@ static int open_poll_files(struct loopback_test *t)
663 goto err; 663 goto err;
664 } 664 }
665 read(t->fds[fds_idx].fd, &dummy, 1); 665 read(t->fds[fds_idx].fd, &dummy, 1);
666 t->fds[fds_idx].events = POLLERR|POLLPRI; 666 t->fds[fds_idx].events = EPOLLERR|EPOLLPRI;
667 t->fds[fds_idx].revents = 0; 667 t->fds[fds_idx].revents = 0;
668 fds_idx++; 668 fds_idx++;
669 } 669 }
@@ -756,7 +756,7 @@ static int wait_for_complete(struct loopback_test *t)
756 } 756 }
757 757
758 for (i = 0; i < t->poll_count; i++) { 758 for (i = 0; i < t->poll_count; i++) {
759 if (t->fds[i].revents & POLLPRI) { 759 if (t->fds[i].revents & EPOLLPRI) {
760 /* Dummy read to clear the event */ 760 /* Dummy read to clear the event */
761 read(t->fds[i].fd, &dummy, 1); 761 read(t->fds[i].fd, &dummy, 1);
762 number_of_events++; 762 number_of_events++;
diff --git a/drivers/staging/irda/net/af_irda.c b/drivers/staging/irda/net/af_irda.c
index f1d128b2dae9..2f1e9ab3d6d0 100644
--- a/drivers/staging/irda/net/af_irda.c
+++ b/drivers/staging/irda/net/af_irda.c
@@ -1749,16 +1749,16 @@ static __poll_t irda_poll(struct file * file, struct socket *sock,
1749 1749
1750 /* Exceptional events? */ 1750 /* Exceptional events? */
1751 if (sk->sk_err) 1751 if (sk->sk_err)
1752 mask |= POLLERR; 1752 mask |= EPOLLERR;
1753 if (sk->sk_shutdown & RCV_SHUTDOWN) { 1753 if (sk->sk_shutdown & RCV_SHUTDOWN) {
1754 pr_debug("%s(), POLLHUP\n", __func__); 1754 pr_debug("%s(), POLLHUP\n", __func__);
1755 mask |= POLLHUP; 1755 mask |= EPOLLHUP;
1756 } 1756 }
1757 1757
1758 /* Readable? */ 1758 /* Readable? */
1759 if (!skb_queue_empty(&sk->sk_receive_queue)) { 1759 if (!skb_queue_empty(&sk->sk_receive_queue)) {
1760 pr_debug("Socket is readable\n"); 1760 pr_debug("Socket is readable\n");
1761 mask |= POLLIN | POLLRDNORM; 1761 mask |= EPOLLIN | EPOLLRDNORM;
1762 } 1762 }
1763 1763
1764 /* Connection-based need to check for termination and startup */ 1764 /* Connection-based need to check for termination and startup */
@@ -1766,14 +1766,14 @@ static __poll_t irda_poll(struct file * file, struct socket *sock,
1766 case SOCK_STREAM: 1766 case SOCK_STREAM:
1767 if (sk->sk_state == TCP_CLOSE) { 1767 if (sk->sk_state == TCP_CLOSE) {
1768 pr_debug("%s(), POLLHUP\n", __func__); 1768 pr_debug("%s(), POLLHUP\n", __func__);
1769 mask |= POLLHUP; 1769 mask |= EPOLLHUP;
1770 } 1770 }
1771 1771
1772 if (sk->sk_state == TCP_ESTABLISHED) { 1772 if (sk->sk_state == TCP_ESTABLISHED) {
1773 if ((self->tx_flow == FLOW_START) && 1773 if ((self->tx_flow == FLOW_START) &&
1774 sock_writeable(sk)) 1774 sock_writeable(sk))
1775 { 1775 {
1776 mask |= POLLOUT | POLLWRNORM | POLLWRBAND; 1776 mask |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
1777 } 1777 }
1778 } 1778 }
1779 break; 1779 break;
@@ -1781,12 +1781,12 @@ static __poll_t irda_poll(struct file * file, struct socket *sock,
1781 if ((self->tx_flow == FLOW_START) && 1781 if ((self->tx_flow == FLOW_START) &&
1782 sock_writeable(sk)) 1782 sock_writeable(sk))
1783 { 1783 {
1784 mask |= POLLOUT | POLLWRNORM | POLLWRBAND; 1784 mask |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
1785 } 1785 }
1786 break; 1786 break;
1787 case SOCK_DGRAM: 1787 case SOCK_DGRAM:
1788 if (sock_writeable(sk)) 1788 if (sock_writeable(sk))
1789 mask |= POLLOUT | POLLWRNORM | POLLWRBAND; 1789 mask |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
1790 break; 1790 break;
1791 default: 1791 default:
1792 break; 1792 break;
diff --git a/drivers/staging/irda/net/irnet/irnet_ppp.c b/drivers/staging/irda/net/irnet/irnet_ppp.c
index 75bf9e34311d..c90a158af4b7 100644
--- a/drivers/staging/irda/net/irnet/irnet_ppp.c
+++ b/drivers/staging/irda/net/irnet/irnet_ppp.c
@@ -429,10 +429,10 @@ irnet_ctrl_poll(irnet_socket * ap,
429 DENTER(CTRL_TRACE, "(ap=0x%p)\n", ap); 429 DENTER(CTRL_TRACE, "(ap=0x%p)\n", ap);
430 430
431 poll_wait(file, &irnet_events.rwait, wait); 431 poll_wait(file, &irnet_events.rwait, wait);
432 mask = POLLOUT | POLLWRNORM; 432 mask = EPOLLOUT | EPOLLWRNORM;
433 /* If there is unread events */ 433 /* If there is unread events */
434 if(ap->event_index != irnet_events.index) 434 if(ap->event_index != irnet_events.index)
435 mask |= POLLIN | POLLRDNORM; 435 mask |= EPOLLIN | EPOLLRDNORM;
436#ifdef INITIAL_DISCOVERY 436#ifdef INITIAL_DISCOVERY
437 if(ap->disco_number != -1) 437 if(ap->disco_number != -1)
438 { 438 {
@@ -441,7 +441,7 @@ irnet_ctrl_poll(irnet_socket * ap,
441 irnet_get_discovery_log(ap); 441 irnet_get_discovery_log(ap);
442 /* Recheck */ 442 /* Recheck */
443 if(ap->disco_number != -1) 443 if(ap->disco_number != -1)
444 mask |= POLLIN | POLLRDNORM; 444 mask |= EPOLLIN | EPOLLRDNORM;
445 } 445 }
446#endif /* INITIAL_DISCOVERY */ 446#endif /* INITIAL_DISCOVERY */
447 447
@@ -618,7 +618,7 @@ dev_irnet_poll(struct file * file,
618 DENTER(FS_TRACE, "(file=0x%p, ap=0x%p)\n", 618 DENTER(FS_TRACE, "(file=0x%p, ap=0x%p)\n",
619 file, ap); 619 file, ap);
620 620
621 mask = POLLOUT | POLLWRNORM; 621 mask = EPOLLOUT | EPOLLWRNORM;
622 DABORT(ap == NULL, mask, FS_ERROR, "ap is NULL !!!\n"); 622 DABORT(ap == NULL, mask, FS_ERROR, "ap is NULL !!!\n");
623 623
624 /* If we are connected to ppp_generic, let it handle the job */ 624 /* If we are connected to ppp_generic, let it handle the job */
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c
index 6657ebbe068a..4f9f9dca5e6a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_fops.c
@@ -1265,7 +1265,7 @@ static __poll_t atomisp_poll(struct file *file,
1265 rt_mutex_lock(&isp->mutex); 1265 rt_mutex_lock(&isp->mutex);
1266 if (pipe->capq.streaming != 1) { 1266 if (pipe->capq.streaming != 1) {
1267 rt_mutex_unlock(&isp->mutex); 1267 rt_mutex_unlock(&isp->mutex);
1268 return POLLERR; 1268 return EPOLLERR;
1269 } 1269 }
1270 rt_mutex_unlock(&isp->mutex); 1270 rt_mutex_unlock(&isp->mutex);
1271 1271
diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c
index 4ffff6f8b809..06d1920150da 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -2183,7 +2183,7 @@ static __poll_t bcm2048_fops_poll(struct file *file,
2183 poll_wait(file, &bdev->read_queue, pts); 2183 poll_wait(file, &bdev->read_queue, pts);
2184 2184
2185 if (bdev->rds_data_available) 2185 if (bdev->rds_data_available)
2186 retval = POLLIN | POLLRDNORM; 2186 retval = EPOLLIN | EPOLLRDNORM;
2187 2187
2188 return retval; 2188 return retval;
2189} 2189}
diff --git a/drivers/staging/most/cdev/cdev.c b/drivers/staging/most/cdev/cdev.c
index c183489c4a1c..4d7fce8731fe 100644
--- a/drivers/staging/most/cdev/cdev.c
+++ b/drivers/staging/most/cdev/cdev.c
@@ -292,10 +292,10 @@ static __poll_t comp_poll(struct file *filp, poll_table *wait)
292 292
293 if (c->cfg->direction == MOST_CH_RX) { 293 if (c->cfg->direction == MOST_CH_RX) {
294 if (!kfifo_is_empty(&c->fifo)) 294 if (!kfifo_is_empty(&c->fifo))
295 mask |= POLLIN | POLLRDNORM; 295 mask |= EPOLLIN | EPOLLRDNORM;
296 } else { 296 } else {
297 if (!kfifo_is_empty(&c->fifo) || ch_has_mbo(c)) 297 if (!kfifo_is_empty(&c->fifo) || ch_has_mbo(c))
298 mask |= POLLOUT | POLLWRNORM; 298 mask |= EPOLLOUT | EPOLLWRNORM;
299 } 299 }
300 return mask; 300 return mask;
301} 301}
diff --git a/drivers/staging/most/video/video.c b/drivers/staging/most/video/video.c
index ef23e8524b1e..9d7e747519d9 100644
--- a/drivers/staging/most/video/video.c
+++ b/drivers/staging/most/video/video.c
@@ -213,7 +213,7 @@ static __poll_t comp_vdev_poll(struct file *filp, poll_table *wait)
213 if (!data_ready(mdev)) 213 if (!data_ready(mdev))
214 poll_wait(filp, &mdev->wait_data, wait); 214 poll_wait(filp, &mdev->wait_data, wait);
215 if (data_ready(mdev)) 215 if (data_ready(mdev))
216 mask |= POLLIN | POLLRDNORM; 216 mask |= EPOLLIN | EPOLLRDNORM;
217 217
218 return mask; 218 return mask;
219} 219}
diff --git a/drivers/staging/speakup/speakup_soft.c b/drivers/staging/speakup/speakup_soft.c
index 0e74d09e18ea..0a1a7c259ab0 100644
--- a/drivers/staging/speakup/speakup_soft.c
+++ b/drivers/staging/speakup/speakup_soft.c
@@ -325,7 +325,7 @@ static __poll_t softsynth_poll(struct file *fp, struct poll_table_struct *wait)
325 325
326 spin_lock_irqsave(&speakup_info.spinlock, flags); 326 spin_lock_irqsave(&speakup_info.spinlock, flags);
327 if (!synth_buffer_empty() || speakup_info.flushing) 327 if (!synth_buffer_empty() || speakup_info.flushing)
328 ret = POLLIN | POLLRDNORM; 328 ret = EPOLLIN | EPOLLRDNORM;
329 spin_unlock_irqrestore(&speakup_info.spinlock, flags); 329 spin_unlock_irqrestore(&speakup_info.spinlock, flags);
330 return ret; 330 return ret;
331} 331}
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 3b3af7e0ce1c..3b3e1f6632d7 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -2477,11 +2477,11 @@ static __poll_t gsmld_poll(struct tty_struct *tty, struct file *file,
2477 poll_wait(file, &tty->read_wait, wait); 2477 poll_wait(file, &tty->read_wait, wait);
2478 poll_wait(file, &tty->write_wait, wait); 2478 poll_wait(file, &tty->write_wait, wait);
2479 if (tty_hung_up_p(file)) 2479 if (tty_hung_up_p(file))
2480 mask |= POLLHUP; 2480 mask |= EPOLLHUP;
2481 if (!tty_is_writelocked(tty) && tty_write_room(tty) > 0) 2481 if (!tty_is_writelocked(tty) && tty_write_room(tty) > 0)
2482 mask |= POLLOUT | POLLWRNORM; 2482 mask |= EPOLLOUT | EPOLLWRNORM;
2483 if (gsm->dead) 2483 if (gsm->dead)
2484 mask |= POLLHUP; 2484 mask |= EPOLLHUP;
2485 return mask; 2485 return mask;
2486} 2486}
2487 2487
diff --git a/drivers/tty/n_hdlc.c b/drivers/tty/n_hdlc.c
index 929434ebee50..dabb391909aa 100644
--- a/drivers/tty/n_hdlc.c
+++ b/drivers/tty/n_hdlc.c
@@ -814,14 +814,14 @@ static __poll_t n_hdlc_tty_poll(struct tty_struct *tty, struct file *filp,
814 814
815 /* set bits for operations that won't block */ 815 /* set bits for operations that won't block */
816 if (!list_empty(&n_hdlc->rx_buf_list.list)) 816 if (!list_empty(&n_hdlc->rx_buf_list.list))
817 mask |= POLLIN | POLLRDNORM; /* readable */ 817 mask |= EPOLLIN | EPOLLRDNORM; /* readable */
818 if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) 818 if (test_bit(TTY_OTHER_CLOSED, &tty->flags))
819 mask |= POLLHUP; 819 mask |= EPOLLHUP;
820 if (tty_hung_up_p(filp)) 820 if (tty_hung_up_p(filp))
821 mask |= POLLHUP; 821 mask |= EPOLLHUP;
822 if (!tty_is_writelocked(tty) && 822 if (!tty_is_writelocked(tty) &&
823 !list_empty(&n_hdlc->tx_free_buf_list.list)) 823 !list_empty(&n_hdlc->tx_free_buf_list.list))
824 mask |= POLLOUT | POLLWRNORM; /* writable */ 824 mask |= EPOLLOUT | EPOLLWRNORM; /* writable */
825 } 825 }
826 return mask; 826 return mask;
827} /* end of n_hdlc_tty_poll() */ 827} /* end of n_hdlc_tty_poll() */
diff --git a/drivers/tty/n_r3964.c b/drivers/tty/n_r3964.c
index e81d3db8ad63..dbf1ab36758e 100644
--- a/drivers/tty/n_r3964.c
+++ b/drivers/tty/n_r3964.c
@@ -1223,7 +1223,7 @@ static __poll_t r3964_poll(struct tty_struct *tty, struct file *file,
1223 struct r3964_client_info *pClient; 1223 struct r3964_client_info *pClient;
1224 struct r3964_message *pMsg = NULL; 1224 struct r3964_message *pMsg = NULL;
1225 unsigned long flags; 1225 unsigned long flags;
1226 __poll_t result = POLLOUT; 1226 __poll_t result = EPOLLOUT;
1227 1227
1228 TRACE_L("POLL"); 1228 TRACE_L("POLL");
1229 1229
@@ -1234,7 +1234,7 @@ static __poll_t r3964_poll(struct tty_struct *tty, struct file *file,
1234 pMsg = pClient->first_msg; 1234 pMsg = pClient->first_msg;
1235 spin_unlock_irqrestore(&pInfo->lock, flags); 1235 spin_unlock_irqrestore(&pInfo->lock, flags);
1236 if (pMsg) 1236 if (pMsg)
1237 result |= POLLIN | POLLRDNORM; 1237 result |= EPOLLIN | EPOLLRDNORM;
1238 } else { 1238 } else {
1239 result = -EINVAL; 1239 result = -EINVAL;
1240 } 1240 }
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 478a9b40fd03..5c0e59e8fe46 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -1344,7 +1344,7 @@ handle_newline:
1344 put_tty_queue(c, ldata); 1344 put_tty_queue(c, ldata);
1345 smp_store_release(&ldata->canon_head, ldata->read_head); 1345 smp_store_release(&ldata->canon_head, ldata->read_head);
1346 kill_fasync(&tty->fasync, SIGIO, POLL_IN); 1346 kill_fasync(&tty->fasync, SIGIO, POLL_IN);
1347 wake_up_interruptible_poll(&tty->read_wait, POLLIN); 1347 wake_up_interruptible_poll(&tty->read_wait, EPOLLIN);
1348 return 0; 1348 return 0;
1349 } 1349 }
1350 } 1350 }
@@ -1625,7 +1625,7 @@ static void __receive_buf(struct tty_struct *tty, const unsigned char *cp,
1625 1625
1626 if (read_cnt(ldata)) { 1626 if (read_cnt(ldata)) {
1627 kill_fasync(&tty->fasync, SIGIO, POLL_IN); 1627 kill_fasync(&tty->fasync, SIGIO, POLL_IN);
1628 wake_up_interruptible_poll(&tty->read_wait, POLLIN); 1628 wake_up_interruptible_poll(&tty->read_wait, EPOLLIN);
1629 } 1629 }
1630} 1630}
1631 1631
@@ -2376,22 +2376,22 @@ static __poll_t n_tty_poll(struct tty_struct *tty, struct file *file,
2376 poll_wait(file, &tty->read_wait, wait); 2376 poll_wait(file, &tty->read_wait, wait);
2377 poll_wait(file, &tty->write_wait, wait); 2377 poll_wait(file, &tty->write_wait, wait);
2378 if (input_available_p(tty, 1)) 2378 if (input_available_p(tty, 1))
2379 mask |= POLLIN | POLLRDNORM; 2379 mask |= EPOLLIN | EPOLLRDNORM;
2380 else { 2380 else {
2381 tty_buffer_flush_work(tty->port); 2381 tty_buffer_flush_work(tty->port);
2382 if (input_available_p(tty, 1)) 2382 if (input_available_p(tty, 1))
2383 mask |= POLLIN | POLLRDNORM; 2383 mask |= EPOLLIN | EPOLLRDNORM;
2384 } 2384 }
2385 if (tty->packet && tty->link->ctrl_status) 2385 if (tty->packet && tty->link->ctrl_status)
2386 mask |= POLLPRI | POLLIN | POLLRDNORM; 2386 mask |= EPOLLPRI | EPOLLIN | EPOLLRDNORM;
2387 if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) 2387 if (test_bit(TTY_OTHER_CLOSED, &tty->flags))
2388 mask |= POLLHUP; 2388 mask |= EPOLLHUP;
2389 if (tty_hung_up_p(file)) 2389 if (tty_hung_up_p(file))
2390 mask |= POLLHUP; 2390 mask |= EPOLLHUP;
2391 if (tty->ops->write && !tty_is_writelocked(tty) && 2391 if (tty->ops->write && !tty_is_writelocked(tty) &&
2392 tty_chars_in_buffer(tty) < WAKEUP_CHARS && 2392 tty_chars_in_buffer(tty) < WAKEUP_CHARS &&
2393 tty_write_room(tty) > 0) 2393 tty_write_room(tty) > 0)
2394 mask |= POLLOUT | POLLWRNORM; 2394 mask |= EPOLLOUT | EPOLLWRNORM;
2395 return mask; 2395 return mask;
2396} 2396}
2397 2397
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 64338442050e..6c7151edd715 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -344,7 +344,7 @@ static void pty_start(struct tty_struct *tty)
344 tty->ctrl_status &= ~TIOCPKT_STOP; 344 tty->ctrl_status &= ~TIOCPKT_STOP;
345 tty->ctrl_status |= TIOCPKT_START; 345 tty->ctrl_status |= TIOCPKT_START;
346 spin_unlock_irqrestore(&tty->ctrl_lock, flags); 346 spin_unlock_irqrestore(&tty->ctrl_lock, flags);
347 wake_up_interruptible_poll(&tty->link->read_wait, POLLIN); 347 wake_up_interruptible_poll(&tty->link->read_wait, EPOLLIN);
348 } 348 }
349} 349}
350 350
@@ -357,7 +357,7 @@ static void pty_stop(struct tty_struct *tty)
357 tty->ctrl_status &= ~TIOCPKT_START; 357 tty->ctrl_status &= ~TIOCPKT_START;
358 tty->ctrl_status |= TIOCPKT_STOP; 358 tty->ctrl_status |= TIOCPKT_STOP;
359 spin_unlock_irqrestore(&tty->ctrl_lock, flags); 359 spin_unlock_irqrestore(&tty->ctrl_lock, flags);
360 wake_up_interruptible_poll(&tty->link->read_wait, POLLIN); 360 wake_up_interruptible_poll(&tty->link->read_wait, EPOLLIN);
361 } 361 }
362} 362}
363 363
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 6a89835453d3..eb9133b472f4 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -445,7 +445,7 @@ static ssize_t hung_up_tty_write(struct file *file, const char __user *buf,
445/* No kernel lock held - none needed ;) */ 445/* No kernel lock held - none needed ;) */
446static __poll_t hung_up_tty_poll(struct file *filp, poll_table *wait) 446static __poll_t hung_up_tty_poll(struct file *filp, poll_table *wait)
447{ 447{
448 return POLLIN | POLLOUT | POLLERR | POLLHUP | POLLRDNORM | POLLWRNORM; 448 return EPOLLIN | EPOLLOUT | EPOLLERR | EPOLLHUP | EPOLLRDNORM | EPOLLWRNORM;
449} 449}
450 450
451static long hung_up_tty_ioctl(struct file *file, unsigned int cmd, 451static long hung_up_tty_ioctl(struct file *file, unsigned int cmd,
@@ -533,7 +533,7 @@ void tty_wakeup(struct tty_struct *tty)
533 tty_ldisc_deref(ld); 533 tty_ldisc_deref(ld);
534 } 534 }
535 } 535 }
536 wake_up_interruptible_poll(&tty->write_wait, POLLOUT); 536 wake_up_interruptible_poll(&tty->write_wait, EPOLLOUT);
537} 537}
538 538
539EXPORT_SYMBOL_GPL(tty_wakeup); 539EXPORT_SYMBOL_GPL(tty_wakeup);
@@ -867,7 +867,7 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count,
867static void tty_write_unlock(struct tty_struct *tty) 867static void tty_write_unlock(struct tty_struct *tty)
868{ 868{
869 mutex_unlock(&tty->atomic_write_lock); 869 mutex_unlock(&tty->atomic_write_lock);
870 wake_up_interruptible_poll(&tty->write_wait, POLLOUT); 870 wake_up_interruptible_poll(&tty->write_wait, EPOLLOUT);
871} 871}
872 872
873static int tty_write_lock(struct tty_struct *tty, int ndelay) 873static int tty_write_lock(struct tty_struct *tty, int ndelay)
@@ -1667,21 +1667,21 @@ int tty_release(struct inode *inode, struct file *filp)
1667 1667
1668 if (tty->count <= 1) { 1668 if (tty->count <= 1) {
1669 if (waitqueue_active(&tty->read_wait)) { 1669 if (waitqueue_active(&tty->read_wait)) {
1670 wake_up_poll(&tty->read_wait, POLLIN); 1670 wake_up_poll(&tty->read_wait, EPOLLIN);
1671 do_sleep++; 1671 do_sleep++;
1672 } 1672 }
1673 if (waitqueue_active(&tty->write_wait)) { 1673 if (waitqueue_active(&tty->write_wait)) {
1674 wake_up_poll(&tty->write_wait, POLLOUT); 1674 wake_up_poll(&tty->write_wait, EPOLLOUT);
1675 do_sleep++; 1675 do_sleep++;
1676 } 1676 }
1677 } 1677 }
1678 if (o_tty && o_tty->count <= 1) { 1678 if (o_tty && o_tty->count <= 1) {
1679 if (waitqueue_active(&o_tty->read_wait)) { 1679 if (waitqueue_active(&o_tty->read_wait)) {
1680 wake_up_poll(&o_tty->read_wait, POLLIN); 1680 wake_up_poll(&o_tty->read_wait, EPOLLIN);
1681 do_sleep++; 1681 do_sleep++;
1682 } 1682 }
1683 if (waitqueue_active(&o_tty->write_wait)) { 1683 if (waitqueue_active(&o_tty->write_wait)) {
1684 wake_up_poll(&o_tty->write_wait, POLLOUT); 1684 wake_up_poll(&o_tty->write_wait, EPOLLOUT);
1685 do_sleep++; 1685 do_sleep++;
1686 } 1686 }
1687 } 1687 }
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
index 4e7946c0484b..050f4d650891 100644
--- a/drivers/tty/tty_ldisc.c
+++ b/drivers/tty/tty_ldisc.c
@@ -735,8 +735,8 @@ void tty_ldisc_hangup(struct tty_struct *tty, bool reinit)
735 tty_ldisc_deref(ld); 735 tty_ldisc_deref(ld);
736 } 736 }
737 737
738 wake_up_interruptible_poll(&tty->write_wait, POLLOUT); 738 wake_up_interruptible_poll(&tty->write_wait, EPOLLOUT);
739 wake_up_interruptible_poll(&tty->read_wait, POLLIN); 739 wake_up_interruptible_poll(&tty->read_wait, EPOLLIN);
740 740
741 /* 741 /*
742 * Shutdown the current line discipline, and reset it to 742 * Shutdown the current line discipline, and reset it to
diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c
index 3e64ccd0040f..e4a66e1fd05f 100644
--- a/drivers/tty/vt/vc_screen.c
+++ b/drivers/tty/vt/vc_screen.c
@@ -563,7 +563,7 @@ static __poll_t
563vcs_poll(struct file *file, poll_table *wait) 563vcs_poll(struct file *file, poll_table *wait)
564{ 564{
565 struct vcs_poll_data *poll = vcs_poll_data_get(file); 565 struct vcs_poll_data *poll = vcs_poll_data_get(file);
566 __poll_t ret = DEFAULT_POLLMASK|POLLERR|POLLPRI; 566 __poll_t ret = DEFAULT_POLLMASK|EPOLLERR|EPOLLPRI;
567 567
568 if (poll) { 568 if (poll) {
569 poll_wait(file, &poll->waitq, wait); 569 poll_wait(file, &poll->waitq, wait);
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index 85bc1aaea4a4..fd4848392e0d 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -506,7 +506,7 @@ static __poll_t uio_poll(struct file *filep, poll_table *wait)
506 506
507 poll_wait(filep, &idev->wait, wait); 507 poll_wait(filep, &idev->wait, wait);
508 if (listener->event_count != atomic_read(&idev->event)) 508 if (listener->event_count != atomic_read(&idev->event))
509 return POLLIN | POLLRDNORM; 509 return EPOLLIN | EPOLLRDNORM;
510 return 0; 510 return 0;
511} 511}
512 512
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 9627ea6ec3ae..a0d284ef3f40 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -603,16 +603,16 @@ static __poll_t wdm_poll(struct file *file, struct poll_table_struct *wait)
603 603
604 spin_lock_irqsave(&desc->iuspin, flags); 604 spin_lock_irqsave(&desc->iuspin, flags);
605 if (test_bit(WDM_DISCONNECTING, &desc->flags)) { 605 if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
606 mask = POLLHUP | POLLERR; 606 mask = EPOLLHUP | EPOLLERR;
607 spin_unlock_irqrestore(&desc->iuspin, flags); 607 spin_unlock_irqrestore(&desc->iuspin, flags);
608 goto desc_out; 608 goto desc_out;
609 } 609 }
610 if (test_bit(WDM_READ, &desc->flags)) 610 if (test_bit(WDM_READ, &desc->flags))
611 mask = POLLIN | POLLRDNORM; 611 mask = EPOLLIN | EPOLLRDNORM;
612 if (desc->rerr || desc->werr) 612 if (desc->rerr || desc->werr)
613 mask |= POLLERR; 613 mask |= EPOLLERR;
614 if (!test_bit(WDM_IN_USE, &desc->flags)) 614 if (!test_bit(WDM_IN_USE, &desc->flags))
615 mask |= POLLOUT | POLLWRNORM; 615 mask |= EPOLLOUT | EPOLLWRNORM;
616 spin_unlock_irqrestore(&desc->iuspin, flags); 616 spin_unlock_irqrestore(&desc->iuspin, flags);
617 617
618 poll_wait(file, &desc->wait, wait); 618 poll_wait(file, &desc->wait, wait);
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 425247b7f728..d058d7a31e7c 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -479,8 +479,8 @@ static __poll_t usblp_poll(struct file *file, struct poll_table_struct *wait)
479 poll_wait(file, &usblp->rwait, wait); 479 poll_wait(file, &usblp->rwait, wait);
480 poll_wait(file, &usblp->wwait, wait); 480 poll_wait(file, &usblp->wwait, wait);
481 spin_lock_irqsave(&usblp->lock, flags); 481 spin_lock_irqsave(&usblp->lock, flags);
482 ret = ((usblp->bidir && usblp->rcomplete) ? POLLIN | POLLRDNORM : 0) | 482 ret = ((usblp->bidir && usblp->rcomplete) ? EPOLLIN | EPOLLRDNORM : 0) |
483 ((usblp->no_paper || usblp->wcomplete) ? POLLOUT | POLLWRNORM : 0); 483 ((usblp->no_paper || usblp->wcomplete) ? EPOLLOUT | EPOLLWRNORM : 0);
484 spin_unlock_irqrestore(&usblp->lock, flags); 484 spin_unlock_irqrestore(&usblp->lock, flags);
485 return ret; 485 return ret;
486} 486}
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c
index 7ea67a55be10..bdb1de0c0cef 100644
--- a/drivers/usb/class/usbtmc.c
+++ b/drivers/usb/class/usbtmc.c
@@ -1265,13 +1265,13 @@ static __poll_t usbtmc_poll(struct file *file, poll_table *wait)
1265 mutex_lock(&data->io_mutex); 1265 mutex_lock(&data->io_mutex);
1266 1266
1267 if (data->zombie) { 1267 if (data->zombie) {
1268 mask = POLLHUP | POLLERR; 1268 mask = EPOLLHUP | EPOLLERR;
1269 goto no_poll; 1269 goto no_poll;
1270 } 1270 }
1271 1271
1272 poll_wait(file, &data->waitq, wait); 1272 poll_wait(file, &data->waitq, wait);
1273 1273
1274 mask = (atomic_read(&data->srq_asserted)) ? POLLIN | POLLRDNORM : 0; 1274 mask = (atomic_read(&data->srq_asserted)) ? EPOLLIN | EPOLLRDNORM : 0;
1275 1275
1276no_poll: 1276no_poll:
1277 mutex_unlock(&data->io_mutex); 1277 mutex_unlock(&data->io_mutex);
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c
index e2cec448779e..3de3c750b5f6 100644
--- a/drivers/usb/core/devices.c
+++ b/drivers/usb/core/devices.c
@@ -632,7 +632,7 @@ static __poll_t usb_device_poll(struct file *file,
632 event_count = atomic_read(&device_event.count); 632 event_count = atomic_read(&device_event.count);
633 if (file->f_version != event_count) { 633 if (file->f_version != event_count) {
634 file->f_version = event_count; 634 file->f_version = event_count;
635 return POLLIN | POLLRDNORM; 635 return EPOLLIN | EPOLLRDNORM;
636 } 636 }
637 637
638 return 0; 638 return 0;
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index bf00166cbee0..d526595bc959 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -2578,11 +2578,11 @@ static __poll_t usbdev_poll(struct file *file,
2578 2578
2579 poll_wait(file, &ps->wait, wait); 2579 poll_wait(file, &ps->wait, wait);
2580 if (file->f_mode & FMODE_WRITE && !list_empty(&ps->async_completed)) 2580 if (file->f_mode & FMODE_WRITE && !list_empty(&ps->async_completed))
2581 mask |= POLLOUT | POLLWRNORM; 2581 mask |= EPOLLOUT | EPOLLWRNORM;
2582 if (!connected(ps)) 2582 if (!connected(ps))
2583 mask |= POLLHUP; 2583 mask |= EPOLLHUP;
2584 if (list_empty(&ps->list)) 2584 if (list_empty(&ps->list))
2585 mask |= POLLERR; 2585 mask |= EPOLLERR;
2586 return mask; 2586 return mask;
2587} 2587}
2588 2588
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c
index 67564725e371..8f2cf3baa19c 100644
--- a/drivers/usb/gadget/function/f_fs.c
+++ b/drivers/usb/gadget/function/f_fs.c
@@ -644,7 +644,7 @@ static long ffs_ep0_ioctl(struct file *file, unsigned code, unsigned long value)
644static __poll_t ffs_ep0_poll(struct file *file, poll_table *wait) 644static __poll_t ffs_ep0_poll(struct file *file, poll_table *wait)
645{ 645{
646 struct ffs_data *ffs = file->private_data; 646 struct ffs_data *ffs = file->private_data;
647 __poll_t mask = POLLWRNORM; 647 __poll_t mask = EPOLLWRNORM;
648 int ret; 648 int ret;
649 649
650 poll_wait(file, &ffs->ev.waitq, wait); 650 poll_wait(file, &ffs->ev.waitq, wait);
@@ -656,19 +656,19 @@ static __poll_t ffs_ep0_poll(struct file *file, poll_table *wait)
656 switch (ffs->state) { 656 switch (ffs->state) {
657 case FFS_READ_DESCRIPTORS: 657 case FFS_READ_DESCRIPTORS:
658 case FFS_READ_STRINGS: 658 case FFS_READ_STRINGS:
659 mask |= POLLOUT; 659 mask |= EPOLLOUT;
660 break; 660 break;
661 661
662 case FFS_ACTIVE: 662 case FFS_ACTIVE:
663 switch (ffs->setup_state) { 663 switch (ffs->setup_state) {
664 case FFS_NO_SETUP: 664 case FFS_NO_SETUP:
665 if (ffs->ev.count) 665 if (ffs->ev.count)
666 mask |= POLLIN; 666 mask |= EPOLLIN;
667 break; 667 break;
668 668
669 case FFS_SETUP_PENDING: 669 case FFS_SETUP_PENDING:
670 case FFS_SETUP_CANCELLED: 670 case FFS_SETUP_CANCELLED:
671 mask |= (POLLIN | POLLOUT); 671 mask |= (EPOLLIN | EPOLLOUT);
672 break; 672 break;
673 } 673 }
674 case FFS_CLOSING: 674 case FFS_CLOSING:
diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c
index a73efb1c47d0..54e859dcb25c 100644
--- a/drivers/usb/gadget/function/f_hid.c
+++ b/drivers/usb/gadget/function/f_hid.c
@@ -422,10 +422,10 @@ static __poll_t f_hidg_poll(struct file *file, poll_table *wait)
422 poll_wait(file, &hidg->write_queue, wait); 422 poll_wait(file, &hidg->write_queue, wait);
423 423
424 if (WRITE_COND) 424 if (WRITE_COND)
425 ret |= POLLOUT | POLLWRNORM; 425 ret |= EPOLLOUT | EPOLLWRNORM;
426 426
427 if (READ_COND) 427 if (READ_COND)
428 ret |= POLLIN | POLLRDNORM; 428 ret |= EPOLLIN | EPOLLRDNORM;
429 429
430 return ret; 430 return ret;
431} 431}
diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c
index 453578c4af69..d359efe06c76 100644
--- a/drivers/usb/gadget/function/f_printer.c
+++ b/drivers/usb/gadget/function/f_printer.c
@@ -698,11 +698,11 @@ printer_poll(struct file *fd, poll_table *wait)
698 698
699 spin_lock_irqsave(&dev->lock, flags); 699 spin_lock_irqsave(&dev->lock, flags);
700 if (likely(!list_empty(&dev->tx_reqs))) 700 if (likely(!list_empty(&dev->tx_reqs)))
701 status |= POLLOUT | POLLWRNORM; 701 status |= EPOLLOUT | EPOLLWRNORM;
702 702
703 if (likely(dev->current_rx_bytes) || 703 if (likely(dev->current_rx_bytes) ||
704 likely(!list_empty(&dev->rx_buffers))) 704 likely(!list_empty(&dev->rx_buffers)))
705 status |= POLLIN | POLLRDNORM; 705 status |= EPOLLIN | EPOLLRDNORM;
706 706
707 spin_unlock_irqrestore(&dev->lock, flags); 707 spin_unlock_irqrestore(&dev->lock, flags);
708 708
diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
index 5960e76f4c75..37ca0e669bd8 100644
--- a/drivers/usb/gadget/legacy/inode.c
+++ b/drivers/usb/gadget/legacy/inode.c
@@ -1225,16 +1225,16 @@ ep0_poll (struct file *fd, poll_table *wait)
1225 /* report fd mode change before acting on it */ 1225 /* report fd mode change before acting on it */
1226 if (dev->setup_abort) { 1226 if (dev->setup_abort) {
1227 dev->setup_abort = 0; 1227 dev->setup_abort = 0;
1228 mask = POLLHUP; 1228 mask = EPOLLHUP;
1229 goto out; 1229 goto out;
1230 } 1230 }
1231 1231
1232 if (dev->state == STATE_DEV_SETUP) { 1232 if (dev->state == STATE_DEV_SETUP) {
1233 if (dev->setup_in || dev->setup_can_stall) 1233 if (dev->setup_in || dev->setup_can_stall)
1234 mask = POLLOUT; 1234 mask = EPOLLOUT;
1235 } else { 1235 } else {
1236 if (dev->ev_next != 0) 1236 if (dev->ev_next != 0)
1237 mask = POLLIN; 1237 mask = EPOLLIN;
1238 } 1238 }
1239out: 1239out:
1240 spin_unlock_irq(&dev->lock); 1240 spin_unlock_irq(&dev->lock);
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index 1fa00b35f4ad..8d33187ce2af 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -683,19 +683,19 @@ static __poll_t iowarrior_poll(struct file *file, poll_table * wait)
683 __poll_t mask = 0; 683 __poll_t mask = 0;
684 684
685 if (!dev->present) 685 if (!dev->present)
686 return POLLERR | POLLHUP; 686 return EPOLLERR | EPOLLHUP;
687 687
688 poll_wait(file, &dev->read_wait, wait); 688 poll_wait(file, &dev->read_wait, wait);
689 poll_wait(file, &dev->write_wait, wait); 689 poll_wait(file, &dev->write_wait, wait);
690 690
691 if (!dev->present) 691 if (!dev->present)
692 return POLLERR | POLLHUP; 692 return EPOLLERR | EPOLLHUP;
693 693
694 if (read_index(dev) != -1) 694 if (read_index(dev) != -1)
695 mask |= POLLIN | POLLRDNORM; 695 mask |= EPOLLIN | EPOLLRDNORM;
696 696
697 if (atomic_read(&dev->write_busy) < MAX_WRITES_IN_FLIGHT) 697 if (atomic_read(&dev->write_busy) < MAX_WRITES_IN_FLIGHT)
698 mask |= POLLOUT | POLLWRNORM; 698 mask |= EPOLLOUT | EPOLLWRNORM;
699 return mask; 699 return mask;
700} 700}
701 701
diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c
index 074398c1e410..63b9e85dc0e9 100644
--- a/drivers/usb/misc/ldusb.c
+++ b/drivers/usb/misc/ldusb.c
@@ -417,15 +417,15 @@ static __poll_t ld_usb_poll(struct file *file, poll_table *wait)
417 dev = file->private_data; 417 dev = file->private_data;
418 418
419 if (!dev->intf) 419 if (!dev->intf)
420 return POLLERR | POLLHUP; 420 return EPOLLERR | EPOLLHUP;
421 421
422 poll_wait(file, &dev->read_wait, wait); 422 poll_wait(file, &dev->read_wait, wait);
423 poll_wait(file, &dev->write_wait, wait); 423 poll_wait(file, &dev->write_wait, wait);
424 424
425 if (dev->ring_head != dev->ring_tail) 425 if (dev->ring_head != dev->ring_tail)
426 mask |= POLLIN | POLLRDNORM; 426 mask |= EPOLLIN | EPOLLRDNORM;
427 if (!dev->interrupt_out_busy) 427 if (!dev->interrupt_out_busy)
428 mask |= POLLOUT | POLLWRNORM; 428 mask |= EPOLLOUT | EPOLLWRNORM;
429 429
430 return mask; 430 return mask;
431} 431}
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
index 941c45028828..bf47bd8bc76f 100644
--- a/drivers/usb/misc/legousbtower.c
+++ b/drivers/usb/misc/legousbtower.c
@@ -517,17 +517,17 @@ static __poll_t tower_poll (struct file *file, poll_table *wait)
517 dev = file->private_data; 517 dev = file->private_data;
518 518
519 if (!dev->udev) 519 if (!dev->udev)
520 return POLLERR | POLLHUP; 520 return EPOLLERR | EPOLLHUP;
521 521
522 poll_wait(file, &dev->read_wait, wait); 522 poll_wait(file, &dev->read_wait, wait);
523 poll_wait(file, &dev->write_wait, wait); 523 poll_wait(file, &dev->write_wait, wait);
524 524
525 tower_check_for_read_packet(dev); 525 tower_check_for_read_packet(dev);
526 if (dev->read_packet_length > 0) { 526 if (dev->read_packet_length > 0) {
527 mask |= POLLIN | POLLRDNORM; 527 mask |= EPOLLIN | EPOLLRDNORM;
528 } 528 }
529 if (!dev->interrupt_out_busy) { 529 if (!dev->interrupt_out_busy) {
530 mask |= POLLOUT | POLLWRNORM; 530 mask |= EPOLLOUT | EPOLLWRNORM;
531 } 531 }
532 532
533 return mask; 533 return mask;
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
index cc5b296bff3f..2761fad66b95 100644
--- a/drivers/usb/mon/mon_bin.c
+++ b/drivers/usb/mon/mon_bin.c
@@ -1203,7 +1203,7 @@ mon_bin_poll(struct file *file, struct poll_table_struct *wait)
1203 1203
1204 spin_lock_irqsave(&rp->b_lock, flags); 1204 spin_lock_irqsave(&rp->b_lock, flags);
1205 if (!MON_RING_EMPTY(rp)) 1205 if (!MON_RING_EMPTY(rp))
1206 mask |= POLLIN | POLLRDNORM; /* readable */ 1206 mask |= EPOLLIN | EPOLLRDNORM; /* readable */
1207 spin_unlock_irqrestore(&rp->b_lock, flags); 1207 spin_unlock_irqrestore(&rp->b_lock, flags);
1208 return mask; 1208 return mask;
1209} 1209}
diff --git a/drivers/vfio/virqfd.c b/drivers/vfio/virqfd.c
index 8cc4b48ff127..085700f1be10 100644
--- a/drivers/vfio/virqfd.c
+++ b/drivers/vfio/virqfd.c
@@ -48,7 +48,7 @@ static int virqfd_wakeup(wait_queue_entry_t *wait, unsigned mode, int sync, void
48 struct virqfd *virqfd = container_of(wait, struct virqfd, wait); 48 struct virqfd *virqfd = container_of(wait, struct virqfd, wait);
49 __poll_t flags = key_to_poll(key); 49 __poll_t flags = key_to_poll(key);
50 50
51 if (flags & POLLIN) { 51 if (flags & EPOLLIN) {
52 /* An event has been signaled, call function */ 52 /* An event has been signaled, call function */
53 if ((!virqfd->handler || 53 if ((!virqfd->handler ||
54 virqfd->handler(virqfd->opaque, virqfd->data)) && 54 virqfd->handler(virqfd->opaque, virqfd->data)) &&
@@ -56,7 +56,7 @@ static int virqfd_wakeup(wait_queue_entry_t *wait, unsigned mode, int sync, void
56 schedule_work(&virqfd->inject); 56 schedule_work(&virqfd->inject);
57 } 57 }
58 58
59 if (flags & POLLHUP) { 59 if (flags & EPOLLHUP) {
60 unsigned long flags; 60 unsigned long flags;
61 spin_lock_irqsave(&virqfd_lock, flags); 61 spin_lock_irqsave(&virqfd_lock, flags);
62 62
@@ -172,14 +172,14 @@ int vfio_virqfd_enable(void *opaque,
172 * Check if there was an event already pending on the eventfd 172 * Check if there was an event already pending on the eventfd
173 * before we registered and trigger it as if we didn't miss it. 173 * before we registered and trigger it as if we didn't miss it.
174 */ 174 */
175 if (events & POLLIN) { 175 if (events & EPOLLIN) {
176 if ((!handler || handler(opaque, data)) && thread) 176 if ((!handler || handler(opaque, data)) && thread)
177 schedule_work(&virqfd->inject); 177 schedule_work(&virqfd->inject);
178 } 178 }
179 179
180 /* 180 /*
181 * Do not drop the file until the irqfd is fully initialized, 181 * Do not drop the file until the irqfd is fully initialized,
182 * otherwise we might race against the POLLHUP. 182 * otherwise we might race against the EPOLLHUP.
183 */ 183 */
184 fdput(irqfd); 184 fdput(irqfd);
185 185
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index c613d2e3d371..610cba276d47 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -952,8 +952,8 @@ static int vhost_net_open(struct inode *inode, struct file *f)
952 } 952 }
953 vhost_dev_init(dev, vqs, VHOST_NET_VQ_MAX); 953 vhost_dev_init(dev, vqs, VHOST_NET_VQ_MAX);
954 954
955 vhost_poll_init(n->poll + VHOST_NET_VQ_TX, handle_tx_net, POLLOUT, dev); 955 vhost_poll_init(n->poll + VHOST_NET_VQ_TX, handle_tx_net, EPOLLOUT, dev);
956 vhost_poll_init(n->poll + VHOST_NET_VQ_RX, handle_rx_net, POLLIN, dev); 956 vhost_poll_init(n->poll + VHOST_NET_VQ_RX, handle_rx_net, EPOLLIN, dev);
957 957
958 f->private_data = n; 958 f->private_data = n;
959 959
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 2db5af8e8652..1b3e8d2d5c8b 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -211,7 +211,7 @@ int vhost_poll_start(struct vhost_poll *poll, struct file *file)
211 mask = file->f_op->poll(file, &poll->table); 211 mask = file->f_op->poll(file, &poll->table);
212 if (mask) 212 if (mask)
213 vhost_poll_wakeup(&poll->wait, 0, 0, poll_to_key(mask)); 213 vhost_poll_wakeup(&poll->wait, 0, 0, poll_to_key(mask));
214 if (mask & POLLERR) { 214 if (mask & EPOLLERR) {
215 if (poll->wqh) 215 if (poll->wqh)
216 remove_wait_queue(poll->wqh, &poll->wait); 216 remove_wait_queue(poll->wqh, &poll->wait);
217 ret = -EINVAL; 217 ret = -EINVAL;
@@ -440,7 +440,7 @@ void vhost_dev_init(struct vhost_dev *dev,
440 vhost_vq_reset(dev, vq); 440 vhost_vq_reset(dev, vq);
441 if (vq->handle_kick) 441 if (vq->handle_kick)
442 vhost_poll_init(&vq->poll, vq->handle_kick, 442 vhost_poll_init(&vq->poll, vq->handle_kick,
443 POLLIN, dev); 443 EPOLLIN, dev);
444 } 444 }
445} 445}
446EXPORT_SYMBOL_GPL(vhost_dev_init); 446EXPORT_SYMBOL_GPL(vhost_dev_init);
@@ -630,7 +630,7 @@ void vhost_dev_cleanup(struct vhost_dev *dev)
630 vhost_umem_clean(dev->iotlb); 630 vhost_umem_clean(dev->iotlb);
631 dev->iotlb = NULL; 631 dev->iotlb = NULL;
632 vhost_clear_msg(dev); 632 vhost_clear_msg(dev);
633 wake_up_interruptible_poll(&dev->wait, POLLIN | POLLRDNORM); 633 wake_up_interruptible_poll(&dev->wait, EPOLLIN | EPOLLRDNORM);
634 WARN_ON(!llist_empty(&dev->work_list)); 634 WARN_ON(!llist_empty(&dev->work_list));
635 if (dev->worker) { 635 if (dev->worker) {
636 kthread_stop(dev->worker); 636 kthread_stop(dev->worker);
@@ -1057,7 +1057,7 @@ __poll_t vhost_chr_poll(struct file *file, struct vhost_dev *dev,
1057 poll_wait(file, &dev->wait, wait); 1057 poll_wait(file, &dev->wait, wait);
1058 1058
1059 if (!list_empty(&dev->read_list)) 1059 if (!list_empty(&dev->read_list))
1060 mask |= POLLIN | POLLRDNORM; 1060 mask |= EPOLLIN | EPOLLRDNORM;
1061 1061
1062 return mask; 1062 return mask;
1063} 1063}
@@ -2356,7 +2356,7 @@ void vhost_enqueue_msg(struct vhost_dev *dev, struct list_head *head,
2356 list_add_tail(&node->node, head); 2356 list_add_tail(&node->node, head);
2357 spin_unlock(&dev->iotlb_lock); 2357 spin_unlock(&dev->iotlb_lock);
2358 2358
2359 wake_up_interruptible_poll(&dev->wait, POLLIN | POLLRDNORM); 2359 wake_up_interruptible_poll(&dev->wait, EPOLLIN | EPOLLRDNORM);
2360} 2360}
2361EXPORT_SYMBOL_GPL(vhost_enqueue_msg); 2361EXPORT_SYMBOL_GPL(vhost_enqueue_msg);
2362 2362
diff --git a/drivers/virt/fsl_hypervisor.c b/drivers/virt/fsl_hypervisor.c
index b0597bef4555..4e05d7f711fe 100644
--- a/drivers/virt/fsl_hypervisor.c
+++ b/drivers/virt/fsl_hypervisor.c
@@ -574,7 +574,7 @@ static __poll_t fsl_hv_poll(struct file *filp, struct poll_table_struct *p)
574 spin_lock_irqsave(&dbq->lock, flags); 574 spin_lock_irqsave(&dbq->lock, flags);
575 575
576 poll_wait(filp, &dbq->wait, p); 576 poll_wait(filp, &dbq->wait, p);
577 mask = (dbq->head == dbq->tail) ? 0 : (POLLIN | POLLRDNORM); 577 mask = (dbq->head == dbq->tail) ? 0 : (EPOLLIN | EPOLLRDNORM);
578 578
579 spin_unlock_irqrestore(&dbq->lock, flags); 579 spin_unlock_irqrestore(&dbq->lock, flags);
580 580
diff --git a/drivers/xen/evtchn.c b/drivers/xen/evtchn.c
index 72c0416a01cc..8cac07ab60ab 100644
--- a/drivers/xen/evtchn.c
+++ b/drivers/xen/evtchn.c
@@ -623,14 +623,14 @@ static long evtchn_ioctl(struct file *file,
623 623
624static __poll_t evtchn_poll(struct file *file, poll_table *wait) 624static __poll_t evtchn_poll(struct file *file, poll_table *wait)
625{ 625{
626 __poll_t mask = POLLOUT | POLLWRNORM; 626 __poll_t mask = EPOLLOUT | EPOLLWRNORM;
627 struct per_user_data *u = file->private_data; 627 struct per_user_data *u = file->private_data;
628 628
629 poll_wait(file, &u->evtchn_wait, wait); 629 poll_wait(file, &u->evtchn_wait, wait);
630 if (u->ring_cons != u->ring_prod) 630 if (u->ring_cons != u->ring_prod)
631 mask |= POLLIN | POLLRDNORM; 631 mask |= EPOLLIN | EPOLLRDNORM;
632 if (u->ring_overflow) 632 if (u->ring_overflow)
633 mask = POLLERR; 633 mask = EPOLLERR;
634 return mask; 634 return mask;
635} 635}
636 636
diff --git a/drivers/xen/mcelog.c b/drivers/xen/mcelog.c
index 9ade533d9e40..262835ace35d 100644
--- a/drivers/xen/mcelog.c
+++ b/drivers/xen/mcelog.c
@@ -144,7 +144,7 @@ static __poll_t xen_mce_chrdev_poll(struct file *file, poll_table *wait)
144 poll_wait(file, &xen_mce_chrdev_wait, wait); 144 poll_wait(file, &xen_mce_chrdev_wait, wait);
145 145
146 if (xen_mcelog.next) 146 if (xen_mcelog.next)
147 return POLLIN | POLLRDNORM; 147 return EPOLLIN | EPOLLRDNORM;
148 148
149 return 0; 149 return 0;
150} 150}
diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c
index 78804e71f9a6..753d9cb437d0 100644
--- a/drivers/xen/pvcalls-front.c
+++ b/drivers/xen/pvcalls-front.c
@@ -892,7 +892,7 @@ static __poll_t pvcalls_front_poll_passive(struct file *file,
892 892
893 if (req_id != PVCALLS_INVALID_ID && 893 if (req_id != PVCALLS_INVALID_ID &&
894 READ_ONCE(bedata->rsp[req_id].req_id) == req_id) 894 READ_ONCE(bedata->rsp[req_id].req_id) == req_id)
895 return POLLIN | POLLRDNORM; 895 return EPOLLIN | EPOLLRDNORM;
896 896
897 poll_wait(file, &map->passive.inflight_accept_req, wait); 897 poll_wait(file, &map->passive.inflight_accept_req, wait);
898 return 0; 898 return 0;
@@ -900,7 +900,7 @@ static __poll_t pvcalls_front_poll_passive(struct file *file,
900 900
901 if (test_and_clear_bit(PVCALLS_FLAG_POLL_RET, 901 if (test_and_clear_bit(PVCALLS_FLAG_POLL_RET,
902 (void *)&map->passive.flags)) 902 (void *)&map->passive.flags))
903 return POLLIN | POLLRDNORM; 903 return EPOLLIN | EPOLLRDNORM;
904 904
905 /* 905 /*
906 * First check RET, then INFLIGHT. No barriers necessary to 906 * First check RET, then INFLIGHT. No barriers necessary to
@@ -949,11 +949,11 @@ static __poll_t pvcalls_front_poll_active(struct file *file,
949 949
950 poll_wait(file, &map->active.inflight_conn_req, wait); 950 poll_wait(file, &map->active.inflight_conn_req, wait);
951 if (pvcalls_front_write_todo(map)) 951 if (pvcalls_front_write_todo(map))
952 mask |= POLLOUT | POLLWRNORM; 952 mask |= EPOLLOUT | EPOLLWRNORM;
953 if (pvcalls_front_read_todo(map)) 953 if (pvcalls_front_read_todo(map))
954 mask |= POLLIN | POLLRDNORM; 954 mask |= EPOLLIN | EPOLLRDNORM;
955 if (in_error != 0 || out_error != 0) 955 if (in_error != 0 || out_error != 0)
956 mask |= POLLERR; 956 mask |= EPOLLERR;
957 957
958 return mask; 958 return mask;
959} 959}
@@ -968,14 +968,14 @@ __poll_t pvcalls_front_poll(struct file *file, struct socket *sock,
968 pvcalls_enter(); 968 pvcalls_enter();
969 if (!pvcalls_front_dev) { 969 if (!pvcalls_front_dev) {
970 pvcalls_exit(); 970 pvcalls_exit();
971 return POLLNVAL; 971 return EPOLLNVAL;
972 } 972 }
973 bedata = dev_get_drvdata(&pvcalls_front_dev->dev); 973 bedata = dev_get_drvdata(&pvcalls_front_dev->dev);
974 974
975 map = (struct sock_mapping *) sock->sk->sk_send_head; 975 map = (struct sock_mapping *) sock->sk->sk_send_head;
976 if (!map) { 976 if (!map) {
977 pvcalls_exit(); 977 pvcalls_exit();
978 return POLLNVAL; 978 return EPOLLNVAL;
979 } 979 }
980 if (map->active_socket) 980 if (map->active_socket)
981 ret = pvcalls_front_poll_active(file, bedata, map, wait); 981 ret = pvcalls_front_poll_active(file, bedata, map, wait);
diff --git a/drivers/xen/xenbus/xenbus_dev_frontend.c b/drivers/xen/xenbus/xenbus_dev_frontend.c
index e17ec3fce590..a493e99bed21 100644
--- a/drivers/xen/xenbus/xenbus_dev_frontend.c
+++ b/drivers/xen/xenbus/xenbus_dev_frontend.c
@@ -651,7 +651,7 @@ static __poll_t xenbus_file_poll(struct file *file, poll_table *wait)
651 651
652 poll_wait(file, &u->read_waitq, wait); 652 poll_wait(file, &u->read_waitq, wait);
653 if (!list_empty(&u->read_buffers)) 653 if (!list_empty(&u->read_buffers))
654 return POLLIN | POLLRDNORM; 654 return EPOLLIN | EPOLLRDNORM;
655 return 0; 655 return 0;
656} 656}
657 657
diff --git a/fs/cachefiles/daemon.c b/fs/cachefiles/daemon.c
index 7edbd0679952..3fdee214a5bb 100644
--- a/fs/cachefiles/daemon.c
+++ b/fs/cachefiles/daemon.c
@@ -289,7 +289,7 @@ found_command:
289 289
290/* 290/*
291 * poll for culling state 291 * poll for culling state
292 * - use POLLOUT to indicate culling state 292 * - use EPOLLOUT to indicate culling state
293 */ 293 */
294static __poll_t cachefiles_daemon_poll(struct file *file, 294static __poll_t cachefiles_daemon_poll(struct file *file,
295 struct poll_table_struct *poll) 295 struct poll_table_struct *poll)
@@ -301,10 +301,10 @@ static __poll_t cachefiles_daemon_poll(struct file *file,
301 mask = 0; 301 mask = 0;
302 302
303 if (test_bit(CACHEFILES_STATE_CHANGED, &cache->flags)) 303 if (test_bit(CACHEFILES_STATE_CHANGED, &cache->flags))
304 mask |= POLLIN; 304 mask |= EPOLLIN;
305 305
306 if (test_bit(CACHEFILES_CULLING, &cache->flags)) 306 if (test_bit(CACHEFILES_CULLING, &cache->flags))
307 mask |= POLLOUT; 307 mask |= EPOLLOUT;
308 308
309 return mask; 309 return mask;
310} 310}
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c
index 80b9b84391a9..c5234c21b539 100644
--- a/fs/coda/psdev.c
+++ b/fs/coda/psdev.c
@@ -64,12 +64,12 @@ static struct class *coda_psdev_class;
64static __poll_t coda_psdev_poll(struct file *file, poll_table * wait) 64static __poll_t coda_psdev_poll(struct file *file, poll_table * wait)
65{ 65{
66 struct venus_comm *vcp = (struct venus_comm *) file->private_data; 66 struct venus_comm *vcp = (struct venus_comm *) file->private_data;
67 __poll_t mask = POLLOUT | POLLWRNORM; 67 __poll_t mask = EPOLLOUT | EPOLLWRNORM;
68 68
69 poll_wait(file, &vcp->vc_waitq, wait); 69 poll_wait(file, &vcp->vc_waitq, wait);
70 mutex_lock(&vcp->vc_mutex); 70 mutex_lock(&vcp->vc_mutex);
71 if (!list_empty(&vcp->vc_pending)) 71 if (!list_empty(&vcp->vc_pending))
72 mask |= POLLIN | POLLRDNORM; 72 mask |= EPOLLIN | EPOLLRDNORM;
73 mutex_unlock(&vcp->vc_mutex); 73 mutex_unlock(&vcp->vc_mutex);
74 74
75 return mask; 75 return mask;
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
index 20bb73a931dd..1f99678ff5d3 100644
--- a/fs/debugfs/file.c
+++ b/fs/debugfs/file.c
@@ -214,7 +214,7 @@ static __poll_t full_proxy_poll(struct file *filp,
214 const struct file_operations *real_fops; 214 const struct file_operations *real_fops;
215 215
216 if (debugfs_file_get(dentry)) 216 if (debugfs_file_get(dentry))
217 return POLLHUP; 217 return EPOLLHUP;
218 218
219 real_fops = debugfs_real_fops(filp); 219 real_fops = debugfs_real_fops(filp);
220 r = real_fops->poll(filp, wait); 220 r = real_fops->poll(filp, wait);
diff --git a/fs/dlm/plock.c b/fs/dlm/plock.c
index a4c63e9e6385..c7d5a2ea3d03 100644
--- a/fs/dlm/plock.c
+++ b/fs/dlm/plock.c
@@ -471,7 +471,7 @@ static __poll_t dev_poll(struct file *file, poll_table *wait)
471 471
472 spin_lock(&ops_lock); 472 spin_lock(&ops_lock);
473 if (!list_empty(&send_list)) 473 if (!list_empty(&send_list))
474 mask = POLLIN | POLLRDNORM; 474 mask = EPOLLIN | EPOLLRDNORM;
475 spin_unlock(&ops_lock); 475 spin_unlock(&ops_lock);
476 476
477 return mask; 477 return mask;
diff --git a/fs/dlm/user.c b/fs/dlm/user.c
index 662432af8ce8..2a669390cd7f 100644
--- a/fs/dlm/user.c
+++ b/fs/dlm/user.c
@@ -896,7 +896,7 @@ static __poll_t device_poll(struct file *file, poll_table *wait)
896 spin_lock(&proc->asts_spin); 896 spin_lock(&proc->asts_spin);
897 if (!list_empty(&proc->asts)) { 897 if (!list_empty(&proc->asts)) {
898 spin_unlock(&proc->asts_spin); 898 spin_unlock(&proc->asts_spin);
899 return POLLIN | POLLRDNORM; 899 return EPOLLIN | EPOLLRDNORM;
900 } 900 }
901 spin_unlock(&proc->asts_spin); 901 spin_unlock(&proc->asts_spin);
902 return 0; 902 return 0;
diff --git a/fs/ecryptfs/miscdev.c b/fs/ecryptfs/miscdev.c
index 7423e792a092..2d1158e5f950 100644
--- a/fs/ecryptfs/miscdev.c
+++ b/fs/ecryptfs/miscdev.c
@@ -59,7 +59,7 @@ ecryptfs_miscdev_poll(struct file *file, poll_table *pt)
59 poll_wait(file, &daemon->wait, pt); 59 poll_wait(file, &daemon->wait, pt);
60 mutex_lock(&daemon->mux); 60 mutex_lock(&daemon->mux);
61 if (!list_empty(&daemon->msg_ctx_out_queue)) 61 if (!list_empty(&daemon->msg_ctx_out_queue))
62 mask |= POLLIN | POLLRDNORM; 62 mask |= EPOLLIN | EPOLLRDNORM;
63out_unlock_daemon: 63out_unlock_daemon:
64 daemon->flags &= ~ECRYPTFS_DAEMON_IN_POLL; 64 daemon->flags &= ~ECRYPTFS_DAEMON_IN_POLL;
65 mutex_unlock(&daemon->mux); 65 mutex_unlock(&daemon->mux);
diff --git a/fs/eventfd.c b/fs/eventfd.c
index 04fd824142a1..012f5bd46dfa 100644
--- a/fs/eventfd.c
+++ b/fs/eventfd.c
@@ -45,7 +45,7 @@ struct eventfd_ctx {
45 * 45 *
46 * This function is supposed to be called by the kernel in paths that do not 46 * This function is supposed to be called by the kernel in paths that do not
47 * allow sleeping. In this function we allow the counter to reach the ULLONG_MAX 47 * allow sleeping. In this function we allow the counter to reach the ULLONG_MAX
48 * value, and we signal this as overflow condition by returning a POLLERR 48 * value, and we signal this as overflow condition by returning a EPOLLERR
49 * to poll(2). 49 * to poll(2).
50 * 50 *
51 * Returns the amount by which the counter was incremented. This will be less 51 * Returns the amount by which the counter was incremented. This will be less
@@ -60,7 +60,7 @@ __u64 eventfd_signal(struct eventfd_ctx *ctx, __u64 n)
60 n = ULLONG_MAX - ctx->count; 60 n = ULLONG_MAX - ctx->count;
61 ctx->count += n; 61 ctx->count += n;
62 if (waitqueue_active(&ctx->wqh)) 62 if (waitqueue_active(&ctx->wqh))
63 wake_up_locked_poll(&ctx->wqh, POLLIN); 63 wake_up_locked_poll(&ctx->wqh, EPOLLIN);
64 spin_unlock_irqrestore(&ctx->wqh.lock, flags); 64 spin_unlock_irqrestore(&ctx->wqh.lock, flags);
65 65
66 return n; 66 return n;
@@ -96,7 +96,7 @@ static int eventfd_release(struct inode *inode, struct file *file)
96{ 96{
97 struct eventfd_ctx *ctx = file->private_data; 97 struct eventfd_ctx *ctx = file->private_data;
98 98
99 wake_up_poll(&ctx->wqh, POLLHUP); 99 wake_up_poll(&ctx->wqh, EPOLLHUP);
100 eventfd_ctx_put(ctx); 100 eventfd_ctx_put(ctx);
101 return 0; 101 return 0;
102} 102}
@@ -150,11 +150,11 @@ static __poll_t eventfd_poll(struct file *file, poll_table *wait)
150 count = READ_ONCE(ctx->count); 150 count = READ_ONCE(ctx->count);
151 151
152 if (count > 0) 152 if (count > 0)
153 events |= POLLIN; 153 events |= EPOLLIN;
154 if (count == ULLONG_MAX) 154 if (count == ULLONG_MAX)
155 events |= POLLERR; 155 events |= EPOLLERR;
156 if (ULLONG_MAX - 1 > count) 156 if (ULLONG_MAX - 1 > count)
157 events |= POLLOUT; 157 events |= EPOLLOUT;
158 158
159 return events; 159 return events;
160} 160}
@@ -187,7 +187,7 @@ int eventfd_ctx_remove_wait_queue(struct eventfd_ctx *ctx, wait_queue_entry_t *w
187 eventfd_ctx_do_read(ctx, cnt); 187 eventfd_ctx_do_read(ctx, cnt);
188 __remove_wait_queue(&ctx->wqh, wait); 188 __remove_wait_queue(&ctx->wqh, wait);
189 if (*cnt != 0 && waitqueue_active(&ctx->wqh)) 189 if (*cnt != 0 && waitqueue_active(&ctx->wqh))
190 wake_up_locked_poll(&ctx->wqh, POLLOUT); 190 wake_up_locked_poll(&ctx->wqh, EPOLLOUT);
191 spin_unlock_irqrestore(&ctx->wqh.lock, flags); 191 spin_unlock_irqrestore(&ctx->wqh.lock, flags);
192 192
193 return *cnt != 0 ? 0 : -EAGAIN; 193 return *cnt != 0 ? 0 : -EAGAIN;
@@ -231,7 +231,7 @@ static ssize_t eventfd_read(struct file *file, char __user *buf, size_t count,
231 if (likely(res > 0)) { 231 if (likely(res > 0)) {
232 eventfd_ctx_do_read(ctx, &ucnt); 232 eventfd_ctx_do_read(ctx, &ucnt);
233 if (waitqueue_active(&ctx->wqh)) 233 if (waitqueue_active(&ctx->wqh))
234 wake_up_locked_poll(&ctx->wqh, POLLOUT); 234 wake_up_locked_poll(&ctx->wqh, EPOLLOUT);
235 } 235 }
236 spin_unlock_irq(&ctx->wqh.lock); 236 spin_unlock_irq(&ctx->wqh.lock);
237 237
@@ -281,7 +281,7 @@ static ssize_t eventfd_write(struct file *file, const char __user *buf, size_t c
281 if (likely(res > 0)) { 281 if (likely(res > 0)) {
282 ctx->count += ucnt; 282 ctx->count += ucnt;
283 if (waitqueue_active(&ctx->wqh)) 283 if (waitqueue_active(&ctx->wqh))
284 wake_up_locked_poll(&ctx->wqh, POLLIN); 284 wake_up_locked_poll(&ctx->wqh, EPOLLIN);
285 } 285 }
286 spin_unlock_irq(&ctx->wqh.lock); 286 spin_unlock_irq(&ctx->wqh.lock);
287 287
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index d1a490c7e6c3..0f3494ed3ed0 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -95,9 +95,9 @@
95/* Epoll private bits inside the event mask */ 95/* Epoll private bits inside the event mask */
96#define EP_PRIVATE_BITS (EPOLLWAKEUP | EPOLLONESHOT | EPOLLET | EPOLLEXCLUSIVE) 96#define EP_PRIVATE_BITS (EPOLLWAKEUP | EPOLLONESHOT | EPOLLET | EPOLLEXCLUSIVE)
97 97
98#define EPOLLINOUT_BITS (POLLIN | POLLOUT) 98#define EPOLLINOUT_BITS (EPOLLIN | EPOLLOUT)
99 99
100#define EPOLLEXCLUSIVE_OK_BITS (EPOLLINOUT_BITS | POLLERR | POLLHUP | \ 100#define EPOLLEXCLUSIVE_OK_BITS (EPOLLINOUT_BITS | EPOLLERR | EPOLLHUP | \
101 EPOLLWAKEUP | EPOLLET | EPOLLEXCLUSIVE) 101 EPOLLWAKEUP | EPOLLET | EPOLLEXCLUSIVE)
102 102
103/* Maximum number of nesting allowed inside epoll sets */ 103/* Maximum number of nesting allowed inside epoll sets */
@@ -555,7 +555,7 @@ static int ep_poll_wakeup_proc(void *priv, void *cookie, int call_nests)
555 wait_queue_head_t *wqueue = (wait_queue_head_t *)cookie; 555 wait_queue_head_t *wqueue = (wait_queue_head_t *)cookie;
556 556
557 spin_lock_irqsave_nested(&wqueue->lock, flags, call_nests + 1); 557 spin_lock_irqsave_nested(&wqueue->lock, flags, call_nests + 1);
558 wake_up_locked_poll(wqueue, POLLIN); 558 wake_up_locked_poll(wqueue, EPOLLIN);
559 spin_unlock_irqrestore(&wqueue->lock, flags); 559 spin_unlock_irqrestore(&wqueue->lock, flags);
560 560
561 return 0; 561 return 0;
@@ -575,7 +575,7 @@ static void ep_poll_safewake(wait_queue_head_t *wq)
575 575
576static void ep_poll_safewake(wait_queue_head_t *wq) 576static void ep_poll_safewake(wait_queue_head_t *wq)
577{ 577{
578 wake_up_poll(wq, POLLIN); 578 wake_up_poll(wq, EPOLLIN);
579} 579}
580 580
581#endif 581#endif
@@ -908,7 +908,7 @@ static __poll_t ep_read_events_proc(struct eventpoll *ep, struct list_head *head
908 908
909 list_for_each_entry_safe(epi, tmp, head, rdllink) { 909 list_for_each_entry_safe(epi, tmp, head, rdllink) {
910 if (ep_item_poll(epi, &pt, depth)) { 910 if (ep_item_poll(epi, &pt, depth)) {
911 return POLLIN | POLLRDNORM; 911 return EPOLLIN | EPOLLRDNORM;
912 } else { 912 } else {
913 /* 913 /*
914 * Item has been dropped into the ready list by the poll 914 * Item has been dropped into the ready list by the poll
@@ -1181,12 +1181,12 @@ static int ep_poll_callback(wait_queue_entry_t *wait, unsigned mode, int sync, v
1181 if ((epi->event.events & EPOLLEXCLUSIVE) && 1181 if ((epi->event.events & EPOLLEXCLUSIVE) &&
1182 !(pollflags & POLLFREE)) { 1182 !(pollflags & POLLFREE)) {
1183 switch (pollflags & EPOLLINOUT_BITS) { 1183 switch (pollflags & EPOLLINOUT_BITS) {
1184 case POLLIN: 1184 case EPOLLIN:
1185 if (epi->event.events & POLLIN) 1185 if (epi->event.events & EPOLLIN)
1186 ewake = 1; 1186 ewake = 1;
1187 break; 1187 break;
1188 case POLLOUT: 1188 case EPOLLOUT:
1189 if (epi->event.events & POLLOUT) 1189 if (epi->event.events & EPOLLOUT)
1190 ewake = 1; 1190 ewake = 1;
1191 break; 1191 break;
1192 case 0: 1192 case 0:
@@ -2105,7 +2105,7 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
2105 switch (op) { 2105 switch (op) {
2106 case EPOLL_CTL_ADD: 2106 case EPOLL_CTL_ADD:
2107 if (!epi) { 2107 if (!epi) {
2108 epds.events |= POLLERR | POLLHUP; 2108 epds.events |= EPOLLERR | EPOLLHUP;
2109 error = ep_insert(ep, &epds, tf.file, fd, full_check); 2109 error = ep_insert(ep, &epds, tf.file, fd, full_check);
2110 } else 2110 } else
2111 error = -EEXIST; 2111 error = -EEXIST;
@@ -2121,7 +2121,7 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
2121 case EPOLL_CTL_MOD: 2121 case EPOLL_CTL_MOD:
2122 if (epi) { 2122 if (epi) {
2123 if (!(epi->event.events & EPOLLEXCLUSIVE)) { 2123 if (!(epi->event.events & EPOLLEXCLUSIVE)) {
2124 epds.events |= POLLERR | POLLHUP; 2124 epds.events |= EPOLLERR | EPOLLHUP;
2125 error = ep_modify(ep, epi, &epds); 2125 error = ep_modify(ep, epi, &epds);
2126 } 2126 }
2127 } else 2127 } else
diff --git a/fs/fcntl.c b/fs/fcntl.c
index 4fc731876d6b..1e97f1fda90c 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -691,12 +691,12 @@ COMPAT_SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd,
691/* Table to convert sigio signal codes into poll band bitmaps */ 691/* Table to convert sigio signal codes into poll band bitmaps */
692 692
693static const __poll_t band_table[NSIGPOLL] = { 693static const __poll_t band_table[NSIGPOLL] = {
694 POLLIN | POLLRDNORM, /* POLL_IN */ 694 EPOLLIN | EPOLLRDNORM, /* POLL_IN */
695 POLLOUT | POLLWRNORM | POLLWRBAND, /* POLL_OUT */ 695 EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND, /* POLL_OUT */
696 POLLIN | POLLRDNORM | POLLMSG, /* POLL_MSG */ 696 EPOLLIN | EPOLLRDNORM | EPOLLMSG, /* POLL_MSG */
697 POLLERR, /* POLL_ERR */ 697 EPOLLERR, /* POLL_ERR */
698 POLLPRI | POLLRDBAND, /* POLL_PRI */ 698 EPOLLPRI | EPOLLRDBAND, /* POLL_PRI */
699 POLLHUP | POLLERR /* POLL_HUP */ 699 EPOLLHUP | EPOLLERR /* POLL_HUP */
700}; 700};
701 701
702static inline int sigio_perm(struct task_struct *p, 702static inline int sigio_perm(struct task_struct *p,
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index aa089a6925d0..5d06384c2cae 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -2006,21 +2006,21 @@ out:
2006 2006
2007static __poll_t fuse_dev_poll(struct file *file, poll_table *wait) 2007static __poll_t fuse_dev_poll(struct file *file, poll_table *wait)
2008{ 2008{
2009 __poll_t mask = POLLOUT | POLLWRNORM; 2009 __poll_t mask = EPOLLOUT | EPOLLWRNORM;
2010 struct fuse_iqueue *fiq; 2010 struct fuse_iqueue *fiq;
2011 struct fuse_dev *fud = fuse_get_dev(file); 2011 struct fuse_dev *fud = fuse_get_dev(file);
2012 2012
2013 if (!fud) 2013 if (!fud)
2014 return POLLERR; 2014 return EPOLLERR;
2015 2015
2016 fiq = &fud->fc->iq; 2016 fiq = &fud->fc->iq;
2017 poll_wait(file, &fiq->waitq, wait); 2017 poll_wait(file, &fiq->waitq, wait);
2018 2018
2019 spin_lock(&fiq->waitq.lock); 2019 spin_lock(&fiq->waitq.lock);
2020 if (!fiq->connected) 2020 if (!fiq->connected)
2021 mask = POLLERR; 2021 mask = EPOLLERR;
2022 else if (request_pending(fiq)) 2022 else if (request_pending(fiq))
2023 mask |= POLLIN | POLLRDNORM; 2023 mask |= EPOLLIN | EPOLLRDNORM;
2024 spin_unlock(&fiq->waitq.lock); 2024 spin_unlock(&fiq->waitq.lock);
2025 2025
2026 return mask; 2026 return mask;
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index e85e974dd211..a201fb0ac64f 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -2791,7 +2791,7 @@ __poll_t fuse_file_poll(struct file *file, poll_table *wait)
2791 fc->no_poll = 1; 2791 fc->no_poll = 1;
2792 return DEFAULT_POLLMASK; 2792 return DEFAULT_POLLMASK;
2793 } 2793 }
2794 return POLLERR; 2794 return EPOLLERR;
2795} 2795}
2796EXPORT_SYMBOL_GPL(fuse_file_poll); 2796EXPORT_SYMBOL_GPL(fuse_file_poll);
2797 2797
diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c
index a03ce3422578..fd5ce883072e 100644
--- a/fs/kernfs/file.c
+++ b/fs/kernfs/file.c
@@ -823,7 +823,7 @@ void kernfs_drain_open_files(struct kernfs_node *kn)
823 * the content and then you use 'poll' or 'select' to wait for 823 * the content and then you use 'poll' or 'select' to wait for
824 * the content to change. When the content changes (assuming the 824 * the content to change. When the content changes (assuming the
825 * manager for the kobject supports notification), poll will 825 * manager for the kobject supports notification), poll will
826 * return POLLERR|POLLPRI, and select will return the fd whether 826 * return EPOLLERR|EPOLLPRI, and select will return the fd whether
827 * it is waiting for read, write, or exceptions. 827 * it is waiting for read, write, or exceptions.
828 * Once poll/select indicates that the value has changed, you 828 * Once poll/select indicates that the value has changed, you
829 * need to close and re-open the file, or seek to 0 and read again. 829 * need to close and re-open the file, or seek to 0 and read again.
@@ -851,7 +851,7 @@ static __poll_t kernfs_fop_poll(struct file *filp, poll_table *wait)
851 return DEFAULT_POLLMASK; 851 return DEFAULT_POLLMASK;
852 852
853 trigger: 853 trigger:
854 return DEFAULT_POLLMASK|POLLERR|POLLPRI; 854 return DEFAULT_POLLMASK|EPOLLERR|EPOLLPRI;
855} 855}
856 856
857static void kernfs_notify_workfn(struct work_struct *work) 857static void kernfs_notify_workfn(struct work_struct *work)
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index ef08d64c84b8..c07eb3d655ea 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -247,7 +247,7 @@ static __poll_t fanotify_poll(struct file *file, poll_table *wait)
247 poll_wait(file, &group->notification_waitq, wait); 247 poll_wait(file, &group->notification_waitq, wait);
248 spin_lock(&group->notification_lock); 248 spin_lock(&group->notification_lock);
249 if (!fsnotify_notify_queue_is_empty(group)) 249 if (!fsnotify_notify_queue_is_empty(group))
250 ret = POLLIN | POLLRDNORM; 250 ret = EPOLLIN | EPOLLRDNORM;
251 spin_unlock(&group->notification_lock); 251 spin_unlock(&group->notification_lock);
252 252
253 return ret; 253 return ret;
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
index 5c29bf16814f..2c908b31d6c9 100644
--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -115,7 +115,7 @@ static __poll_t inotify_poll(struct file *file, poll_table *wait)
115 poll_wait(file, &group->notification_waitq, wait); 115 poll_wait(file, &group->notification_waitq, wait);
116 spin_lock(&group->notification_lock); 116 spin_lock(&group->notification_lock);
117 if (!fsnotify_notify_queue_is_empty(group)) 117 if (!fsnotify_notify_queue_is_empty(group))
118 ret = POLLIN | POLLRDNORM; 118 ret = EPOLLIN | EPOLLRDNORM;
119 spin_unlock(&group->notification_lock); 119 spin_unlock(&group->notification_lock);
120 120
121 return ret; 121 return ret;
diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c
index 385fcefa8bc5..602c71f32740 100644
--- a/fs/ocfs2/dlmfs/dlmfs.c
+++ b/fs/ocfs2/dlmfs/dlmfs.c
@@ -71,7 +71,7 @@ struct workqueue_struct *user_dlm_worker;
71 * Over time, dlmfs has added some features that were not part of the 71 * Over time, dlmfs has added some features that were not part of the
72 * initial ABI. Unfortunately, some of these features are not detectable 72 * initial ABI. Unfortunately, some of these features are not detectable
73 * via standard usage. For example, Linux's default poll always returns 73 * via standard usage. For example, Linux's default poll always returns
74 * POLLIN, so there is no way for a caller of poll(2) to know when dlmfs 74 * EPOLLIN, so there is no way for a caller of poll(2) to know when dlmfs
75 * added poll support. Instead, we provide this list of new capabilities. 75 * added poll support. Instead, we provide this list of new capabilities.
76 * 76 *
77 * Capabilities is a read-only attribute. We do it as a module parameter 77 * Capabilities is a read-only attribute. We do it as a module parameter
@@ -83,7 +83,7 @@ struct workqueue_struct *user_dlm_worker;
83 * interaction. 83 * interaction.
84 * 84 *
85 * Capabilities: 85 * Capabilities:
86 * - bast : POLLIN against the file descriptor of a held lock 86 * - bast : EPOLLIN against the file descriptor of a held lock
87 * signifies a bast fired on the lock. 87 * signifies a bast fired on the lock.
88 */ 88 */
89#define DLMFS_CAPABILITIES "bast stackglue" 89#define DLMFS_CAPABILITIES "bast stackglue"
@@ -230,7 +230,7 @@ static __poll_t dlmfs_file_poll(struct file *file, poll_table *wait)
230 230
231 spin_lock(&ip->ip_lockres.l_lock); 231 spin_lock(&ip->ip_lockres.l_lock);
232 if (ip->ip_lockres.l_flags & USER_LOCK_BLOCKED) 232 if (ip->ip_lockres.l_flags & USER_LOCK_BLOCKED)
233 event = POLLIN | POLLRDNORM; 233 event = EPOLLIN | EPOLLRDNORM;
234 spin_unlock(&ip->ip_lockres.l_lock); 234 spin_unlock(&ip->ip_lockres.l_lock);
235 235
236 return event; 236 return event;
diff --git a/fs/orangefs/devorangefs-req.c b/fs/orangefs/devorangefs-req.c
index f073cd9e6687..b03057afac2a 100644
--- a/fs/orangefs/devorangefs-req.c
+++ b/fs/orangefs/devorangefs-req.c
@@ -823,7 +823,7 @@ static __poll_t orangefs_devreq_poll(struct file *file,
823 poll_wait(file, &orangefs_request_list_waitq, poll_table); 823 poll_wait(file, &orangefs_request_list_waitq, poll_table);
824 824
825 if (!list_empty(&orangefs_request_list)) 825 if (!list_empty(&orangefs_request_list))
826 poll_revent_mask |= POLLIN; 826 poll_revent_mask |= EPOLLIN;
827 return poll_revent_mask; 827 return poll_revent_mask;
828} 828}
829 829
diff --git a/fs/pipe.c b/fs/pipe.c
index 0913aed7fd0d..7b1954caf388 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -327,7 +327,7 @@ pipe_read(struct kiocb *iocb, struct iov_iter *to)
327 break; 327 break;
328 } 328 }
329 if (do_wakeup) { 329 if (do_wakeup) {
330 wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT | POLLWRNORM); 330 wake_up_interruptible_sync_poll(&pipe->wait, EPOLLOUT | EPOLLWRNORM);
331 kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT); 331 kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT);
332 } 332 }
333 pipe_wait(pipe); 333 pipe_wait(pipe);
@@ -336,7 +336,7 @@ pipe_read(struct kiocb *iocb, struct iov_iter *to)
336 336
337 /* Signal writers asynchronously that there is more room. */ 337 /* Signal writers asynchronously that there is more room. */
338 if (do_wakeup) { 338 if (do_wakeup) {
339 wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT | POLLWRNORM); 339 wake_up_interruptible_sync_poll(&pipe->wait, EPOLLOUT | EPOLLWRNORM);
340 kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT); 340 kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT);
341 } 341 }
342 if (ret > 0) 342 if (ret > 0)
@@ -463,7 +463,7 @@ pipe_write(struct kiocb *iocb, struct iov_iter *from)
463 break; 463 break;
464 } 464 }
465 if (do_wakeup) { 465 if (do_wakeup) {
466 wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLRDNORM); 466 wake_up_interruptible_sync_poll(&pipe->wait, EPOLLIN | EPOLLRDNORM);
467 kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); 467 kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
468 do_wakeup = 0; 468 do_wakeup = 0;
469 } 469 }
@@ -474,7 +474,7 @@ pipe_write(struct kiocb *iocb, struct iov_iter *from)
474out: 474out:
475 __pipe_unlock(pipe); 475 __pipe_unlock(pipe);
476 if (do_wakeup) { 476 if (do_wakeup) {
477 wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLRDNORM); 477 wake_up_interruptible_sync_poll(&pipe->wait, EPOLLIN | EPOLLRDNORM);
478 kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); 478 kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
479 } 479 }
480 if (ret > 0 && sb_start_write_trylock(file_inode(filp)->i_sb)) { 480 if (ret > 0 && sb_start_write_trylock(file_inode(filp)->i_sb)) {
@@ -523,19 +523,19 @@ pipe_poll(struct file *filp, poll_table *wait)
523 nrbufs = pipe->nrbufs; 523 nrbufs = pipe->nrbufs;
524 mask = 0; 524 mask = 0;
525 if (filp->f_mode & FMODE_READ) { 525 if (filp->f_mode & FMODE_READ) {
526 mask = (nrbufs > 0) ? POLLIN | POLLRDNORM : 0; 526 mask = (nrbufs > 0) ? EPOLLIN | EPOLLRDNORM : 0;
527 if (!pipe->writers && filp->f_version != pipe->w_counter) 527 if (!pipe->writers && filp->f_version != pipe->w_counter)
528 mask |= POLLHUP; 528 mask |= EPOLLHUP;
529 } 529 }
530 530
531 if (filp->f_mode & FMODE_WRITE) { 531 if (filp->f_mode & FMODE_WRITE) {
532 mask |= (nrbufs < pipe->buffers) ? POLLOUT | POLLWRNORM : 0; 532 mask |= (nrbufs < pipe->buffers) ? EPOLLOUT | EPOLLWRNORM : 0;
533 /* 533 /*
534 * Most Unices do not set POLLERR for FIFOs but on Linux they 534 * Most Unices do not set EPOLLERR for FIFOs but on Linux they
535 * behave exactly like pipes for poll(). 535 * behave exactly like pipes for poll().
536 */ 536 */
537 if (!pipe->readers) 537 if (!pipe->readers)
538 mask |= POLLERR; 538 mask |= EPOLLERR;
539 } 539 }
540 540
541 return mask; 541 return mask;
@@ -568,7 +568,7 @@ pipe_release(struct inode *inode, struct file *file)
568 pipe->writers--; 568 pipe->writers--;
569 569
570 if (pipe->readers || pipe->writers) { 570 if (pipe->readers || pipe->writers) {
571 wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM | POLLERR | POLLHUP); 571 wake_up_interruptible_sync_poll(&pipe->wait, EPOLLIN | EPOLLOUT | EPOLLRDNORM | EPOLLWRNORM | EPOLLERR | EPOLLHUP);
572 kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); 572 kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
573 kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT); 573 kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT);
574 } 574 }
@@ -936,7 +936,7 @@ static int fifo_open(struct inode *inode, struct file *filp)
936 936
937 if (!is_pipe && !pipe->writers) { 937 if (!is_pipe && !pipe->writers) {
938 if ((filp->f_flags & O_NONBLOCK)) { 938 if ((filp->f_flags & O_NONBLOCK)) {
939 /* suppress POLLHUP until we have 939 /* suppress EPOLLHUP until we have
940 * seen a writer */ 940 * seen a writer */
941 filp->f_version = pipe->w_counter; 941 filp->f_version = pipe->w_counter;
942 } else { 942 } else {
diff --git a/fs/proc/kmsg.c b/fs/proc/kmsg.c
index f0bfb45c3f9f..4f4a2abb225e 100644
--- a/fs/proc/kmsg.c
+++ b/fs/proc/kmsg.c
@@ -44,7 +44,7 @@ static __poll_t kmsg_poll(struct file *file, poll_table *wait)
44{ 44{
45 poll_wait(file, &log_wait, wait); 45 poll_wait(file, &log_wait, wait);
46 if (do_syslog(SYSLOG_ACTION_SIZE_UNREAD, NULL, 0, SYSLOG_FROM_PROC)) 46 if (do_syslog(SYSLOG_ACTION_SIZE_UNREAD, NULL, 0, SYSLOG_FROM_PROC))
47 return POLLIN | POLLRDNORM; 47 return EPOLLIN | EPOLLRDNORM;
48 return 0; 48 return 0;
49} 49}
50 50
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index 63325377621a..c41ab261397d 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -640,7 +640,7 @@ static __poll_t proc_sys_poll(struct file *filp, poll_table *wait)
640 640
641 /* sysctl was unregistered */ 641 /* sysctl was unregistered */
642 if (IS_ERR(head)) 642 if (IS_ERR(head))
643 return POLLERR | POLLHUP; 643 return EPOLLERR | EPOLLHUP;
644 644
645 if (!table->proc_handler) 645 if (!table->proc_handler)
646 goto out; 646 goto out;
@@ -653,7 +653,7 @@ static __poll_t proc_sys_poll(struct file *filp, poll_table *wait)
653 653
654 if (event != atomic_read(&table->poll->event)) { 654 if (event != atomic_read(&table->poll->event)) {
655 filp->private_data = proc_sys_poll_event(table->poll); 655 filp->private_data = proc_sys_poll_event(table->poll);
656 ret = POLLIN | POLLRDNORM | POLLERR | POLLPRI; 656 ret = EPOLLIN | EPOLLRDNORM | EPOLLERR | EPOLLPRI;
657 } 657 }
658 658
659out: 659out:
diff --git a/fs/proc_namespace.c b/fs/proc_namespace.c
index c8528d587e09..e16fb8f2049e 100644
--- a/fs/proc_namespace.c
+++ b/fs/proc_namespace.c
@@ -23,7 +23,7 @@ static __poll_t mounts_poll(struct file *file, poll_table *wait)
23 struct seq_file *m = file->private_data; 23 struct seq_file *m = file->private_data;
24 struct proc_mounts *p = m->private; 24 struct proc_mounts *p = m->private;
25 struct mnt_namespace *ns = p->ns; 25 struct mnt_namespace *ns = p->ns;
26 __poll_t res = POLLIN | POLLRDNORM; 26 __poll_t res = EPOLLIN | EPOLLRDNORM;
27 int event; 27 int event;
28 28
29 poll_wait(file, &p->ns->poll, wait); 29 poll_wait(file, &p->ns->poll, wait);
@@ -31,7 +31,7 @@ static __poll_t mounts_poll(struct file *file, poll_table *wait)
31 event = READ_ONCE(ns->event); 31 event = READ_ONCE(ns->event);
32 if (m->poll_event != event) { 32 if (m->poll_event != event) {
33 m->poll_event = event; 33 m->poll_event = event;
34 res |= POLLERR | POLLPRI; 34 res |= EPOLLERR | EPOLLPRI;
35 } 35 }
36 36
37 return res; 37 return res;
diff --git a/fs/select.c b/fs/select.c
index ec14171dd78a..b6c36254028a 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -432,9 +432,9 @@ get_max:
432 return max; 432 return max;
433} 433}
434 434
435#define POLLIN_SET (POLLRDNORM | POLLRDBAND | POLLIN | POLLHUP | POLLERR) 435#define POLLIN_SET (EPOLLRDNORM | EPOLLRDBAND | EPOLLIN | EPOLLHUP | EPOLLERR)
436#define POLLOUT_SET (POLLWRBAND | POLLWRNORM | POLLOUT | POLLERR) 436#define POLLOUT_SET (EPOLLWRBAND | EPOLLWRNORM | EPOLLOUT | EPOLLERR)
437#define POLLEX_SET (POLLPRI) 437#define POLLEX_SET (EPOLLPRI)
438 438
439static inline void wait_key_set(poll_table *wait, unsigned long in, 439static inline void wait_key_set(poll_table *wait, unsigned long in,
440 unsigned long out, unsigned long bit, 440 unsigned long out, unsigned long bit,
@@ -814,11 +814,11 @@ static inline __poll_t do_pollfd(struct pollfd *pollfd, poll_table *pwait,
814 fd = pollfd->fd; 814 fd = pollfd->fd;
815 if (fd >= 0) { 815 if (fd >= 0) {
816 struct fd f = fdget(fd); 816 struct fd f = fdget(fd);
817 mask = POLLNVAL; 817 mask = EPOLLNVAL;
818 if (f.file) { 818 if (f.file) {
819 /* userland u16 ->events contains POLL... bitmap */ 819 /* userland u16 ->events contains POLL... bitmap */
820 __poll_t filter = demangle_poll(pollfd->events) | 820 __poll_t filter = demangle_poll(pollfd->events) |
821 POLLERR | POLLHUP; 821 EPOLLERR | EPOLLHUP;
822 mask = DEFAULT_POLLMASK; 822 mask = DEFAULT_POLLMASK;
823 if (f.file->f_op->poll) { 823 if (f.file->f_op->poll) {
824 pwait->_key = filter; 824 pwait->_key = filter;
diff --git a/fs/signalfd.c b/fs/signalfd.c
index 31e923bec99a..9990957264e3 100644
--- a/fs/signalfd.c
+++ b/fs/signalfd.c
@@ -45,7 +45,7 @@ void signalfd_cleanup(struct sighand_struct *sighand)
45 return; 45 return;
46 46
47 /* wait_queue_entry_t->func(POLLFREE) should do remove_wait_queue() */ 47 /* wait_queue_entry_t->func(POLLFREE) should do remove_wait_queue() */
48 wake_up_poll(wqh, POLLHUP | POLLFREE); 48 wake_up_poll(wqh, EPOLLHUP | POLLFREE);
49} 49}
50 50
51struct signalfd_ctx { 51struct signalfd_ctx {
@@ -69,7 +69,7 @@ static __poll_t signalfd_poll(struct file *file, poll_table *wait)
69 if (next_signal(&current->pending, &ctx->sigmask) || 69 if (next_signal(&current->pending, &ctx->sigmask) ||
70 next_signal(&current->signal->shared_pending, 70 next_signal(&current->signal->shared_pending,
71 &ctx->sigmask)) 71 &ctx->sigmask))
72 events |= POLLIN; 72 events |= EPOLLIN;
73 spin_unlock_irq(&current->sighand->siglock); 73 spin_unlock_irq(&current->sighand->siglock);
74 74
75 return events; 75 return events;
diff --git a/fs/timerfd.c b/fs/timerfd.c
index 0510717f3a53..cdad49da3ff7 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -237,7 +237,7 @@ static __poll_t timerfd_poll(struct file *file, poll_table *wait)
237 237
238 spin_lock_irqsave(&ctx->wqh.lock, flags); 238 spin_lock_irqsave(&ctx->wqh.lock, flags);
239 if (ctx->ticks) 239 if (ctx->ticks)
240 events |= POLLIN; 240 events |= EPOLLIN;
241 spin_unlock_irqrestore(&ctx->wqh.lock, flags); 241 spin_unlock_irqrestore(&ctx->wqh.lock, flags);
242 242
243 return events; 243 return events;
diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
index 87a13a7c8270..cec550c8468f 100644
--- a/fs/userfaultfd.c
+++ b/fs/userfaultfd.c
@@ -483,7 +483,7 @@ int handle_userfault(struct vm_fault *vmf, unsigned long reason)
483 if (likely(must_wait && !READ_ONCE(ctx->released) && 483 if (likely(must_wait && !READ_ONCE(ctx->released) &&
484 (return_to_userland ? !signal_pending(current) : 484 (return_to_userland ? !signal_pending(current) :
485 !fatal_signal_pending(current)))) { 485 !fatal_signal_pending(current)))) {
486 wake_up_poll(&ctx->fd_wqh, POLLIN); 486 wake_up_poll(&ctx->fd_wqh, EPOLLIN);
487 schedule(); 487 schedule();
488 ret |= VM_FAULT_MAJOR; 488 ret |= VM_FAULT_MAJOR;
489 489
@@ -614,7 +614,7 @@ static void userfaultfd_event_wait_completion(struct userfaultfd_ctx *ctx,
614 614
615 spin_unlock(&ctx->event_wqh.lock); 615 spin_unlock(&ctx->event_wqh.lock);
616 616
617 wake_up_poll(&ctx->fd_wqh, POLLIN); 617 wake_up_poll(&ctx->fd_wqh, EPOLLIN);
618 schedule(); 618 schedule();
619 619
620 spin_lock(&ctx->event_wqh.lock); 620 spin_lock(&ctx->event_wqh.lock);
@@ -904,7 +904,7 @@ wakeup:
904 /* Flush pending events that may still wait on event_wqh */ 904 /* Flush pending events that may still wait on event_wqh */
905 wake_up_all(&ctx->event_wqh); 905 wake_up_all(&ctx->event_wqh);
906 906
907 wake_up_poll(&ctx->fd_wqh, POLLHUP); 907 wake_up_poll(&ctx->fd_wqh, EPOLLHUP);
908 userfaultfd_ctx_put(ctx); 908 userfaultfd_ctx_put(ctx);
909 return 0; 909 return 0;
910} 910}
@@ -949,14 +949,14 @@ static __poll_t userfaultfd_poll(struct file *file, poll_table *wait)
949 949
950 switch (ctx->state) { 950 switch (ctx->state) {
951 case UFFD_STATE_WAIT_API: 951 case UFFD_STATE_WAIT_API:
952 return POLLERR; 952 return EPOLLERR;
953 case UFFD_STATE_RUNNING: 953 case UFFD_STATE_RUNNING:
954 /* 954 /*
955 * poll() never guarantees that read won't block. 955 * poll() never guarantees that read won't block.
956 * userfaults can be waken before they're read(). 956 * userfaults can be waken before they're read().
957 */ 957 */
958 if (unlikely(!(file->f_flags & O_NONBLOCK))) 958 if (unlikely(!(file->f_flags & O_NONBLOCK)))
959 return POLLERR; 959 return EPOLLERR;
960 /* 960 /*
961 * lockless access to see if there are pending faults 961 * lockless access to see if there are pending faults
962 * __pollwait last action is the add_wait_queue but 962 * __pollwait last action is the add_wait_queue but
@@ -970,14 +970,14 @@ static __poll_t userfaultfd_poll(struct file *file, poll_table *wait)
970 ret = 0; 970 ret = 0;
971 smp_mb(); 971 smp_mb();
972 if (waitqueue_active(&ctx->fault_pending_wqh)) 972 if (waitqueue_active(&ctx->fault_pending_wqh))
973 ret = POLLIN; 973 ret = EPOLLIN;
974 else if (waitqueue_active(&ctx->event_wqh)) 974 else if (waitqueue_active(&ctx->event_wqh))
975 ret = POLLIN; 975 ret = EPOLLIN;
976 976
977 return ret; 977 return ret;
978 default: 978 default:
979 WARN_ON_ONCE(1); 979 WARN_ON_ONCE(1);
980 return POLLERR; 980 return EPOLLERR;
981 } 981 }
982} 982}
983 983
diff --git a/include/linux/scif.h b/include/linux/scif.h
index 7046111b8d0a..eeb250b73c4b 100644
--- a/include/linux/scif.h
+++ b/include/linux/scif.h
@@ -1266,8 +1266,8 @@ int scif_put_pages(struct scif_range *pages);
1266 * events is a bitmask specifying the events which the application is 1266 * events is a bitmask specifying the events which the application is
1267 * interested in. The field revents is an output parameter, filled by the 1267 * interested in. The field revents is an output parameter, filled by the
1268 * kernel with the events that actually occurred. The bits returned in revents 1268 * kernel with the events that actually occurred. The bits returned in revents
1269 * can include any of those specified in events, or one of the values POLLERR, 1269 * can include any of those specified in events, or one of the values EPOLLERR,
1270 * POLLHUP, or POLLNVAL. (These three bits are meaningless in the events 1270 * EPOLLHUP, or EPOLLNVAL. (These three bits are meaningless in the events
1271 * field, and will be set in the revents field whenever the corresponding 1271 * field, and will be set in the revents field whenever the corresponding
1272 * condition is true.) 1272 * condition is true.)
1273 * 1273 *
@@ -1279,20 +1279,20 @@ int scif_put_pages(struct scif_range *pages);
1279 * timeout means an infinite timeout. 1279 * timeout means an infinite timeout.
1280 * 1280 *
1281 * The following bits may be set in events and returned in revents. 1281 * The following bits may be set in events and returned in revents.
1282 * POLLIN - Data may be received without blocking. For a connected 1282 * EPOLLIN - Data may be received without blocking. For a connected
1283 * endpoint, this means that scif_recv() may be called without blocking. For a 1283 * endpoint, this means that scif_recv() may be called without blocking. For a
1284 * listening endpoint, this means that scif_accept() may be called without 1284 * listening endpoint, this means that scif_accept() may be called without
1285 * blocking. 1285 * blocking.
1286 * POLLOUT - Data may be sent without blocking. For a connected endpoint, this 1286 * EPOLLOUT - Data may be sent without blocking. For a connected endpoint, this
1287 * means that scif_send() may be called without blocking. POLLOUT may also be 1287 * means that scif_send() may be called without blocking. EPOLLOUT may also be
1288 * used to block waiting for a non-blocking connect to complete. This bit value 1288 * used to block waiting for a non-blocking connect to complete. This bit value
1289 * has no meaning for a listening endpoint and is ignored if specified. 1289 * has no meaning for a listening endpoint and is ignored if specified.
1290 * 1290 *
1291 * The following bits are only returned in revents, and are ignored if set in 1291 * The following bits are only returned in revents, and are ignored if set in
1292 * events. 1292 * events.
1293 * POLLERR - An error occurred on the endpoint 1293 * EPOLLERR - An error occurred on the endpoint
1294 * POLLHUP - The connection to the peer endpoint was disconnected 1294 * EPOLLHUP - The connection to the peer endpoint was disconnected
1295 * POLLNVAL - The specified endpoint descriptor is invalid. 1295 * EPOLLNVAL - The specified endpoint descriptor is invalid.
1296 * 1296 *
1297 * Return: 1297 * Return:
1298 * Upon successful completion, scif_poll() returns a non-negative value. A 1298 * Upon successful completion, scif_poll() returns a non-negative value. A
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index aa16c064294f..5b6c541e4e1b 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -443,7 +443,7 @@ struct vb2_buf_ops {
443 * @fileio_read_once: report EOF after reading the first buffer 443 * @fileio_read_once: report EOF after reading the first buffer
444 * @fileio_write_immediately: queue buffer after each write() call 444 * @fileio_write_immediately: queue buffer after each write() call
445 * @allow_zero_bytesused: allow bytesused == 0 to be passed to the driver 445 * @allow_zero_bytesused: allow bytesused == 0 to be passed to the driver
446 * @quirk_poll_must_check_waiting_for_buffers: Return %POLLERR at poll when QBUF 446 * @quirk_poll_must_check_waiting_for_buffers: Return %EPOLLERR at poll when QBUF
447 * has not been called. This is a vb1 idiom that has been adopted 447 * has not been called. This is a vb1 idiom that has been adopted
448 * also by vb2. 448 * also by vb2.
449 * @lock: pointer to a mutex that protects the &struct vb2_queue. The 449 * @lock: pointer to a mutex that protects the &struct vb2_queue. The
@@ -493,7 +493,7 @@ struct vb2_buf_ops {
493 * @error: a fatal error occurred on the queue 493 * @error: a fatal error occurred on the queue
494 * @waiting_for_buffers: used in poll() to check if vb2 is still waiting for 494 * @waiting_for_buffers: used in poll() to check if vb2 is still waiting for
495 * buffers. Only set for capture queues if qbuf has not yet been 495 * buffers. Only set for capture queues if qbuf has not yet been
496 * called since poll() needs to return %POLLERR in that situation. 496 * called since poll() needs to return %EPOLLERR in that situation.
497 * @is_multiplanar: set if buffer type is multiplanar 497 * @is_multiplanar: set if buffer type is multiplanar
498 * @is_output: set if buffer type is output 498 * @is_output: set if buffer type is output
499 * @copy_timestamp: set if vb2-core should set timestamps 499 * @copy_timestamp: set if vb2-core should set timestamps
@@ -869,7 +869,7 @@ void vb2_core_queue_release(struct vb2_queue *q);
869 * @q: pointer to &struct vb2_queue with videobuf2 queue. 869 * @q: pointer to &struct vb2_queue with videobuf2 queue.
870 * 870 *
871 * Flag that a fatal unrecoverable error has occurred and wake up all processes 871 * Flag that a fatal unrecoverable error has occurred and wake up all processes
872 * waiting on the queue. Polling will now set %POLLERR and queuing and dequeuing 872 * waiting on the queue. Polling will now set %EPOLLERR and queuing and dequeuing
873 * buffers will return %-EIO. 873 * buffers will return %-EIO.
874 * 874 *
875 * The error flag will be cleared when canceling the queue, either from 875 * The error flag will be cleared when canceling the queue, either from
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
index 6692d67e9245..c1a93ce35e62 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -310,7 +310,7 @@ void inet_csk_prepare_forced_close(struct sock *sk);
310static inline __poll_t inet_csk_listen_poll(const struct sock *sk) 310static inline __poll_t inet_csk_listen_poll(const struct sock *sk)
311{ 311{
312 return !reqsk_queue_empty(&inet_csk(sk)->icsk_accept_queue) ? 312 return !reqsk_queue_empty(&inet_csk(sk)->icsk_accept_queue) ?
313 (POLLIN | POLLRDNORM) : 0; 313 (EPOLLIN | EPOLLRDNORM) : 0;
314} 314}
315 315
316int inet_csk_listen_start(struct sock *sk, int backlog); 316int inet_csk_listen_start(struct sock *sk, int backlog);
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 360e564ae7d1..d7f309f74dec 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -578,10 +578,10 @@ static __poll_t mqueue_poll_file(struct file *filp, struct poll_table_struct *po
578 578
579 spin_lock(&info->lock); 579 spin_lock(&info->lock);
580 if (info->attr.mq_curmsgs) 580 if (info->attr.mq_curmsgs)
581 retval = POLLIN | POLLRDNORM; 581 retval = EPOLLIN | EPOLLRDNORM;
582 582
583 if (info->attr.mq_curmsgs < info->attr.mq_maxmsg) 583 if (info->attr.mq_curmsgs < info->attr.mq_maxmsg)
584 retval |= POLLOUT | POLLWRNORM; 584 retval |= EPOLLOUT | EPOLLWRNORM;
585 spin_unlock(&info->lock); 585 spin_unlock(&info->lock);
586 586
587 return retval; 587 return retval;
diff --git a/kernel/events/core.c b/kernel/events/core.c
index f0549e79978b..96db9ae5d5af 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -4524,7 +4524,7 @@ static __poll_t perf_poll(struct file *file, poll_table *wait)
4524{ 4524{
4525 struct perf_event *event = file->private_data; 4525 struct perf_event *event = file->private_data;
4526 struct ring_buffer *rb; 4526 struct ring_buffer *rb;
4527 __poll_t events = POLLHUP; 4527 __poll_t events = EPOLLHUP;
4528 4528
4529 poll_wait(file, &event->waitq, wait); 4529 poll_wait(file, &event->waitq, wait);
4530 4530
diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c
index 141aa2ca8728..6c6b3c48db71 100644
--- a/kernel/events/ring_buffer.c
+++ b/kernel/events/ring_buffer.c
@@ -19,7 +19,7 @@
19 19
20static void perf_output_wakeup(struct perf_output_handle *handle) 20static void perf_output_wakeup(struct perf_output_handle *handle)
21{ 21{
22 atomic_set(&handle->rb->poll, POLLIN); 22 atomic_set(&handle->rb->poll, EPOLLIN);
23 23
24 handle->event->pending_wakeup = 1; 24 handle->event->pending_wakeup = 1;
25 irq_work_queue(&handle->event->pending); 25 irq_work_queue(&handle->event->pending);
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index db4b9b8929eb..fc1123583fa6 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -930,7 +930,7 @@ static __poll_t devkmsg_poll(struct file *file, poll_table *wait)
930 __poll_t ret = 0; 930 __poll_t ret = 0;
931 931
932 if (!user) 932 if (!user)
933 return POLLERR|POLLNVAL; 933 return EPOLLERR|EPOLLNVAL;
934 934
935 poll_wait(file, &log_wait, wait); 935 poll_wait(file, &log_wait, wait);
936 936
@@ -938,9 +938,9 @@ static __poll_t devkmsg_poll(struct file *file, poll_table *wait)
938 if (user->seq < log_next_seq) { 938 if (user->seq < log_next_seq) {
939 /* return error when data has vanished underneath us */ 939 /* return error when data has vanished underneath us */
940 if (user->seq < log_first_seq) 940 if (user->seq < log_first_seq)
941 ret = POLLIN|POLLRDNORM|POLLERR|POLLPRI; 941 ret = EPOLLIN|EPOLLRDNORM|EPOLLERR|EPOLLPRI;
942 else 942 else
943 ret = POLLIN|POLLRDNORM; 943 ret = EPOLLIN|EPOLLRDNORM;
944 } 944 }
945 logbuf_unlock_irq(); 945 logbuf_unlock_irq();
946 946
diff --git a/kernel/relay.c b/kernel/relay.c
index f7f40a6e6352..c3029402f15c 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -924,12 +924,12 @@ static __poll_t relay_file_poll(struct file *filp, poll_table *wait)
924 struct rchan_buf *buf = filp->private_data; 924 struct rchan_buf *buf = filp->private_data;
925 925
926 if (buf->finalized) 926 if (buf->finalized)
927 return POLLERR; 927 return EPOLLERR;
928 928
929 if (filp->f_mode & FMODE_READ) { 929 if (filp->f_mode & FMODE_READ) {
930 poll_wait(filp, &buf->read_wait, wait); 930 poll_wait(filp, &buf->read_wait, wait);
931 if (!relay_buf_empty(buf)) 931 if (!relay_buf_empty(buf))
932 mask |= POLLIN | POLLRDNORM; 932 mask |= EPOLLIN | EPOLLRDNORM;
933 } 933 }
934 934
935 return mask; 935 return mask;
diff --git a/kernel/time/posix-clock.c b/kernel/time/posix-clock.c
index 94ad46d50b56..fe56c4e06c51 100644
--- a/kernel/time/posix-clock.c
+++ b/kernel/time/posix-clock.c
@@ -74,7 +74,7 @@ static __poll_t posix_clock_poll(struct file *fp, poll_table *wait)
74 __poll_t result = 0; 74 __poll_t result = 0;
75 75
76 if (!clk) 76 if (!clk)
77 return POLLERR; 77 return EPOLLERR;
78 78
79 if (clk->ops.poll) 79 if (clk->ops.poll)
80 result = clk->ops.poll(clk, fp, wait); 80 result = clk->ops.poll(clk, fp, wait);
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index ca6930e0d25e..dcf1c4dd3efe 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -627,7 +627,7 @@ int ring_buffer_wait(struct ring_buffer *buffer, int cpu, bool full)
627 * as data is added to any of the @buffer's cpu buffers. Otherwise 627 * as data is added to any of the @buffer's cpu buffers. Otherwise
628 * it will wait for data to be added to a specific cpu buffer. 628 * it will wait for data to be added to a specific cpu buffer.
629 * 629 *
630 * Returns POLLIN | POLLRDNORM if data exists in the buffers, 630 * Returns EPOLLIN | EPOLLRDNORM if data exists in the buffers,
631 * zero otherwise. 631 * zero otherwise.
632 */ 632 */
633__poll_t ring_buffer_poll_wait(struct ring_buffer *buffer, int cpu, 633__poll_t ring_buffer_poll_wait(struct ring_buffer *buffer, int cpu,
@@ -665,7 +665,7 @@ __poll_t ring_buffer_poll_wait(struct ring_buffer *buffer, int cpu,
665 665
666 if ((cpu == RING_BUFFER_ALL_CPUS && !ring_buffer_empty(buffer)) || 666 if ((cpu == RING_BUFFER_ALL_CPUS && !ring_buffer_empty(buffer)) ||
667 (cpu != RING_BUFFER_ALL_CPUS && !ring_buffer_empty_cpu(buffer, cpu))) 667 (cpu != RING_BUFFER_ALL_CPUS && !ring_buffer_empty_cpu(buffer, cpu)))
668 return POLLIN | POLLRDNORM; 668 return EPOLLIN | EPOLLRDNORM;
669 return 0; 669 return 0;
670} 670}
671 671
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 56608538a4ad..20a2300ae4e8 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -5623,13 +5623,13 @@ trace_poll(struct trace_iterator *iter, struct file *filp, poll_table *poll_tabl
5623 5623
5624 /* Iterators are static, they should be filled or empty */ 5624 /* Iterators are static, they should be filled or empty */
5625 if (trace_buffer_iter(iter, iter->cpu_file)) 5625 if (trace_buffer_iter(iter, iter->cpu_file))
5626 return POLLIN | POLLRDNORM; 5626 return EPOLLIN | EPOLLRDNORM;
5627 5627
5628 if (tr->trace_flags & TRACE_ITER_BLOCK) 5628 if (tr->trace_flags & TRACE_ITER_BLOCK)
5629 /* 5629 /*
5630 * Always select as readable when in blocking mode 5630 * Always select as readable when in blocking mode
5631 */ 5631 */
5632 return POLLIN | POLLRDNORM; 5632 return EPOLLIN | EPOLLRDNORM;
5633 else 5633 else
5634 return ring_buffer_poll_wait(iter->trace_buffer->buffer, iter->cpu_file, 5634 return ring_buffer_poll_wait(iter->trace_buffer->buffer, iter->cpu_file,
5635 filp, poll_table); 5635 filp, poll_table);
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 13b35ffa021e..670e99b68aa6 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3688,7 +3688,7 @@ static void memcg_event_remove(struct work_struct *work)
3688} 3688}
3689 3689
3690/* 3690/*
3691 * Gets called on POLLHUP on eventfd when user closes it. 3691 * Gets called on EPOLLHUP on eventfd when user closes it.
3692 * 3692 *
3693 * Called with wqh->lock held and interrupts disabled. 3693 * Called with wqh->lock held and interrupts disabled.
3694 */ 3694 */
@@ -3700,7 +3700,7 @@ static int memcg_event_wake(wait_queue_entry_t *wait, unsigned mode,
3700 struct mem_cgroup *memcg = event->memcg; 3700 struct mem_cgroup *memcg = event->memcg;
3701 __poll_t flags = key_to_poll(key); 3701 __poll_t flags = key_to_poll(key);
3702 3702
3703 if (flags & POLLHUP) { 3703 if (flags & EPOLLHUP) {
3704 /* 3704 /*
3705 * If the event has been detached at cgroup removal, we 3705 * If the event has been detached at cgroup removal, we
3706 * can simply return knowing the other side will cleanup 3706 * can simply return knowing the other side will cleanup
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 42fe5653814a..c7a33717d079 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2705,10 +2705,10 @@ static __poll_t swaps_poll(struct file *file, poll_table *wait)
2705 2705
2706 if (seq->poll_event != atomic_read(&proc_poll_event)) { 2706 if (seq->poll_event != atomic_read(&proc_poll_event)) {
2707 seq->poll_event = atomic_read(&proc_poll_event); 2707 seq->poll_event = atomic_read(&proc_poll_event);
2708 return POLLIN | POLLRDNORM | POLLERR | POLLPRI; 2708 return EPOLLIN | EPOLLRDNORM | EPOLLERR | EPOLLPRI;
2709 } 2709 }
2710 2710
2711 return POLLIN | POLLRDNORM; 2711 return EPOLLIN | EPOLLRDNORM;
2712} 2712}
2713 2713
2714/* iterator */ 2714/* iterator */
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index d6f7f7cb79c4..0cfba919d167 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -240,7 +240,7 @@ p9_fd_poll(struct p9_client *client, struct poll_table_struct *pt, int *err)
240 if (!ts) { 240 if (!ts) {
241 if (err) 241 if (err)
242 *err = -EREMOTEIO; 242 *err = -EREMOTEIO;
243 return POLLERR; 243 return EPOLLERR;
244 } 244 }
245 245
246 if (!ts->rd->f_op->poll) 246 if (!ts->rd->f_op->poll)
@@ -253,7 +253,7 @@ p9_fd_poll(struct p9_client *client, struct poll_table_struct *pt, int *err)
253 n = DEFAULT_POLLMASK; 253 n = DEFAULT_POLLMASK;
254 else 254 else
255 n = ts->wr->f_op->poll(ts->wr, pt); 255 n = ts->wr->f_op->poll(ts->wr, pt);
256 ret = (ret & ~POLLOUT) | (n & ~POLLIN); 256 ret = (ret & ~EPOLLOUT) | (n & ~EPOLLIN);
257 } 257 }
258 258
259 return ret; 259 return ret;
@@ -396,11 +396,11 @@ end_clear:
396 396
397 if (!list_empty(&m->req_list)) { 397 if (!list_empty(&m->req_list)) {
398 if (test_and_clear_bit(Rpending, &m->wsched)) 398 if (test_and_clear_bit(Rpending, &m->wsched))
399 n = POLLIN; 399 n = EPOLLIN;
400 else 400 else
401 n = p9_fd_poll(m->client, NULL, NULL); 401 n = p9_fd_poll(m->client, NULL, NULL);
402 402
403 if ((n & POLLIN) && !test_and_set_bit(Rworksched, &m->wsched)) { 403 if ((n & EPOLLIN) && !test_and_set_bit(Rworksched, &m->wsched)) {
404 p9_debug(P9_DEBUG_TRANS, "sched read work %p\n", m); 404 p9_debug(P9_DEBUG_TRANS, "sched read work %p\n", m);
405 schedule_work(&m->rq); 405 schedule_work(&m->rq);
406 } 406 }
@@ -505,11 +505,11 @@ end_clear:
505 505
506 if (m->wsize || !list_empty(&m->unsent_req_list)) { 506 if (m->wsize || !list_empty(&m->unsent_req_list)) {
507 if (test_and_clear_bit(Wpending, &m->wsched)) 507 if (test_and_clear_bit(Wpending, &m->wsched))
508 n = POLLOUT; 508 n = EPOLLOUT;
509 else 509 else
510 n = p9_fd_poll(m->client, NULL, NULL); 510 n = p9_fd_poll(m->client, NULL, NULL);
511 511
512 if ((n & POLLOUT) && 512 if ((n & EPOLLOUT) &&
513 !test_and_set_bit(Wworksched, &m->wsched)) { 513 !test_and_set_bit(Wworksched, &m->wsched)) {
514 p9_debug(P9_DEBUG_TRANS, "sched write work %p\n", m); 514 p9_debug(P9_DEBUG_TRANS, "sched write work %p\n", m);
515 schedule_work(&m->wq); 515 schedule_work(&m->wq);
@@ -599,12 +599,12 @@ static void p9_conn_create(struct p9_client *client)
599 init_poll_funcptr(&m->pt, p9_pollwait); 599 init_poll_funcptr(&m->pt, p9_pollwait);
600 600
601 n = p9_fd_poll(client, &m->pt, NULL); 601 n = p9_fd_poll(client, &m->pt, NULL);
602 if (n & POLLIN) { 602 if (n & EPOLLIN) {
603 p9_debug(P9_DEBUG_TRANS, "mux %p can read\n", m); 603 p9_debug(P9_DEBUG_TRANS, "mux %p can read\n", m);
604 set_bit(Rpending, &m->wsched); 604 set_bit(Rpending, &m->wsched);
605 } 605 }
606 606
607 if (n & POLLOUT) { 607 if (n & EPOLLOUT) {
608 p9_debug(P9_DEBUG_TRANS, "mux %p can write\n", m); 608 p9_debug(P9_DEBUG_TRANS, "mux %p can write\n", m);
609 set_bit(Wpending, &m->wsched); 609 set_bit(Wpending, &m->wsched);
610 } 610 }
@@ -625,12 +625,12 @@ static void p9_poll_mux(struct p9_conn *m)
625 return; 625 return;
626 626
627 n = p9_fd_poll(m->client, NULL, &err); 627 n = p9_fd_poll(m->client, NULL, &err);
628 if (n & (POLLERR | POLLHUP | POLLNVAL)) { 628 if (n & (EPOLLERR | EPOLLHUP | EPOLLNVAL)) {
629 p9_debug(P9_DEBUG_TRANS, "error mux %p err %d\n", m, n); 629 p9_debug(P9_DEBUG_TRANS, "error mux %p err %d\n", m, n);
630 p9_conn_cancel(m, err); 630 p9_conn_cancel(m, err);
631 } 631 }
632 632
633 if (n & POLLIN) { 633 if (n & EPOLLIN) {
634 set_bit(Rpending, &m->wsched); 634 set_bit(Rpending, &m->wsched);
635 p9_debug(P9_DEBUG_TRANS, "mux %p can read\n", m); 635 p9_debug(P9_DEBUG_TRANS, "mux %p can read\n", m);
636 if (!test_and_set_bit(Rworksched, &m->wsched)) { 636 if (!test_and_set_bit(Rworksched, &m->wsched)) {
@@ -639,7 +639,7 @@ static void p9_poll_mux(struct p9_conn *m)
639 } 639 }
640 } 640 }
641 641
642 if (n & POLLOUT) { 642 if (n & EPOLLOUT) {
643 set_bit(Wpending, &m->wsched); 643 set_bit(Wpending, &m->wsched);
644 p9_debug(P9_DEBUG_TRANS, "mux %p can write\n", m); 644 p9_debug(P9_DEBUG_TRANS, "mux %p can write\n", m);
645 if ((m->wsize || !list_empty(&m->unsent_req_list)) && 645 if ((m->wsize || !list_empty(&m->unsent_req_list)) &&
@@ -678,11 +678,11 @@ static int p9_fd_request(struct p9_client *client, struct p9_req_t *req)
678 spin_unlock(&client->lock); 678 spin_unlock(&client->lock);
679 679
680 if (test_and_clear_bit(Wpending, &m->wsched)) 680 if (test_and_clear_bit(Wpending, &m->wsched))
681 n = POLLOUT; 681 n = EPOLLOUT;
682 else 682 else
683 n = p9_fd_poll(m->client, NULL, NULL); 683 n = p9_fd_poll(m->client, NULL, NULL);
684 684
685 if (n & POLLOUT && !test_and_set_bit(Wworksched, &m->wsched)) 685 if (n & EPOLLOUT && !test_and_set_bit(Wworksched, &m->wsched))
686 schedule_work(&m->wq); 686 schedule_work(&m->wq);
687 687
688 return 0; 688 return 0;
diff --git a/net/atm/common.c b/net/atm/common.c
index 6523f38c4957..fc78a0508ae1 100644
--- a/net/atm/common.c
+++ b/net/atm/common.c
@@ -661,15 +661,15 @@ __poll_t vcc_poll(struct file *file, struct socket *sock, poll_table *wait)
661 661
662 /* exceptional events */ 662 /* exceptional events */
663 if (sk->sk_err) 663 if (sk->sk_err)
664 mask = POLLERR; 664 mask = EPOLLERR;
665 665
666 if (test_bit(ATM_VF_RELEASED, &vcc->flags) || 666 if (test_bit(ATM_VF_RELEASED, &vcc->flags) ||
667 test_bit(ATM_VF_CLOSE, &vcc->flags)) 667 test_bit(ATM_VF_CLOSE, &vcc->flags))
668 mask |= POLLHUP; 668 mask |= EPOLLHUP;
669 669
670 /* readable? */ 670 /* readable? */
671 if (!skb_queue_empty(&sk->sk_receive_queue)) 671 if (!skb_queue_empty(&sk->sk_receive_queue))
672 mask |= POLLIN | POLLRDNORM; 672 mask |= EPOLLIN | EPOLLRDNORM;
673 673
674 /* writable? */ 674 /* writable? */
675 if (sock->state == SS_CONNECTING && 675 if (sock->state == SS_CONNECTING &&
@@ -678,7 +678,7 @@ __poll_t vcc_poll(struct file *file, struct socket *sock, poll_table *wait)
678 678
679 if (vcc->qos.txtp.traffic_class != ATM_NONE && 679 if (vcc->qos.txtp.traffic_class != ATM_NONE &&
680 vcc_writable(sk)) 680 vcc_writable(sk))
681 mask |= POLLOUT | POLLWRNORM | POLLWRBAND; 681 mask |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
682 682
683 return mask; 683 return mask;
684} 684}
diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c
index 581375d0eed2..e91f29c7c638 100644
--- a/net/batman-adv/icmp_socket.c
+++ b/net/batman-adv/icmp_socket.c
@@ -304,7 +304,7 @@ static __poll_t batadv_socket_poll(struct file *file, poll_table *wait)
304 poll_wait(file, &socket_client->queue_wait, wait); 304 poll_wait(file, &socket_client->queue_wait, wait);
305 305
306 if (socket_client->queue_len > 0) 306 if (socket_client->queue_len > 0)
307 return POLLIN | POLLRDNORM; 307 return EPOLLIN | EPOLLRDNORM;
308 308
309 return 0; 309 return 0;
310} 310}
diff --git a/net/batman-adv/log.c b/net/batman-adv/log.c
index 9be74a44e99d..dc9fa37ddd14 100644
--- a/net/batman-adv/log.c
+++ b/net/batman-adv/log.c
@@ -193,7 +193,7 @@ static __poll_t batadv_log_poll(struct file *file, poll_table *wait)
193 poll_wait(file, &debug_log->queue_wait, wait); 193 poll_wait(file, &debug_log->queue_wait, wait);
194 194
195 if (!batadv_log_empty(debug_log)) 195 if (!batadv_log_empty(debug_log))
196 return POLLIN | POLLRDNORM; 196 return EPOLLIN | EPOLLRDNORM;
197 197
198 return 0; 198 return 0;
199} 199}
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
index f897681780db..84d92a077834 100644
--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
@@ -431,7 +431,7 @@ static inline __poll_t bt_accept_poll(struct sock *parent)
431 if (sk->sk_state == BT_CONNECTED || 431 if (sk->sk_state == BT_CONNECTED ||
432 (test_bit(BT_SK_DEFER_SETUP, &bt_sk(parent)->flags) && 432 (test_bit(BT_SK_DEFER_SETUP, &bt_sk(parent)->flags) &&
433 sk->sk_state == BT_CONNECT2)) 433 sk->sk_state == BT_CONNECT2))
434 return POLLIN | POLLRDNORM; 434 return EPOLLIN | EPOLLRDNORM;
435 } 435 }
436 436
437 return 0; 437 return 0;
@@ -451,20 +451,20 @@ __poll_t bt_sock_poll(struct file *file, struct socket *sock,
451 return bt_accept_poll(sk); 451 return bt_accept_poll(sk);
452 452
453 if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) 453 if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue))
454 mask |= POLLERR | 454 mask |= EPOLLERR |
455 (sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? POLLPRI : 0); 455 (sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? EPOLLPRI : 0);
456 456
457 if (sk->sk_shutdown & RCV_SHUTDOWN) 457 if (sk->sk_shutdown & RCV_SHUTDOWN)
458 mask |= POLLRDHUP | POLLIN | POLLRDNORM; 458 mask |= EPOLLRDHUP | EPOLLIN | EPOLLRDNORM;
459 459
460 if (sk->sk_shutdown == SHUTDOWN_MASK) 460 if (sk->sk_shutdown == SHUTDOWN_MASK)
461 mask |= POLLHUP; 461 mask |= EPOLLHUP;
462 462
463 if (!skb_queue_empty(&sk->sk_receive_queue)) 463 if (!skb_queue_empty(&sk->sk_receive_queue))
464 mask |= POLLIN | POLLRDNORM; 464 mask |= EPOLLIN | EPOLLRDNORM;
465 465
466 if (sk->sk_state == BT_CLOSED) 466 if (sk->sk_state == BT_CLOSED)
467 mask |= POLLHUP; 467 mask |= EPOLLHUP;
468 468
469 if (sk->sk_state == BT_CONNECT || 469 if (sk->sk_state == BT_CONNECT ||
470 sk->sk_state == BT_CONNECT2 || 470 sk->sk_state == BT_CONNECT2 ||
@@ -472,7 +472,7 @@ __poll_t bt_sock_poll(struct file *file, struct socket *sock,
472 return mask; 472 return mask;
473 473
474 if (!test_bit(BT_SK_SUSPEND, &bt_sk(sk)->flags) && sock_writeable(sk)) 474 if (!test_bit(BT_SK_SUSPEND, &bt_sk(sk)->flags) && sock_writeable(sk))
475 mask |= POLLOUT | POLLWRNORM | POLLWRBAND; 475 mask |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
476 else 476 else
477 sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk); 477 sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk);
478 478
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c
index b109445a1df9..a6fb1b3bcad9 100644
--- a/net/caif/caif_socket.c
+++ b/net/caif/caif_socket.c
@@ -924,7 +924,7 @@ static int caif_release(struct socket *sock)
924 924
925 caif_disconnect_client(sock_net(sk), &cf_sk->layer); 925 caif_disconnect_client(sock_net(sk), &cf_sk->layer);
926 cf_sk->sk.sk_socket->state = SS_DISCONNECTING; 926 cf_sk->sk.sk_socket->state = SS_DISCONNECTING;
927 wake_up_interruptible_poll(sk_sleep(sk), POLLERR|POLLHUP); 927 wake_up_interruptible_poll(sk_sleep(sk), EPOLLERR|EPOLLHUP);
928 928
929 sock_orphan(sk); 929 sock_orphan(sk);
930 sk_stream_kill_queues(&cf_sk->sk); 930 sk_stream_kill_queues(&cf_sk->sk);
@@ -946,23 +946,23 @@ static __poll_t caif_poll(struct file *file,
946 946
947 /* exceptional events? */ 947 /* exceptional events? */
948 if (sk->sk_err) 948 if (sk->sk_err)
949 mask |= POLLERR; 949 mask |= EPOLLERR;
950 if (sk->sk_shutdown == SHUTDOWN_MASK) 950 if (sk->sk_shutdown == SHUTDOWN_MASK)
951 mask |= POLLHUP; 951 mask |= EPOLLHUP;
952 if (sk->sk_shutdown & RCV_SHUTDOWN) 952 if (sk->sk_shutdown & RCV_SHUTDOWN)
953 mask |= POLLRDHUP; 953 mask |= EPOLLRDHUP;
954 954
955 /* readable? */ 955 /* readable? */
956 if (!skb_queue_empty(&sk->sk_receive_queue) || 956 if (!skb_queue_empty(&sk->sk_receive_queue) ||
957 (sk->sk_shutdown & RCV_SHUTDOWN)) 957 (sk->sk_shutdown & RCV_SHUTDOWN))
958 mask |= POLLIN | POLLRDNORM; 958 mask |= EPOLLIN | EPOLLRDNORM;
959 959
960 /* 960 /*
961 * we set writable also when the other side has shut down the 961 * we set writable also when the other side has shut down the
962 * connection. This prevents stuck sockets. 962 * connection. This prevents stuck sockets.
963 */ 963 */
964 if (sock_writeable(sk) && tx_flow_is_on(cf_sk)) 964 if (sock_writeable(sk) && tx_flow_is_on(cf_sk))
965 mask |= POLLOUT | POLLWRNORM | POLLWRBAND; 965 mask |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
966 966
967 return mask; 967 return mask;
968} 968}
diff --git a/net/core/datagram.c b/net/core/datagram.c
index b7d9293940b5..9938952c5c78 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -75,7 +75,7 @@ static int receiver_wake_function(wait_queue_entry_t *wait, unsigned int mode, i
75 /* 75 /*
76 * Avoid a wakeup if event not interesting for us 76 * Avoid a wakeup if event not interesting for us
77 */ 77 */
78 if (key && !(key_to_poll(key) & (POLLIN | POLLERR))) 78 if (key && !(key_to_poll(key) & (EPOLLIN | EPOLLERR)))
79 return 0; 79 return 0;
80 return autoremove_wake_function(wait, mode, sync, key); 80 return autoremove_wake_function(wait, mode, sync, key);
81} 81}
@@ -842,22 +842,22 @@ __poll_t datagram_poll(struct file *file, struct socket *sock,
842 842
843 /* exceptional events? */ 843 /* exceptional events? */
844 if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) 844 if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue))
845 mask |= POLLERR | 845 mask |= EPOLLERR |
846 (sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? POLLPRI : 0); 846 (sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? EPOLLPRI : 0);
847 847
848 if (sk->sk_shutdown & RCV_SHUTDOWN) 848 if (sk->sk_shutdown & RCV_SHUTDOWN)
849 mask |= POLLRDHUP | POLLIN | POLLRDNORM; 849 mask |= EPOLLRDHUP | EPOLLIN | EPOLLRDNORM;
850 if (sk->sk_shutdown == SHUTDOWN_MASK) 850 if (sk->sk_shutdown == SHUTDOWN_MASK)
851 mask |= POLLHUP; 851 mask |= EPOLLHUP;
852 852
853 /* readable? */ 853 /* readable? */
854 if (!skb_queue_empty(&sk->sk_receive_queue)) 854 if (!skb_queue_empty(&sk->sk_receive_queue))
855 mask |= POLLIN | POLLRDNORM; 855 mask |= EPOLLIN | EPOLLRDNORM;
856 856
857 /* Connection-based need to check for termination and startup */ 857 /* Connection-based need to check for termination and startup */
858 if (connection_based(sk)) { 858 if (connection_based(sk)) {
859 if (sk->sk_state == TCP_CLOSE) 859 if (sk->sk_state == TCP_CLOSE)
860 mask |= POLLHUP; 860 mask |= EPOLLHUP;
861 /* connection hasn't started yet? */ 861 /* connection hasn't started yet? */
862 if (sk->sk_state == TCP_SYN_SENT) 862 if (sk->sk_state == TCP_SYN_SENT)
863 return mask; 863 return mask;
@@ -865,7 +865,7 @@ __poll_t datagram_poll(struct file *file, struct socket *sock,
865 865
866 /* writable? */ 866 /* writable? */
867 if (sock_writeable(sk)) 867 if (sock_writeable(sk))
868 mask |= POLLOUT | POLLWRNORM | POLLWRBAND; 868 mask |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
869 else 869 else
870 sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk); 870 sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk);
871 871
diff --git a/net/core/sock.c b/net/core/sock.c
index b026e1717df4..c501499a04fe 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2619,7 +2619,7 @@ static void sock_def_error_report(struct sock *sk)
2619 rcu_read_lock(); 2619 rcu_read_lock();
2620 wq = rcu_dereference(sk->sk_wq); 2620 wq = rcu_dereference(sk->sk_wq);
2621 if (skwq_has_sleeper(wq)) 2621 if (skwq_has_sleeper(wq))
2622 wake_up_interruptible_poll(&wq->wait, POLLERR); 2622 wake_up_interruptible_poll(&wq->wait, EPOLLERR);
2623 sk_wake_async(sk, SOCK_WAKE_IO, POLL_ERR); 2623 sk_wake_async(sk, SOCK_WAKE_IO, POLL_ERR);
2624 rcu_read_unlock(); 2624 rcu_read_unlock();
2625} 2625}
@@ -2631,8 +2631,8 @@ static void sock_def_readable(struct sock *sk)
2631 rcu_read_lock(); 2631 rcu_read_lock();
2632 wq = rcu_dereference(sk->sk_wq); 2632 wq = rcu_dereference(sk->sk_wq);
2633 if (skwq_has_sleeper(wq)) 2633 if (skwq_has_sleeper(wq))
2634 wake_up_interruptible_sync_poll(&wq->wait, POLLIN | POLLPRI | 2634 wake_up_interruptible_sync_poll(&wq->wait, EPOLLIN | EPOLLPRI |
2635 POLLRDNORM | POLLRDBAND); 2635 EPOLLRDNORM | EPOLLRDBAND);
2636 sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN); 2636 sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN);
2637 rcu_read_unlock(); 2637 rcu_read_unlock();
2638} 2638}
@@ -2649,8 +2649,8 @@ static void sock_def_write_space(struct sock *sk)
2649 if ((refcount_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf) { 2649 if ((refcount_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf) {
2650 wq = rcu_dereference(sk->sk_wq); 2650 wq = rcu_dereference(sk->sk_wq);
2651 if (skwq_has_sleeper(wq)) 2651 if (skwq_has_sleeper(wq))
2652 wake_up_interruptible_sync_poll(&wq->wait, POLLOUT | 2652 wake_up_interruptible_sync_poll(&wq->wait, EPOLLOUT |
2653 POLLWRNORM | POLLWRBAND); 2653 EPOLLWRNORM | EPOLLWRBAND);
2654 2654
2655 /* Should agree with poll, otherwise some programs break */ 2655 /* Should agree with poll, otherwise some programs break */
2656 if (sock_writeable(sk)) 2656 if (sock_writeable(sk))
diff --git a/net/core/stream.c b/net/core/stream.c
index 1cff9c6270c6..7d329fb1f553 100644
--- a/net/core/stream.c
+++ b/net/core/stream.c
@@ -38,8 +38,8 @@ void sk_stream_write_space(struct sock *sk)
38 rcu_read_lock(); 38 rcu_read_lock();
39 wq = rcu_dereference(sk->sk_wq); 39 wq = rcu_dereference(sk->sk_wq);
40 if (skwq_has_sleeper(wq)) 40 if (skwq_has_sleeper(wq))
41 wake_up_interruptible_poll(&wq->wait, POLLOUT | 41 wake_up_interruptible_poll(&wq->wait, EPOLLOUT |
42 POLLWRNORM | POLLWRBAND); 42 EPOLLWRNORM | EPOLLWRBAND);
43 if (wq && wq->fasync_list && !(sk->sk_shutdown & SEND_SHUTDOWN)) 43 if (wq && wq->fasync_list && !(sk->sk_shutdown & SEND_SHUTDOWN))
44 sock_wake_async(wq, SOCK_WAKE_SPACE, POLL_OUT); 44 sock_wake_async(wq, SOCK_WAKE_SPACE, POLL_OUT);
45 rcu_read_unlock(); 45 rcu_read_unlock();
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 74685fecfdb9..15bdc002d90c 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -338,21 +338,21 @@ __poll_t dccp_poll(struct file *file, struct socket *sock,
338 338
339 mask = 0; 339 mask = 0;
340 if (sk->sk_err) 340 if (sk->sk_err)
341 mask = POLLERR; 341 mask = EPOLLERR;
342 342
343 if (sk->sk_shutdown == SHUTDOWN_MASK || sk->sk_state == DCCP_CLOSED) 343 if (sk->sk_shutdown == SHUTDOWN_MASK || sk->sk_state == DCCP_CLOSED)
344 mask |= POLLHUP; 344 mask |= EPOLLHUP;
345 if (sk->sk_shutdown & RCV_SHUTDOWN) 345 if (sk->sk_shutdown & RCV_SHUTDOWN)
346 mask |= POLLIN | POLLRDNORM | POLLRDHUP; 346 mask |= EPOLLIN | EPOLLRDNORM | EPOLLRDHUP;
347 347
348 /* Connected? */ 348 /* Connected? */
349 if ((1 << sk->sk_state) & ~(DCCPF_REQUESTING | DCCPF_RESPOND)) { 349 if ((1 << sk->sk_state) & ~(DCCPF_REQUESTING | DCCPF_RESPOND)) {
350 if (atomic_read(&sk->sk_rmem_alloc) > 0) 350 if (atomic_read(&sk->sk_rmem_alloc) > 0)
351 mask |= POLLIN | POLLRDNORM; 351 mask |= EPOLLIN | EPOLLRDNORM;
352 352
353 if (!(sk->sk_shutdown & SEND_SHUTDOWN)) { 353 if (!(sk->sk_shutdown & SEND_SHUTDOWN)) {
354 if (sk_stream_is_writeable(sk)) { 354 if (sk_stream_is_writeable(sk)) {
355 mask |= POLLOUT | POLLWRNORM; 355 mask |= EPOLLOUT | EPOLLWRNORM;
356 } else { /* send SIGIO later */ 356 } else { /* send SIGIO later */
357 sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk); 357 sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk);
358 set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); 358 set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
@@ -362,7 +362,7 @@ __poll_t dccp_poll(struct file *file, struct socket *sock,
362 * IO signal will be lost. 362 * IO signal will be lost.
363 */ 363 */
364 if (sk_stream_is_writeable(sk)) 364 if (sk_stream_is_writeable(sk))
365 mask |= POLLOUT | POLLWRNORM; 365 mask |= EPOLLOUT | EPOLLWRNORM;
366 } 366 }
367 } 367 }
368 } 368 }
diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c
index cc1b505453a8..91dd09f79808 100644
--- a/net/decnet/af_decnet.c
+++ b/net/decnet/af_decnet.c
@@ -1216,7 +1216,7 @@ static __poll_t dn_poll(struct file *file, struct socket *sock, poll_table *wai
1216 __poll_t mask = datagram_poll(file, sock, wait); 1216 __poll_t mask = datagram_poll(file, sock, wait);
1217 1217
1218 if (!skb_queue_empty(&scp->other_receive_queue)) 1218 if (!skb_queue_empty(&scp->other_receive_queue))
1219 mask |= POLLRDBAND; 1219 mask |= EPOLLRDBAND;
1220 1220
1221 return mask; 1221 return mask;
1222} 1222}
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index c24008daa3d8..e4329e161943 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -828,7 +828,7 @@ int inet_shutdown(struct socket *sock, int how)
828 case TCP_CLOSE: 828 case TCP_CLOSE:
829 err = -ENOTCONN; 829 err = -ENOTCONN;
830 /* Hack to wake up other listeners, who can poll for 830 /* Hack to wake up other listeners, who can poll for
831 POLLHUP, even on eg. unconnected UDP sockets -- RR */ 831 EPOLLHUP, even on eg. unconnected UDP sockets -- RR */
832 /* fall through */ 832 /* fall through */
833 default: 833 default:
834 sk->sk_shutdown |= how; 834 sk->sk_shutdown |= how;
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index c059aa7df0a9..48636aee23c3 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -512,36 +512,36 @@ __poll_t tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
512 mask = 0; 512 mask = 0;
513 513
514 /* 514 /*
515 * POLLHUP is certainly not done right. But poll() doesn't 515 * EPOLLHUP is certainly not done right. But poll() doesn't
516 * have a notion of HUP in just one direction, and for a 516 * have a notion of HUP in just one direction, and for a
517 * socket the read side is more interesting. 517 * socket the read side is more interesting.
518 * 518 *
519 * Some poll() documentation says that POLLHUP is incompatible 519 * Some poll() documentation says that EPOLLHUP is incompatible
520 * with the POLLOUT/POLLWR flags, so somebody should check this 520 * with the EPOLLOUT/POLLWR flags, so somebody should check this
521 * all. But careful, it tends to be safer to return too many 521 * all. But careful, it tends to be safer to return too many
522 * bits than too few, and you can easily break real applications 522 * bits than too few, and you can easily break real applications
523 * if you don't tell them that something has hung up! 523 * if you don't tell them that something has hung up!
524 * 524 *
525 * Check-me. 525 * Check-me.
526 * 526 *
527 * Check number 1. POLLHUP is _UNMASKABLE_ event (see UNIX98 and 527 * Check number 1. EPOLLHUP is _UNMASKABLE_ event (see UNIX98 and
528 * our fs/select.c). It means that after we received EOF, 528 * our fs/select.c). It means that after we received EOF,
529 * poll always returns immediately, making impossible poll() on write() 529 * poll always returns immediately, making impossible poll() on write()
530 * in state CLOSE_WAIT. One solution is evident --- to set POLLHUP 530 * in state CLOSE_WAIT. One solution is evident --- to set EPOLLHUP
531 * if and only if shutdown has been made in both directions. 531 * if and only if shutdown has been made in both directions.
532 * Actually, it is interesting to look how Solaris and DUX 532 * Actually, it is interesting to look how Solaris and DUX
533 * solve this dilemma. I would prefer, if POLLHUP were maskable, 533 * solve this dilemma. I would prefer, if EPOLLHUP were maskable,
534 * then we could set it on SND_SHUTDOWN. BTW examples given 534 * then we could set it on SND_SHUTDOWN. BTW examples given
535 * in Stevens' books assume exactly this behaviour, it explains 535 * in Stevens' books assume exactly this behaviour, it explains
536 * why POLLHUP is incompatible with POLLOUT. --ANK 536 * why EPOLLHUP is incompatible with EPOLLOUT. --ANK
537 * 537 *
538 * NOTE. Check for TCP_CLOSE is added. The goal is to prevent 538 * NOTE. Check for TCP_CLOSE is added. The goal is to prevent
539 * blocking on fresh not-connected or disconnected socket. --ANK 539 * blocking on fresh not-connected or disconnected socket. --ANK
540 */ 540 */
541 if (sk->sk_shutdown == SHUTDOWN_MASK || state == TCP_CLOSE) 541 if (sk->sk_shutdown == SHUTDOWN_MASK || state == TCP_CLOSE)
542 mask |= POLLHUP; 542 mask |= EPOLLHUP;
543 if (sk->sk_shutdown & RCV_SHUTDOWN) 543 if (sk->sk_shutdown & RCV_SHUTDOWN)
544 mask |= POLLIN | POLLRDNORM | POLLRDHUP; 544 mask |= EPOLLIN | EPOLLRDNORM | EPOLLRDHUP;
545 545
546 /* Connected or passive Fast Open socket? */ 546 /* Connected or passive Fast Open socket? */
547 if (state != TCP_SYN_SENT && 547 if (state != TCP_SYN_SENT &&
@@ -554,11 +554,11 @@ __poll_t tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
554 target++; 554 target++;
555 555
556 if (tp->rcv_nxt - tp->copied_seq >= target) 556 if (tp->rcv_nxt - tp->copied_seq >= target)
557 mask |= POLLIN | POLLRDNORM; 557 mask |= EPOLLIN | EPOLLRDNORM;
558 558
559 if (!(sk->sk_shutdown & SEND_SHUTDOWN)) { 559 if (!(sk->sk_shutdown & SEND_SHUTDOWN)) {
560 if (sk_stream_is_writeable(sk)) { 560 if (sk_stream_is_writeable(sk)) {
561 mask |= POLLOUT | POLLWRNORM; 561 mask |= EPOLLOUT | EPOLLWRNORM;
562 } else { /* send SIGIO later */ 562 } else { /* send SIGIO later */
563 sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk); 563 sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk);
564 set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); 564 set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
@@ -570,24 +570,24 @@ __poll_t tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
570 */ 570 */
571 smp_mb__after_atomic(); 571 smp_mb__after_atomic();
572 if (sk_stream_is_writeable(sk)) 572 if (sk_stream_is_writeable(sk))
573 mask |= POLLOUT | POLLWRNORM; 573 mask |= EPOLLOUT | EPOLLWRNORM;
574 } 574 }
575 } else 575 } else
576 mask |= POLLOUT | POLLWRNORM; 576 mask |= EPOLLOUT | EPOLLWRNORM;
577 577
578 if (tp->urg_data & TCP_URG_VALID) 578 if (tp->urg_data & TCP_URG_VALID)
579 mask |= POLLPRI; 579 mask |= EPOLLPRI;
580 } else if (state == TCP_SYN_SENT && inet_sk(sk)->defer_connect) { 580 } else if (state == TCP_SYN_SENT && inet_sk(sk)->defer_connect) {
581 /* Active TCP fastopen socket with defer_connect 581 /* Active TCP fastopen socket with defer_connect
582 * Return POLLOUT so application can call write() 582 * Return EPOLLOUT so application can call write()
583 * in order for kernel to generate SYN+data 583 * in order for kernel to generate SYN+data
584 */ 584 */
585 mask |= POLLOUT | POLLWRNORM; 585 mask |= EPOLLOUT | EPOLLWRNORM;
586 } 586 }
587 /* This barrier is coupled with smp_wmb() in tcp_reset() */ 587 /* This barrier is coupled with smp_wmb() in tcp_reset() */
588 smp_rmb(); 588 smp_rmb();
589 if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) 589 if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue))
590 mask |= POLLERR; 590 mask |= EPOLLERR;
591 591
592 return mask; 592 return mask;
593} 593}
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index cfa51cfd2d99..575d3c1fb6e8 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -315,7 +315,7 @@ static void tcp_sndbuf_expand(struct sock *sk)
315 315
316 /* Fast Recovery (RFC 5681 3.2) : 316 /* Fast Recovery (RFC 5681 3.2) :
317 * Cubic needs 1.7 factor, rounded to 2 to include 317 * Cubic needs 1.7 factor, rounded to 2 to include
318 * extra cushion (application might react slowly to POLLOUT) 318 * extra cushion (application might react slowly to EPOLLOUT)
319 */ 319 */
320 sndmem = ca_ops->sndbuf_expand ? ca_ops->sndbuf_expand(sk) : 2; 320 sndmem = ca_ops->sndbuf_expand ? ca_ops->sndbuf_expand(sk) : 2;
321 sndmem *= nr_segs * per_mss; 321 sndmem *= nr_segs * per_mss;
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index f81f969f9c06..bfaefe560b5c 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2501,12 +2501,12 @@ __poll_t udp_poll(struct file *file, struct socket *sock, poll_table *wait)
2501 struct sock *sk = sock->sk; 2501 struct sock *sk = sock->sk;
2502 2502
2503 if (!skb_queue_empty(&udp_sk(sk)->reader_queue)) 2503 if (!skb_queue_empty(&udp_sk(sk)->reader_queue))
2504 mask |= POLLIN | POLLRDNORM; 2504 mask |= EPOLLIN | EPOLLRDNORM;
2505 2505
2506 /* Check for false positives due to checksum errors */ 2506 /* Check for false positives due to checksum errors */
2507 if ((mask & POLLRDNORM) && !(file->f_flags & O_NONBLOCK) && 2507 if ((mask & EPOLLRDNORM) && !(file->f_flags & O_NONBLOCK) &&
2508 !(sk->sk_shutdown & RCV_SHUTDOWN) && first_packet_length(sk) == -1) 2508 !(sk->sk_shutdown & RCV_SHUTDOWN) && first_packet_length(sk) == -1)
2509 mask &= ~(POLLIN | POLLRDNORM); 2509 mask &= ~(EPOLLIN | EPOLLRDNORM);
2510 2510
2511 return mask; 2511 return mask;
2512 2512
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index 64331158d693..1e8cc7bcbca3 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -1483,7 +1483,7 @@ static inline __poll_t iucv_accept_poll(struct sock *parent)
1483 sk = (struct sock *) isk; 1483 sk = (struct sock *) isk;
1484 1484
1485 if (sk->sk_state == IUCV_CONNECTED) 1485 if (sk->sk_state == IUCV_CONNECTED)
1486 return POLLIN | POLLRDNORM; 1486 return EPOLLIN | EPOLLRDNORM;
1487 } 1487 }
1488 1488
1489 return 0; 1489 return 0;
@@ -1501,27 +1501,27 @@ __poll_t iucv_sock_poll(struct file *file, struct socket *sock,
1501 return iucv_accept_poll(sk); 1501 return iucv_accept_poll(sk);
1502 1502
1503 if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) 1503 if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue))
1504 mask |= POLLERR | 1504 mask |= EPOLLERR |
1505 (sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? POLLPRI : 0); 1505 (sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? EPOLLPRI : 0);
1506 1506
1507 if (sk->sk_shutdown & RCV_SHUTDOWN) 1507 if (sk->sk_shutdown & RCV_SHUTDOWN)
1508 mask |= POLLRDHUP; 1508 mask |= EPOLLRDHUP;
1509 1509
1510 if (sk->sk_shutdown == SHUTDOWN_MASK) 1510 if (sk->sk_shutdown == SHUTDOWN_MASK)
1511 mask |= POLLHUP; 1511 mask |= EPOLLHUP;
1512 1512
1513 if (!skb_queue_empty(&sk->sk_receive_queue) || 1513 if (!skb_queue_empty(&sk->sk_receive_queue) ||
1514 (sk->sk_shutdown & RCV_SHUTDOWN)) 1514 (sk->sk_shutdown & RCV_SHUTDOWN))
1515 mask |= POLLIN | POLLRDNORM; 1515 mask |= EPOLLIN | EPOLLRDNORM;
1516 1516
1517 if (sk->sk_state == IUCV_CLOSED) 1517 if (sk->sk_state == IUCV_CLOSED)
1518 mask |= POLLHUP; 1518 mask |= EPOLLHUP;
1519 1519
1520 if (sk->sk_state == IUCV_DISCONN) 1520 if (sk->sk_state == IUCV_DISCONN)
1521 mask |= POLLIN; 1521 mask |= EPOLLIN;
1522 1522
1523 if (sock_writeable(sk) && iucv_below_msglim(sk)) 1523 if (sock_writeable(sk) && iucv_below_msglim(sk))
1524 mask |= POLLOUT | POLLWRNORM | POLLWRBAND; 1524 mask |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
1525 else 1525 else
1526 sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk); 1526 sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk);
1527 1527
diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c
index 4a8d407f8902..f297d53a11aa 100644
--- a/net/kcm/kcmsock.c
+++ b/net/kcm/kcmsock.c
@@ -396,8 +396,8 @@ static int kcm_read_sock_done(struct strparser *strp, int err)
396 396
397static void psock_state_change(struct sock *sk) 397static void psock_state_change(struct sock *sk)
398{ 398{
399 /* TCP only does a POLLIN for a half close. Do a POLLHUP here 399 /* TCP only does a EPOLLIN for a half close. Do a EPOLLHUP here
400 * since application will normally not poll with POLLIN 400 * since application will normally not poll with EPOLLIN
401 * on the TCP sockets. 401 * on the TCP sockets.
402 */ 402 */
403 403
@@ -1338,7 +1338,7 @@ static void init_kcm_sock(struct kcm_sock *kcm, struct kcm_mux *mux)
1338 1338
1339 /* For SOCK_SEQPACKET sock type, datagram_poll checks the sk_state, so 1339 /* For SOCK_SEQPACKET sock type, datagram_poll checks the sk_state, so
1340 * we set sk_state, otherwise epoll_wait always returns right away with 1340 * we set sk_state, otherwise epoll_wait always returns right away with
1341 * POLLHUP 1341 * EPOLLHUP
1342 */ 1342 */
1343 kcm->sk.sk_state = TCP_ESTABLISHED; 1343 kcm->sk.sk_state = TCP_ESTABLISHED;
1344 1344
diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c
index 985909f105eb..376040092142 100644
--- a/net/nfc/llcp_sock.c
+++ b/net/nfc/llcp_sock.c
@@ -543,7 +543,7 @@ static inline __poll_t llcp_accept_poll(struct sock *parent)
543 sk = &llcp_sock->sk; 543 sk = &llcp_sock->sk;
544 544
545 if (sk->sk_state == LLCP_CONNECTED) 545 if (sk->sk_state == LLCP_CONNECTED)
546 return POLLIN | POLLRDNORM; 546 return EPOLLIN | EPOLLRDNORM;
547 } 547 }
548 548
549 return 0; 549 return 0;
@@ -563,23 +563,23 @@ static __poll_t llcp_sock_poll(struct file *file, struct socket *sock,
563 return llcp_accept_poll(sk); 563 return llcp_accept_poll(sk);
564 564
565 if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) 565 if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue))
566 mask |= POLLERR | 566 mask |= EPOLLERR |
567 (sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? POLLPRI : 0); 567 (sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? EPOLLPRI : 0);
568 568
569 if (!skb_queue_empty(&sk->sk_receive_queue)) 569 if (!skb_queue_empty(&sk->sk_receive_queue))
570 mask |= POLLIN | POLLRDNORM; 570 mask |= EPOLLIN | EPOLLRDNORM;
571 571
572 if (sk->sk_state == LLCP_CLOSED) 572 if (sk->sk_state == LLCP_CLOSED)
573 mask |= POLLHUP; 573 mask |= EPOLLHUP;
574 574
575 if (sk->sk_shutdown & RCV_SHUTDOWN) 575 if (sk->sk_shutdown & RCV_SHUTDOWN)
576 mask |= POLLRDHUP | POLLIN | POLLRDNORM; 576 mask |= EPOLLRDHUP | EPOLLIN | EPOLLRDNORM;
577 577
578 if (sk->sk_shutdown == SHUTDOWN_MASK) 578 if (sk->sk_shutdown == SHUTDOWN_MASK)
579 mask |= POLLHUP; 579 mask |= EPOLLHUP;
580 580
581 if (sock_writeable(sk) && sk->sk_state == LLCP_CONNECTED) 581 if (sock_writeable(sk) && sk->sk_state == LLCP_CONNECTED)
582 mask |= POLLOUT | POLLWRNORM | POLLWRBAND; 582 mask |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
583 else 583 else
584 sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk); 584 sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk);
585 585
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 1d1483007e46..e0f3f4aeeb4f 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -4085,7 +4085,7 @@ static __poll_t packet_poll(struct file *file, struct socket *sock,
4085 if (po->rx_ring.pg_vec) { 4085 if (po->rx_ring.pg_vec) {
4086 if (!packet_previous_rx_frame(po, &po->rx_ring, 4086 if (!packet_previous_rx_frame(po, &po->rx_ring,
4087 TP_STATUS_KERNEL)) 4087 TP_STATUS_KERNEL))
4088 mask |= POLLIN | POLLRDNORM; 4088 mask |= EPOLLIN | EPOLLRDNORM;
4089 } 4089 }
4090 if (po->pressure && __packet_rcv_has_room(po, NULL) == ROOM_NORMAL) 4090 if (po->pressure && __packet_rcv_has_room(po, NULL) == ROOM_NORMAL)
4091 po->pressure = 0; 4091 po->pressure = 0;
@@ -4093,7 +4093,7 @@ static __poll_t packet_poll(struct file *file, struct socket *sock,
4093 spin_lock_bh(&sk->sk_write_queue.lock); 4093 spin_lock_bh(&sk->sk_write_queue.lock);
4094 if (po->tx_ring.pg_vec) { 4094 if (po->tx_ring.pg_vec) {
4095 if (packet_current_frame(po, &po->tx_ring, TP_STATUS_AVAILABLE)) 4095 if (packet_current_frame(po, &po->tx_ring, TP_STATUS_AVAILABLE))
4096 mask |= POLLOUT | POLLWRNORM; 4096 mask |= EPOLLOUT | EPOLLWRNORM;
4097 } 4097 }
4098 spin_unlock_bh(&sk->sk_write_queue.lock); 4098 spin_unlock_bh(&sk->sk_write_queue.lock);
4099 return mask; 4099 return mask;
diff --git a/net/phonet/socket.c b/net/phonet/socket.c
index 08f6751d2030..fffcd69f63ff 100644
--- a/net/phonet/socket.c
+++ b/net/phonet/socket.c
@@ -351,18 +351,18 @@ static __poll_t pn_socket_poll(struct file *file, struct socket *sock,
351 poll_wait(file, sk_sleep(sk), wait); 351 poll_wait(file, sk_sleep(sk), wait);
352 352
353 if (sk->sk_state == TCP_CLOSE) 353 if (sk->sk_state == TCP_CLOSE)
354 return POLLERR; 354 return EPOLLERR;
355 if (!skb_queue_empty(&sk->sk_receive_queue)) 355 if (!skb_queue_empty(&sk->sk_receive_queue))
356 mask |= POLLIN | POLLRDNORM; 356 mask |= EPOLLIN | EPOLLRDNORM;
357 if (!skb_queue_empty(&pn->ctrlreq_queue)) 357 if (!skb_queue_empty(&pn->ctrlreq_queue))
358 mask |= POLLPRI; 358 mask |= EPOLLPRI;
359 if (!mask && sk->sk_state == TCP_CLOSE_WAIT) 359 if (!mask && sk->sk_state == TCP_CLOSE_WAIT)
360 return POLLHUP; 360 return EPOLLHUP;
361 361
362 if (sk->sk_state == TCP_ESTABLISHED && 362 if (sk->sk_state == TCP_ESTABLISHED &&
363 refcount_read(&sk->sk_wmem_alloc) < sk->sk_sndbuf && 363 refcount_read(&sk->sk_wmem_alloc) < sk->sk_sndbuf &&
364 atomic_read(&pn->tx_credits)) 364 atomic_read(&pn->tx_credits))
365 mask |= POLLOUT | POLLWRNORM | POLLWRBAND; 365 mask |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
366 366
367 return mask; 367 return mask;
368} 368}
diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c
index 88aa8ad0f5b6..744c637c86b0 100644
--- a/net/rds/af_rds.c
+++ b/net/rds/af_rds.c
@@ -137,17 +137,17 @@ static int rds_getname(struct socket *sock, struct sockaddr *uaddr,
137 137
138/* 138/*
139 * RDS' poll is without a doubt the least intuitive part of the interface, 139 * RDS' poll is without a doubt the least intuitive part of the interface,
140 * as POLLIN and POLLOUT do not behave entirely as you would expect from 140 * as EPOLLIN and EPOLLOUT do not behave entirely as you would expect from
141 * a network protocol. 141 * a network protocol.
142 * 142 *
143 * POLLIN is asserted if 143 * EPOLLIN is asserted if
144 * - there is data on the receive queue. 144 * - there is data on the receive queue.
145 * - to signal that a previously congested destination may have become 145 * - to signal that a previously congested destination may have become
146 * uncongested 146 * uncongested
147 * - A notification has been queued to the socket (this can be a congestion 147 * - A notification has been queued to the socket (this can be a congestion
148 * update, or a RDMA completion). 148 * update, or a RDMA completion).
149 * 149 *
150 * POLLOUT is asserted if there is room on the send queue. This does not mean 150 * EPOLLOUT is asserted if there is room on the send queue. This does not mean
151 * however, that the next sendmsg() call will succeed. If the application tries 151 * however, that the next sendmsg() call will succeed. If the application tries
152 * to send to a congested destination, the system call may still fail (and 152 * to send to a congested destination, the system call may still fail (and
153 * return ENOBUFS). 153 * return ENOBUFS).
@@ -167,22 +167,22 @@ static __poll_t rds_poll(struct file *file, struct socket *sock,
167 167
168 read_lock_irqsave(&rs->rs_recv_lock, flags); 168 read_lock_irqsave(&rs->rs_recv_lock, flags);
169 if (!rs->rs_cong_monitor) { 169 if (!rs->rs_cong_monitor) {
170 /* When a congestion map was updated, we signal POLLIN for 170 /* When a congestion map was updated, we signal EPOLLIN for
171 * "historical" reasons. Applications can also poll for 171 * "historical" reasons. Applications can also poll for
172 * WRBAND instead. */ 172 * WRBAND instead. */
173 if (rds_cong_updated_since(&rs->rs_cong_track)) 173 if (rds_cong_updated_since(&rs->rs_cong_track))
174 mask |= (POLLIN | POLLRDNORM | POLLWRBAND); 174 mask |= (EPOLLIN | EPOLLRDNORM | EPOLLWRBAND);
175 } else { 175 } else {
176 spin_lock(&rs->rs_lock); 176 spin_lock(&rs->rs_lock);
177 if (rs->rs_cong_notify) 177 if (rs->rs_cong_notify)
178 mask |= (POLLIN | POLLRDNORM); 178 mask |= (EPOLLIN | EPOLLRDNORM);
179 spin_unlock(&rs->rs_lock); 179 spin_unlock(&rs->rs_lock);
180 } 180 }
181 if (!list_empty(&rs->rs_recv_queue) || 181 if (!list_empty(&rs->rs_recv_queue) ||
182 !list_empty(&rs->rs_notify_queue)) 182 !list_empty(&rs->rs_notify_queue))
183 mask |= (POLLIN | POLLRDNORM); 183 mask |= (EPOLLIN | EPOLLRDNORM);
184 if (rs->rs_snd_bytes < rds_sk_sndbuf(rs)) 184 if (rs->rs_snd_bytes < rds_sk_sndbuf(rs))
185 mask |= (POLLOUT | POLLWRNORM); 185 mask |= (EPOLLOUT | EPOLLWRNORM);
186 read_unlock_irqrestore(&rs->rs_recv_lock, flags); 186 read_unlock_irqrestore(&rs->rs_recv_lock, flags);
187 187
188 /* clear state any time we wake a seen-congested socket */ 188 /* clear state any time we wake a seen-congested socket */
diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index 124c77e9d058..59d0eb960275 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -1142,13 +1142,13 @@ static int rfkill_fop_open(struct inode *inode, struct file *file)
1142static __poll_t rfkill_fop_poll(struct file *file, poll_table *wait) 1142static __poll_t rfkill_fop_poll(struct file *file, poll_table *wait)
1143{ 1143{
1144 struct rfkill_data *data = file->private_data; 1144 struct rfkill_data *data = file->private_data;
1145 __poll_t res = POLLOUT | POLLWRNORM; 1145 __poll_t res = EPOLLOUT | EPOLLWRNORM;
1146 1146
1147 poll_wait(file, &data->read_wait, wait); 1147 poll_wait(file, &data->read_wait, wait);
1148 1148
1149 mutex_lock(&data->mtx); 1149 mutex_lock(&data->mtx);
1150 if (!list_empty(&data->events)) 1150 if (!list_empty(&data->events))
1151 res = POLLIN | POLLRDNORM; 1151 res = EPOLLIN | EPOLLRDNORM;
1152 mutex_unlock(&data->mtx); 1152 mutex_unlock(&data->mtx);
1153 1153
1154 return res; 1154 return res;
diff --git a/net/rxrpc/af_rxrpc.c b/net/rxrpc/af_rxrpc.c
index 21ad6a3a465c..0c9c18aa7c77 100644
--- a/net/rxrpc/af_rxrpc.c
+++ b/net/rxrpc/af_rxrpc.c
@@ -742,13 +742,13 @@ static __poll_t rxrpc_poll(struct file *file, struct socket *sock,
742 /* the socket is readable if there are any messages waiting on the Rx 742 /* the socket is readable if there are any messages waiting on the Rx
743 * queue */ 743 * queue */
744 if (!list_empty(&rx->recvmsg_q)) 744 if (!list_empty(&rx->recvmsg_q))
745 mask |= POLLIN | POLLRDNORM; 745 mask |= EPOLLIN | EPOLLRDNORM;
746 746
747 /* the socket is writable if there is space to add new data to the 747 /* the socket is writable if there is space to add new data to the
748 * socket; there is no guarantee that any particular call in progress 748 * socket; there is no guarantee that any particular call in progress
749 * on the socket may have space in the Tx ACK window */ 749 * on the socket may have space in the Tx ACK window */
750 if (rxrpc_writable(sk)) 750 if (rxrpc_writable(sk))
751 mask |= POLLOUT | POLLWRNORM; 751 mask |= EPOLLOUT | EPOLLWRNORM;
752 752
753 return mask; 753 return mask;
754} 754}
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index ebb8cb9eb0bd..bf271f8c2dc9 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -7602,22 +7602,22 @@ __poll_t sctp_poll(struct file *file, struct socket *sock, poll_table *wait)
7602 */ 7602 */
7603 if (sctp_style(sk, TCP) && sctp_sstate(sk, LISTENING)) 7603 if (sctp_style(sk, TCP) && sctp_sstate(sk, LISTENING))
7604 return (!list_empty(&sp->ep->asocs)) ? 7604 return (!list_empty(&sp->ep->asocs)) ?
7605 (POLLIN | POLLRDNORM) : 0; 7605 (EPOLLIN | EPOLLRDNORM) : 0;
7606 7606
7607 mask = 0; 7607 mask = 0;
7608 7608
7609 /* Is there any exceptional events? */ 7609 /* Is there any exceptional events? */
7610 if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) 7610 if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue))
7611 mask |= POLLERR | 7611 mask |= EPOLLERR |
7612 (sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? POLLPRI : 0); 7612 (sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? EPOLLPRI : 0);
7613 if (sk->sk_shutdown & RCV_SHUTDOWN) 7613 if (sk->sk_shutdown & RCV_SHUTDOWN)
7614 mask |= POLLRDHUP | POLLIN | POLLRDNORM; 7614 mask |= EPOLLRDHUP | EPOLLIN | EPOLLRDNORM;
7615 if (sk->sk_shutdown == SHUTDOWN_MASK) 7615 if (sk->sk_shutdown == SHUTDOWN_MASK)
7616 mask |= POLLHUP; 7616 mask |= EPOLLHUP;
7617 7617
7618 /* Is it readable? Reconsider this code with TCP-style support. */ 7618 /* Is it readable? Reconsider this code with TCP-style support. */
7619 if (!skb_queue_empty(&sk->sk_receive_queue)) 7619 if (!skb_queue_empty(&sk->sk_receive_queue))
7620 mask |= POLLIN | POLLRDNORM; 7620 mask |= EPOLLIN | EPOLLRDNORM;
7621 7621
7622 /* The association is either gone or not ready. */ 7622 /* The association is either gone or not ready. */
7623 if (!sctp_style(sk, UDP) && sctp_sstate(sk, CLOSED)) 7623 if (!sctp_style(sk, UDP) && sctp_sstate(sk, CLOSED))
@@ -7625,7 +7625,7 @@ __poll_t sctp_poll(struct file *file, struct socket *sock, poll_table *wait)
7625 7625
7626 /* Is it writable? */ 7626 /* Is it writable? */
7627 if (sctp_writeable(sk)) { 7627 if (sctp_writeable(sk)) {
7628 mask |= POLLOUT | POLLWRNORM; 7628 mask |= EPOLLOUT | EPOLLWRNORM;
7629 } else { 7629 } else {
7630 sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk); 7630 sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk);
7631 /* 7631 /*
@@ -7637,7 +7637,7 @@ __poll_t sctp_poll(struct file *file, struct socket *sock, poll_table *wait)
7637 * in the following code to cover it as well. 7637 * in the following code to cover it as well.
7638 */ 7638 */
7639 if (sctp_writeable(sk)) 7639 if (sctp_writeable(sk))
7640 mask |= POLLOUT | POLLWRNORM; 7640 mask |= EPOLLOUT | EPOLLWRNORM;
7641 } 7641 }
7642 return mask; 7642 return mask;
7643} 7643}
@@ -8161,8 +8161,8 @@ void sctp_data_ready(struct sock *sk)
8161 rcu_read_lock(); 8161 rcu_read_lock();
8162 wq = rcu_dereference(sk->sk_wq); 8162 wq = rcu_dereference(sk->sk_wq);
8163 if (skwq_has_sleeper(wq)) 8163 if (skwq_has_sleeper(wq))
8164 wake_up_interruptible_sync_poll(&wq->wait, POLLIN | 8164 wake_up_interruptible_sync_poll(&wq->wait, EPOLLIN |
8165 POLLRDNORM | POLLRDBAND); 8165 EPOLLRDNORM | EPOLLRDBAND);
8166 sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN); 8166 sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN);
8167 rcu_read_unlock(); 8167 rcu_read_unlock();
8168} 8168}
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index ba4b84debc5a..da1a5cdefd13 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -1145,7 +1145,7 @@ static __poll_t smc_accept_poll(struct sock *parent)
1145 1145
1146 spin_lock(&isk->accept_q_lock); 1146 spin_lock(&isk->accept_q_lock);
1147 if (!list_empty(&isk->accept_q)) 1147 if (!list_empty(&isk->accept_q))
1148 mask = POLLIN | POLLRDNORM; 1148 mask = EPOLLIN | EPOLLRDNORM;
1149 spin_unlock(&isk->accept_q_lock); 1149 spin_unlock(&isk->accept_q_lock);
1150 1150
1151 return mask; 1151 return mask;
@@ -1160,7 +1160,7 @@ static __poll_t smc_poll(struct file *file, struct socket *sock,
1160 int rc; 1160 int rc;
1161 1161
1162 if (!sk) 1162 if (!sk)
1163 return POLLNVAL; 1163 return EPOLLNVAL;
1164 1164
1165 smc = smc_sk(sock->sk); 1165 smc = smc_sk(sock->sk);
1166 sock_hold(sk); 1166 sock_hold(sk);
@@ -1171,16 +1171,16 @@ static __poll_t smc_poll(struct file *file, struct socket *sock,
1171 mask = smc->clcsock->ops->poll(file, smc->clcsock, wait); 1171 mask = smc->clcsock->ops->poll(file, smc->clcsock, wait);
1172 /* if non-blocking connect finished ... */ 1172 /* if non-blocking connect finished ... */
1173 lock_sock(sk); 1173 lock_sock(sk);
1174 if ((sk->sk_state == SMC_INIT) && (mask & POLLOUT)) { 1174 if ((sk->sk_state == SMC_INIT) && (mask & EPOLLOUT)) {
1175 sk->sk_err = smc->clcsock->sk->sk_err; 1175 sk->sk_err = smc->clcsock->sk->sk_err;
1176 if (sk->sk_err) { 1176 if (sk->sk_err) {
1177 mask |= POLLERR; 1177 mask |= EPOLLERR;
1178 } else { 1178 } else {
1179 rc = smc_connect_rdma(smc); 1179 rc = smc_connect_rdma(smc);
1180 if (rc < 0) 1180 if (rc < 0)
1181 mask |= POLLERR; 1181 mask |= EPOLLERR;
1182 /* success cases including fallback */ 1182 /* success cases including fallback */
1183 mask |= POLLOUT | POLLWRNORM; 1183 mask |= EPOLLOUT | EPOLLWRNORM;
1184 } 1184 }
1185 } 1185 }
1186 } else { 1186 } else {
@@ -1190,27 +1190,27 @@ static __poll_t smc_poll(struct file *file, struct socket *sock,
1190 lock_sock(sk); 1190 lock_sock(sk);
1191 } 1191 }
1192 if (sk->sk_err) 1192 if (sk->sk_err)
1193 mask |= POLLERR; 1193 mask |= EPOLLERR;
1194 if ((sk->sk_shutdown == SHUTDOWN_MASK) || 1194 if ((sk->sk_shutdown == SHUTDOWN_MASK) ||
1195 (sk->sk_state == SMC_CLOSED)) 1195 (sk->sk_state == SMC_CLOSED))
1196 mask |= POLLHUP; 1196 mask |= EPOLLHUP;
1197 if (sk->sk_state == SMC_LISTEN) { 1197 if (sk->sk_state == SMC_LISTEN) {
1198 /* woken up by sk_data_ready in smc_listen_work() */ 1198 /* woken up by sk_data_ready in smc_listen_work() */
1199 mask = smc_accept_poll(sk); 1199 mask = smc_accept_poll(sk);
1200 } else { 1200 } else {
1201 if (atomic_read(&smc->conn.sndbuf_space) || 1201 if (atomic_read(&smc->conn.sndbuf_space) ||
1202 sk->sk_shutdown & SEND_SHUTDOWN) { 1202 sk->sk_shutdown & SEND_SHUTDOWN) {
1203 mask |= POLLOUT | POLLWRNORM; 1203 mask |= EPOLLOUT | EPOLLWRNORM;
1204 } else { 1204 } else {
1205 sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk); 1205 sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk);
1206 set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); 1206 set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
1207 } 1207 }
1208 if (atomic_read(&smc->conn.bytes_to_rcv)) 1208 if (atomic_read(&smc->conn.bytes_to_rcv))
1209 mask |= POLLIN | POLLRDNORM; 1209 mask |= EPOLLIN | EPOLLRDNORM;
1210 if (sk->sk_shutdown & RCV_SHUTDOWN) 1210 if (sk->sk_shutdown & RCV_SHUTDOWN)
1211 mask |= POLLIN | POLLRDNORM | POLLRDHUP; 1211 mask |= EPOLLIN | EPOLLRDNORM | EPOLLRDHUP;
1212 if (sk->sk_state == SMC_APPCLOSEWAIT1) 1212 if (sk->sk_state == SMC_APPCLOSEWAIT1)
1213 mask |= POLLIN; 1213 mask |= EPOLLIN;
1214 } 1214 }
1215 1215
1216 } 1216 }
diff --git a/net/smc/smc_rx.c b/net/smc/smc_rx.c
index 9dc392ca06bf..eff4e0d0bb31 100644
--- a/net/smc/smc_rx.c
+++ b/net/smc/smc_rx.c
@@ -35,8 +35,8 @@ static void smc_rx_data_ready(struct sock *sk)
35 rcu_read_lock(); 35 rcu_read_lock();
36 wq = rcu_dereference(sk->sk_wq); 36 wq = rcu_dereference(sk->sk_wq);
37 if (skwq_has_sleeper(wq)) 37 if (skwq_has_sleeper(wq))
38 wake_up_interruptible_sync_poll(&wq->wait, POLLIN | POLLPRI | 38 wake_up_interruptible_sync_poll(&wq->wait, EPOLLIN | EPOLLPRI |
39 POLLRDNORM | POLLRDBAND); 39 EPOLLRDNORM | EPOLLRDBAND);
40 sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN); 40 sk_wake_async(sk, SOCK_WAKE_WAITD, POLL_IN);
41 if ((sk->sk_shutdown == SHUTDOWN_MASK) || 41 if ((sk->sk_shutdown == SHUTDOWN_MASK) ||
42 (sk->sk_state == SMC_CLOSED)) 42 (sk->sk_state == SMC_CLOSED))
diff --git a/net/smc/smc_tx.c b/net/smc/smc_tx.c
index 838bce20c361..72f004c9c9b1 100644
--- a/net/smc/smc_tx.c
+++ b/net/smc/smc_tx.c
@@ -46,8 +46,8 @@ static void smc_tx_write_space(struct sock *sk)
46 wq = rcu_dereference(sk->sk_wq); 46 wq = rcu_dereference(sk->sk_wq);
47 if (skwq_has_sleeper(wq)) 47 if (skwq_has_sleeper(wq))
48 wake_up_interruptible_poll(&wq->wait, 48 wake_up_interruptible_poll(&wq->wait,
49 POLLOUT | POLLWRNORM | 49 EPOLLOUT | EPOLLWRNORM |
50 POLLWRBAND); 50 EPOLLWRBAND);
51 if (wq && wq->fasync_list && !(sk->sk_shutdown & SEND_SHUTDOWN)) 51 if (wq && wq->fasync_list && !(sk->sk_shutdown & SEND_SHUTDOWN))
52 sock_wake_async(wq, SOCK_WAKE_SPACE, POLL_OUT); 52 sock_wake_async(wq, SOCK_WAKE_SPACE, POLL_OUT);
53 rcu_read_unlock(); 53 rcu_read_unlock();
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index aa36dad32db1..8a7e1c774f9c 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -940,7 +940,7 @@ static __poll_t cache_poll(struct file *filp, poll_table *wait,
940 poll_wait(filp, &queue_wait, wait); 940 poll_wait(filp, &queue_wait, wait);
941 941
942 /* alway allow write */ 942 /* alway allow write */
943 mask = POLLOUT | POLLWRNORM; 943 mask = EPOLLOUT | EPOLLWRNORM;
944 944
945 if (!rp) 945 if (!rp)
946 return mask; 946 return mask;
@@ -950,7 +950,7 @@ static __poll_t cache_poll(struct file *filp, poll_table *wait,
950 for (cq= &rp->q; &cq->list != &cd->queue; 950 for (cq= &rp->q; &cq->list != &cd->queue;
951 cq = list_entry(cq->list.next, struct cache_queue, list)) 951 cq = list_entry(cq->list.next, struct cache_queue, list))
952 if (!cq->reader) { 952 if (!cq->reader) {
953 mask |= POLLIN | POLLRDNORM; 953 mask |= EPOLLIN | EPOLLRDNORM;
954 break; 954 break;
955 } 955 }
956 spin_unlock(&queue_lock); 956 spin_unlock(&queue_lock);
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 5c4330325787..fc97fc3ed637 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -345,15 +345,15 @@ rpc_pipe_poll(struct file *filp, struct poll_table_struct *wait)
345{ 345{
346 struct inode *inode = file_inode(filp); 346 struct inode *inode = file_inode(filp);
347 struct rpc_inode *rpci = RPC_I(inode); 347 struct rpc_inode *rpci = RPC_I(inode);
348 __poll_t mask = POLLOUT | POLLWRNORM; 348 __poll_t mask = EPOLLOUT | EPOLLWRNORM;
349 349
350 poll_wait(filp, &rpci->waitq, wait); 350 poll_wait(filp, &rpci->waitq, wait);
351 351
352 inode_lock(inode); 352 inode_lock(inode);
353 if (rpci->pipe == NULL) 353 if (rpci->pipe == NULL)
354 mask |= POLLERR | POLLHUP; 354 mask |= EPOLLERR | EPOLLHUP;
355 else if (filp->private_data || !list_empty(&rpci->pipe->pipe)) 355 else if (filp->private_data || !list_empty(&rpci->pipe->pipe))
356 mask |= POLLIN | POLLRDNORM; 356 mask |= EPOLLIN | EPOLLRDNORM;
357 inode_unlock(inode); 357 inode_unlock(inode);
358 return mask; 358 return mask;
359} 359}
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 163f3a547501..b0323ec7971e 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -721,31 +721,31 @@ static __poll_t tipc_poll(struct file *file, struct socket *sock,
721 sock_poll_wait(file, sk_sleep(sk), wait); 721 sock_poll_wait(file, sk_sleep(sk), wait);
722 722
723 if (sk->sk_shutdown & RCV_SHUTDOWN) 723 if (sk->sk_shutdown & RCV_SHUTDOWN)
724 revents |= POLLRDHUP | POLLIN | POLLRDNORM; 724 revents |= EPOLLRDHUP | EPOLLIN | EPOLLRDNORM;
725 if (sk->sk_shutdown == SHUTDOWN_MASK) 725 if (sk->sk_shutdown == SHUTDOWN_MASK)
726 revents |= POLLHUP; 726 revents |= EPOLLHUP;
727 727
728 switch (sk->sk_state) { 728 switch (sk->sk_state) {
729 case TIPC_ESTABLISHED: 729 case TIPC_ESTABLISHED:
730 case TIPC_CONNECTING: 730 case TIPC_CONNECTING:
731 if (!tsk->cong_link_cnt && !tsk_conn_cong(tsk)) 731 if (!tsk->cong_link_cnt && !tsk_conn_cong(tsk))
732 revents |= POLLOUT; 732 revents |= EPOLLOUT;
733 /* fall thru' */ 733 /* fall thru' */
734 case TIPC_LISTEN: 734 case TIPC_LISTEN:
735 if (!skb_queue_empty(&sk->sk_receive_queue)) 735 if (!skb_queue_empty(&sk->sk_receive_queue))
736 revents |= POLLIN | POLLRDNORM; 736 revents |= EPOLLIN | EPOLLRDNORM;
737 break; 737 break;
738 case TIPC_OPEN: 738 case TIPC_OPEN:
739 if (tsk->group_is_open && !tsk->cong_link_cnt) 739 if (tsk->group_is_open && !tsk->cong_link_cnt)
740 revents |= POLLOUT; 740 revents |= EPOLLOUT;
741 if (!tipc_sk_type_connectionless(sk)) 741 if (!tipc_sk_type_connectionless(sk))
742 break; 742 break;
743 if (skb_queue_empty(&sk->sk_receive_queue)) 743 if (skb_queue_empty(&sk->sk_receive_queue))
744 break; 744 break;
745 revents |= POLLIN | POLLRDNORM; 745 revents |= EPOLLIN | EPOLLRDNORM;
746 break; 746 break;
747 case TIPC_DISCONNECTING: 747 case TIPC_DISCONNECTING:
748 revents = POLLIN | POLLRDNORM | POLLHUP; 748 revents = EPOLLIN | EPOLLRDNORM | EPOLLHUP;
749 break; 749 break;
750 } 750 }
751 return revents; 751 return revents;
@@ -1897,8 +1897,8 @@ static void tipc_write_space(struct sock *sk)
1897 rcu_read_lock(); 1897 rcu_read_lock();
1898 wq = rcu_dereference(sk->sk_wq); 1898 wq = rcu_dereference(sk->sk_wq);
1899 if (skwq_has_sleeper(wq)) 1899 if (skwq_has_sleeper(wq))
1900 wake_up_interruptible_sync_poll(&wq->wait, POLLOUT | 1900 wake_up_interruptible_sync_poll(&wq->wait, EPOLLOUT |
1901 POLLWRNORM | POLLWRBAND); 1901 EPOLLWRNORM | EPOLLWRBAND);
1902 rcu_read_unlock(); 1902 rcu_read_unlock();
1903} 1903}
1904 1904
@@ -1914,8 +1914,8 @@ static void tipc_data_ready(struct sock *sk)
1914 rcu_read_lock(); 1914 rcu_read_lock();
1915 wq = rcu_dereference(sk->sk_wq); 1915 wq = rcu_dereference(sk->sk_wq);
1916 if (skwq_has_sleeper(wq)) 1916 if (skwq_has_sleeper(wq))
1917 wake_up_interruptible_sync_poll(&wq->wait, POLLIN | 1917 wake_up_interruptible_sync_poll(&wq->wait, EPOLLIN |
1918 POLLRDNORM | POLLRDBAND); 1918 EPOLLRDNORM | EPOLLRDBAND);
1919 rcu_read_unlock(); 1919 rcu_read_unlock();
1920} 1920}
1921 1921
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 0214acbd6bff..d545e1d0dea2 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -415,9 +415,9 @@ static void unix_dgram_peer_wake_disconnect_wakeup(struct sock *sk,
415{ 415{
416 unix_dgram_peer_wake_disconnect(sk, other); 416 unix_dgram_peer_wake_disconnect(sk, other);
417 wake_up_interruptible_poll(sk_sleep(sk), 417 wake_up_interruptible_poll(sk_sleep(sk),
418 POLLOUT | 418 EPOLLOUT |
419 POLLWRNORM | 419 EPOLLWRNORM |
420 POLLWRBAND); 420 EPOLLWRBAND);
421} 421}
422 422
423/* preconditions: 423/* preconditions:
@@ -454,7 +454,7 @@ static void unix_write_space(struct sock *sk)
454 wq = rcu_dereference(sk->sk_wq); 454 wq = rcu_dereference(sk->sk_wq);
455 if (skwq_has_sleeper(wq)) 455 if (skwq_has_sleeper(wq))
456 wake_up_interruptible_sync_poll(&wq->wait, 456 wake_up_interruptible_sync_poll(&wq->wait,
457 POLLOUT | POLLWRNORM | POLLWRBAND); 457 EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND);
458 sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT); 458 sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT);
459 } 459 }
460 rcu_read_unlock(); 460 rcu_read_unlock();
@@ -2129,8 +2129,8 @@ static int unix_dgram_recvmsg(struct socket *sock, struct msghdr *msg,
2129 2129
2130 if (wq_has_sleeper(&u->peer_wait)) 2130 if (wq_has_sleeper(&u->peer_wait))
2131 wake_up_interruptible_sync_poll(&u->peer_wait, 2131 wake_up_interruptible_sync_poll(&u->peer_wait,
2132 POLLOUT | POLLWRNORM | 2132 EPOLLOUT | EPOLLWRNORM |
2133 POLLWRBAND); 2133 EPOLLWRBAND);
2134 2134
2135 if (msg->msg_name) 2135 if (msg->msg_name)
2136 unix_copy_addr(msg, skb->sk); 2136 unix_copy_addr(msg, skb->sk);
@@ -2650,27 +2650,27 @@ static __poll_t unix_poll(struct file *file, struct socket *sock, poll_table *wa
2650 2650
2651 /* exceptional events? */ 2651 /* exceptional events? */
2652 if (sk->sk_err) 2652 if (sk->sk_err)
2653 mask |= POLLERR; 2653 mask |= EPOLLERR;
2654 if (sk->sk_shutdown == SHUTDOWN_MASK) 2654 if (sk->sk_shutdown == SHUTDOWN_MASK)
2655 mask |= POLLHUP; 2655 mask |= EPOLLHUP;
2656 if (sk->sk_shutdown & RCV_SHUTDOWN) 2656 if (sk->sk_shutdown & RCV_SHUTDOWN)
2657 mask |= POLLRDHUP | POLLIN | POLLRDNORM; 2657 mask |= EPOLLRDHUP | EPOLLIN | EPOLLRDNORM;
2658 2658
2659 /* readable? */ 2659 /* readable? */
2660 if (!skb_queue_empty(&sk->sk_receive_queue)) 2660 if (!skb_queue_empty(&sk->sk_receive_queue))
2661 mask |= POLLIN | POLLRDNORM; 2661 mask |= EPOLLIN | EPOLLRDNORM;
2662 2662
2663 /* Connection-based need to check for termination and startup */ 2663 /* Connection-based need to check for termination and startup */
2664 if ((sk->sk_type == SOCK_STREAM || sk->sk_type == SOCK_SEQPACKET) && 2664 if ((sk->sk_type == SOCK_STREAM || sk->sk_type == SOCK_SEQPACKET) &&
2665 sk->sk_state == TCP_CLOSE) 2665 sk->sk_state == TCP_CLOSE)
2666 mask |= POLLHUP; 2666 mask |= EPOLLHUP;
2667 2667
2668 /* 2668 /*
2669 * we set writable also when the other side has shut down the 2669 * we set writable also when the other side has shut down the
2670 * connection. This prevents stuck sockets. 2670 * connection. This prevents stuck sockets.
2671 */ 2671 */
2672 if (unix_writable(sk)) 2672 if (unix_writable(sk))
2673 mask |= POLLOUT | POLLWRNORM | POLLWRBAND; 2673 mask |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
2674 2674
2675 return mask; 2675 return mask;
2676} 2676}
@@ -2687,29 +2687,29 @@ static __poll_t unix_dgram_poll(struct file *file, struct socket *sock,
2687 2687
2688 /* exceptional events? */ 2688 /* exceptional events? */
2689 if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) 2689 if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue))
2690 mask |= POLLERR | 2690 mask |= EPOLLERR |
2691 (sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? POLLPRI : 0); 2691 (sock_flag(sk, SOCK_SELECT_ERR_QUEUE) ? EPOLLPRI : 0);
2692 2692
2693 if (sk->sk_shutdown & RCV_SHUTDOWN) 2693 if (sk->sk_shutdown & RCV_SHUTDOWN)
2694 mask |= POLLRDHUP | POLLIN | POLLRDNORM; 2694 mask |= EPOLLRDHUP | EPOLLIN | EPOLLRDNORM;
2695 if (sk->sk_shutdown == SHUTDOWN_MASK) 2695 if (sk->sk_shutdown == SHUTDOWN_MASK)
2696 mask |= POLLHUP; 2696 mask |= EPOLLHUP;
2697 2697
2698 /* readable? */ 2698 /* readable? */
2699 if (!skb_queue_empty(&sk->sk_receive_queue)) 2699 if (!skb_queue_empty(&sk->sk_receive_queue))
2700 mask |= POLLIN | POLLRDNORM; 2700 mask |= EPOLLIN | EPOLLRDNORM;
2701 2701
2702 /* Connection-based need to check for termination and startup */ 2702 /* Connection-based need to check for termination and startup */
2703 if (sk->sk_type == SOCK_SEQPACKET) { 2703 if (sk->sk_type == SOCK_SEQPACKET) {
2704 if (sk->sk_state == TCP_CLOSE) 2704 if (sk->sk_state == TCP_CLOSE)
2705 mask |= POLLHUP; 2705 mask |= EPOLLHUP;
2706 /* connection hasn't started yet? */ 2706 /* connection hasn't started yet? */
2707 if (sk->sk_state == TCP_SYN_SENT) 2707 if (sk->sk_state == TCP_SYN_SENT)
2708 return mask; 2708 return mask;
2709 } 2709 }
2710 2710
2711 /* No write status requested, avoid expensive OUT tests. */ 2711 /* No write status requested, avoid expensive OUT tests. */
2712 if (!(poll_requested_events(wait) & (POLLWRBAND|POLLWRNORM|POLLOUT))) 2712 if (!(poll_requested_events(wait) & (EPOLLWRBAND|EPOLLWRNORM|EPOLLOUT)))
2713 return mask; 2713 return mask;
2714 2714
2715 writable = unix_writable(sk); 2715 writable = unix_writable(sk);
@@ -2726,7 +2726,7 @@ static __poll_t unix_dgram_poll(struct file *file, struct socket *sock,
2726 } 2726 }
2727 2727
2728 if (writable) 2728 if (writable)
2729 mask |= POLLOUT | POLLWRNORM | POLLWRBAND; 2729 mask |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
2730 else 2730 else
2731 sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk); 2731 sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk);
2732 2732
diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index 9d95e773f4c8..e0fc84daed94 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -865,20 +865,20 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock,
865 865
866 if (sk->sk_err) 866 if (sk->sk_err)
867 /* Signify that there has been an error on this socket. */ 867 /* Signify that there has been an error on this socket. */
868 mask |= POLLERR; 868 mask |= EPOLLERR;
869 869
870 /* INET sockets treat local write shutdown and peer write shutdown as a 870 /* INET sockets treat local write shutdown and peer write shutdown as a
871 * case of POLLHUP set. 871 * case of EPOLLHUP set.
872 */ 872 */
873 if ((sk->sk_shutdown == SHUTDOWN_MASK) || 873 if ((sk->sk_shutdown == SHUTDOWN_MASK) ||
874 ((sk->sk_shutdown & SEND_SHUTDOWN) && 874 ((sk->sk_shutdown & SEND_SHUTDOWN) &&
875 (vsk->peer_shutdown & SEND_SHUTDOWN))) { 875 (vsk->peer_shutdown & SEND_SHUTDOWN))) {
876 mask |= POLLHUP; 876 mask |= EPOLLHUP;
877 } 877 }
878 878
879 if (sk->sk_shutdown & RCV_SHUTDOWN || 879 if (sk->sk_shutdown & RCV_SHUTDOWN ||
880 vsk->peer_shutdown & SEND_SHUTDOWN) { 880 vsk->peer_shutdown & SEND_SHUTDOWN) {
881 mask |= POLLRDHUP; 881 mask |= EPOLLRDHUP;
882 } 882 }
883 883
884 if (sock->type == SOCK_DGRAM) { 884 if (sock->type == SOCK_DGRAM) {
@@ -888,11 +888,11 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock,
888 */ 888 */
889 if (!skb_queue_empty(&sk->sk_receive_queue) || 889 if (!skb_queue_empty(&sk->sk_receive_queue) ||
890 (sk->sk_shutdown & RCV_SHUTDOWN)) { 890 (sk->sk_shutdown & RCV_SHUTDOWN)) {
891 mask |= POLLIN | POLLRDNORM; 891 mask |= EPOLLIN | EPOLLRDNORM;
892 } 892 }
893 893
894 if (!(sk->sk_shutdown & SEND_SHUTDOWN)) 894 if (!(sk->sk_shutdown & SEND_SHUTDOWN))
895 mask |= POLLOUT | POLLWRNORM | POLLWRBAND; 895 mask |= EPOLLOUT | EPOLLWRNORM | EPOLLWRBAND;
896 896
897 } else if (sock->type == SOCK_STREAM) { 897 } else if (sock->type == SOCK_STREAM) {
898 lock_sock(sk); 898 lock_sock(sk);
@@ -902,7 +902,7 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock,
902 */ 902 */
903 if (sk->sk_state == TCP_LISTEN 903 if (sk->sk_state == TCP_LISTEN
904 && !vsock_is_accept_queue_empty(sk)) 904 && !vsock_is_accept_queue_empty(sk))
905 mask |= POLLIN | POLLRDNORM; 905 mask |= EPOLLIN | EPOLLRDNORM;
906 906
907 /* If there is something in the queue then we can read. */ 907 /* If there is something in the queue then we can read. */
908 if (transport->stream_is_active(vsk) && 908 if (transport->stream_is_active(vsk) &&
@@ -911,10 +911,10 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock,
911 int ret = transport->notify_poll_in( 911 int ret = transport->notify_poll_in(
912 vsk, 1, &data_ready_now); 912 vsk, 1, &data_ready_now);
913 if (ret < 0) { 913 if (ret < 0) {
914 mask |= POLLERR; 914 mask |= EPOLLERR;
915 } else { 915 } else {
916 if (data_ready_now) 916 if (data_ready_now)
917 mask |= POLLIN | POLLRDNORM; 917 mask |= EPOLLIN | EPOLLRDNORM;
918 918
919 } 919 }
920 } 920 }
@@ -925,7 +925,7 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock,
925 */ 925 */
926 if (sk->sk_shutdown & RCV_SHUTDOWN || 926 if (sk->sk_shutdown & RCV_SHUTDOWN ||
927 vsk->peer_shutdown & SEND_SHUTDOWN) { 927 vsk->peer_shutdown & SEND_SHUTDOWN) {
928 mask |= POLLIN | POLLRDNORM; 928 mask |= EPOLLIN | EPOLLRDNORM;
929 } 929 }
930 930
931 /* Connected sockets that can produce data can be written. */ 931 /* Connected sockets that can produce data can be written. */
@@ -935,25 +935,25 @@ static __poll_t vsock_poll(struct file *file, struct socket *sock,
935 int ret = transport->notify_poll_out( 935 int ret = transport->notify_poll_out(
936 vsk, 1, &space_avail_now); 936 vsk, 1, &space_avail_now);
937 if (ret < 0) { 937 if (ret < 0) {
938 mask |= POLLERR; 938 mask |= EPOLLERR;
939 } else { 939 } else {
940 if (space_avail_now) 940 if (space_avail_now)
941 /* Remove POLLWRBAND since INET 941 /* Remove EPOLLWRBAND since INET
942 * sockets are not setting it. 942 * sockets are not setting it.
943 */ 943 */
944 mask |= POLLOUT | POLLWRNORM; 944 mask |= EPOLLOUT | EPOLLWRNORM;
945 945
946 } 946 }
947 } 947 }
948 } 948 }
949 949
950 /* Simulate INET socket poll behaviors, which sets 950 /* Simulate INET socket poll behaviors, which sets
951 * POLLOUT|POLLWRNORM when peer is closed and nothing to read, 951 * EPOLLOUT|EPOLLWRNORM when peer is closed and nothing to read,
952 * but local send is not shutdown. 952 * but local send is not shutdown.
953 */ 953 */
954 if (sk->sk_state == TCP_CLOSE || sk->sk_state == TCP_CLOSING) { 954 if (sk->sk_state == TCP_CLOSE || sk->sk_state == TCP_CLOSING) {
955 if (!(sk->sk_shutdown & SEND_SHUTDOWN)) 955 if (!(sk->sk_shutdown & SEND_SHUTDOWN))
956 mask |= POLLOUT | POLLWRNORM; 956 mask |= EPOLLOUT | EPOLLWRNORM;
957 957
958 } 958 }
959 959
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index 4d202b73a0e1..a9428daa69f3 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -580,7 +580,7 @@ static __poll_t ns_revision_poll(struct file *file, poll_table *pt)
580 mutex_lock_nested(&rev->ns->lock, rev->ns->level); 580 mutex_lock_nested(&rev->ns->lock, rev->ns->level);
581 poll_wait(file, &rev->ns->wait, pt); 581 poll_wait(file, &rev->ns->wait, pt);
582 if (rev->last_read < rev->ns->revision) 582 if (rev->last_read < rev->ns->revision)
583 mask |= POLLIN | POLLRDNORM; 583 mask |= EPOLLIN | EPOLLRDNORM;
584 mutex_unlock(&rev->ns->lock); 584 mutex_unlock(&rev->ns->lock);
585 } 585 }
586 586
diff --git a/security/tomoyo/audit.c b/security/tomoyo/audit.c
index 558e3076d38c..479b03a7a17e 100644
--- a/security/tomoyo/audit.c
+++ b/security/tomoyo/audit.c
@@ -456,14 +456,14 @@ void tomoyo_read_log(struct tomoyo_io_buffer *head)
456 * @file: Pointer to "struct file". 456 * @file: Pointer to "struct file".
457 * @wait: Pointer to "poll_table". Maybe NULL. 457 * @wait: Pointer to "poll_table". Maybe NULL.
458 * 458 *
459 * Returns POLLIN | POLLRDNORM when ready to read an audit log. 459 * Returns EPOLLIN | EPOLLRDNORM when ready to read an audit log.
460 */ 460 */
461__poll_t tomoyo_poll_log(struct file *file, poll_table *wait) 461__poll_t tomoyo_poll_log(struct file *file, poll_table *wait)
462{ 462{
463 if (tomoyo_log_count) 463 if (tomoyo_log_count)
464 return POLLIN | POLLRDNORM; 464 return EPOLLIN | EPOLLRDNORM;
465 poll_wait(file, &tomoyo_log_wait, wait); 465 poll_wait(file, &tomoyo_log_wait, wait);
466 if (tomoyo_log_count) 466 if (tomoyo_log_count)
467 return POLLIN | POLLRDNORM; 467 return EPOLLIN | EPOLLRDNORM;
468 return 0; 468 return 0;
469} 469}
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c
index 70c73bf66c88..03923a138ef5 100644
--- a/security/tomoyo/common.c
+++ b/security/tomoyo/common.c
@@ -2116,17 +2116,17 @@ static struct tomoyo_domain_info *tomoyo_find_domain_by_qid
2116 * @file: Pointer to "struct file". 2116 * @file: Pointer to "struct file".
2117 * @wait: Pointer to "poll_table". 2117 * @wait: Pointer to "poll_table".
2118 * 2118 *
2119 * Returns POLLIN | POLLRDNORM when ready to read, 0 otherwise. 2119 * Returns EPOLLIN | EPOLLRDNORM when ready to read, 0 otherwise.
2120 * 2120 *
2121 * Waits for access requests which violated policy in enforcing mode. 2121 * Waits for access requests which violated policy in enforcing mode.
2122 */ 2122 */
2123static __poll_t tomoyo_poll_query(struct file *file, poll_table *wait) 2123static __poll_t tomoyo_poll_query(struct file *file, poll_table *wait)
2124{ 2124{
2125 if (!list_empty(&tomoyo_query_list)) 2125 if (!list_empty(&tomoyo_query_list))
2126 return POLLIN | POLLRDNORM; 2126 return EPOLLIN | EPOLLRDNORM;
2127 poll_wait(file, &tomoyo_query_wait, wait); 2127 poll_wait(file, &tomoyo_query_wait, wait);
2128 if (!list_empty(&tomoyo_query_list)) 2128 if (!list_empty(&tomoyo_query_list))
2129 return POLLIN | POLLRDNORM; 2129 return EPOLLIN | EPOLLRDNORM;
2130 return 0; 2130 return 0;
2131} 2131}
2132 2132
@@ -2450,15 +2450,15 @@ int tomoyo_open_control(const u8 type, struct file *file)
2450 * @file: Pointer to "struct file". 2450 * @file: Pointer to "struct file".
2451 * @wait: Pointer to "poll_table". Maybe NULL. 2451 * @wait: Pointer to "poll_table". Maybe NULL.
2452 * 2452 *
2453 * Returns POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM if ready to read/write, 2453 * Returns EPOLLIN | EPOLLRDNORM | EPOLLOUT | EPOLLWRNORM if ready to read/write,
2454 * POLLOUT | POLLWRNORM otherwise. 2454 * EPOLLOUT | EPOLLWRNORM otherwise.
2455 */ 2455 */
2456__poll_t tomoyo_poll_control(struct file *file, poll_table *wait) 2456__poll_t tomoyo_poll_control(struct file *file, poll_table *wait)
2457{ 2457{
2458 struct tomoyo_io_buffer *head = file->private_data; 2458 struct tomoyo_io_buffer *head = file->private_data;
2459 if (head->poll) 2459 if (head->poll)
2460 return head->poll(file, wait) | POLLOUT | POLLWRNORM; 2460 return head->poll(file, wait) | EPOLLOUT | EPOLLWRNORM;
2461 return POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM; 2461 return EPOLLIN | EPOLLRDNORM | EPOLLOUT | EPOLLWRNORM;
2462} 2462}
2463 2463
2464/** 2464/**
diff --git a/security/tomoyo/securityfs_if.c b/security/tomoyo/securityfs_if.c
index fb9bf99deb35..1d3d7e7a1f05 100644
--- a/security/tomoyo/securityfs_if.c
+++ b/security/tomoyo/securityfs_if.c
@@ -154,8 +154,8 @@ static int tomoyo_release(struct inode *inode, struct file *file)
154 * @file: Pointer to "struct file". 154 * @file: Pointer to "struct file".
155 * @wait: Pointer to "poll_table". Maybe NULL. 155 * @wait: Pointer to "poll_table". Maybe NULL.
156 * 156 *
157 * Returns POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM if ready to read/write, 157 * Returns EPOLLIN | EPOLLRDNORM | EPOLLOUT | EPOLLWRNORM if ready to read/write,
158 * POLLOUT | POLLWRNORM otherwise. 158 * EPOLLOUT | EPOLLWRNORM otherwise.
159 */ 159 */
160static __poll_t tomoyo_poll(struct file *file, poll_table *wait) 160static __poll_t tomoyo_poll(struct file *file, poll_table *wait)
161{ 161{
diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c
index a12b9555e910..4563432badba 100644
--- a/sound/core/compress_offload.c
+++ b/sound/core/compress_offload.c
@@ -399,9 +399,9 @@ static int snd_compr_mmap(struct file *f, struct vm_area_struct *vma)
399static __poll_t snd_compr_get_poll(struct snd_compr_stream *stream) 399static __poll_t snd_compr_get_poll(struct snd_compr_stream *stream)
400{ 400{
401 if (stream->direction == SND_COMPRESS_PLAYBACK) 401 if (stream->direction == SND_COMPRESS_PLAYBACK)
402 return POLLOUT | POLLWRNORM; 402 return EPOLLOUT | EPOLLWRNORM;
403 else 403 else
404 return POLLIN | POLLRDNORM; 404 return EPOLLIN | EPOLLRDNORM;
405} 405}
406 406
407static __poll_t snd_compr_poll(struct file *f, poll_table *wait) 407static __poll_t snd_compr_poll(struct file *f, poll_table *wait)
@@ -412,7 +412,7 @@ static __poll_t snd_compr_poll(struct file *f, poll_table *wait)
412 __poll_t retval = 0; 412 __poll_t retval = 0;
413 413
414 if (snd_BUG_ON(!data)) 414 if (snd_BUG_ON(!data))
415 return POLLERR; 415 return EPOLLERR;
416 416
417 stream = &data->stream; 417 stream = &data->stream;
418 418
@@ -421,7 +421,7 @@ static __poll_t snd_compr_poll(struct file *f, poll_table *wait)
421 switch (stream->runtime->state) { 421 switch (stream->runtime->state) {
422 case SNDRV_PCM_STATE_OPEN: 422 case SNDRV_PCM_STATE_OPEN:
423 case SNDRV_PCM_STATE_XRUN: 423 case SNDRV_PCM_STATE_XRUN:
424 retval = snd_compr_get_poll(stream) | POLLERR; 424 retval = snd_compr_get_poll(stream) | EPOLLERR;
425 goto out; 425 goto out;
426 default: 426 default:
427 break; 427 break;
@@ -447,7 +447,7 @@ static __poll_t snd_compr_poll(struct file *f, poll_table *wait)
447 retval = snd_compr_get_poll(stream); 447 retval = snd_compr_get_poll(stream);
448 break; 448 break;
449 default: 449 default:
450 retval = snd_compr_get_poll(stream) | POLLERR; 450 retval = snd_compr_get_poll(stream) | EPOLLERR;
451 break; 451 break;
452 } 452 }
453out: 453out:
diff --git a/sound/core/control.c b/sound/core/control.c
index 50fa16022f1f..0b3026d937b1 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -1679,7 +1679,7 @@ static __poll_t snd_ctl_poll(struct file *file, poll_table * wait)
1679 1679
1680 mask = 0; 1680 mask = 0;
1681 if (!list_empty(&ctl->events)) 1681 if (!list_empty(&ctl->events))
1682 mask |= POLLIN | POLLRDNORM; 1682 mask |= EPOLLIN | EPOLLRDNORM;
1683 1683
1684 return mask; 1684 return mask;
1685} 1685}
diff --git a/sound/core/info.c b/sound/core/info.c
index aa86f3f8e056..4b36767af9e1 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -214,9 +214,9 @@ static __poll_t snd_info_entry_poll(struct file *file, poll_table *wait)
214 data->file_private_data, 214 data->file_private_data,
215 file, wait); 215 file, wait);
216 if (entry->c.ops->read) 216 if (entry->c.ops->read)
217 mask |= POLLIN | POLLRDNORM; 217 mask |= EPOLLIN | EPOLLRDNORM;
218 if (entry->c.ops->write) 218 if (entry->c.ops->write)
219 mask |= POLLOUT | POLLWRNORM; 219 mask |= EPOLLOUT | EPOLLWRNORM;
220 return mask; 220 return mask;
221} 221}
222 222
diff --git a/sound/core/init.c b/sound/core/init.c
index 8753440c3a6e..4fa5dd955740 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -346,7 +346,7 @@ static int snd_disconnect_release(struct inode *inode, struct file *file)
346 346
347static __poll_t snd_disconnect_poll(struct file * file, poll_table * wait) 347static __poll_t snd_disconnect_poll(struct file * file, poll_table * wait)
348{ 348{
349 return POLLERR | POLLNVAL; 349 return EPOLLERR | EPOLLNVAL;
350} 350}
351 351
352static long snd_disconnect_ioctl(struct file *file, 352static long snd_disconnect_ioctl(struct file *file,
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index 3ebba9c7f86e..b044c0a5a674 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -2705,7 +2705,7 @@ static __poll_t snd_pcm_oss_poll(struct file *file, poll_table * wait)
2705 if (runtime->status->state != SNDRV_PCM_STATE_DRAINING && 2705 if (runtime->status->state != SNDRV_PCM_STATE_DRAINING &&
2706 (runtime->status->state != SNDRV_PCM_STATE_RUNNING || 2706 (runtime->status->state != SNDRV_PCM_STATE_RUNNING ||
2707 snd_pcm_oss_playback_ready(psubstream))) 2707 snd_pcm_oss_playback_ready(psubstream)))
2708 mask |= POLLOUT | POLLWRNORM; 2708 mask |= EPOLLOUT | EPOLLWRNORM;
2709 snd_pcm_stream_unlock_irq(psubstream); 2709 snd_pcm_stream_unlock_irq(psubstream);
2710 } 2710 }
2711 if (csubstream != NULL) { 2711 if (csubstream != NULL) {
@@ -2715,7 +2715,7 @@ static __poll_t snd_pcm_oss_poll(struct file *file, poll_table * wait)
2715 snd_pcm_stream_lock_irq(csubstream); 2715 snd_pcm_stream_lock_irq(csubstream);
2716 if ((ostate = runtime->status->state) != SNDRV_PCM_STATE_RUNNING || 2716 if ((ostate = runtime->status->state) != SNDRV_PCM_STATE_RUNNING ||
2717 snd_pcm_oss_capture_ready(csubstream)) 2717 snd_pcm_oss_capture_ready(csubstream))
2718 mask |= POLLIN | POLLRDNORM; 2718 mask |= EPOLLIN | EPOLLRDNORM;
2719 snd_pcm_stream_unlock_irq(csubstream); 2719 snd_pcm_stream_unlock_irq(csubstream);
2720 if (ostate != SNDRV_PCM_STATE_RUNNING && runtime->oss.trigger) { 2720 if (ostate != SNDRV_PCM_STATE_RUNNING && runtime->oss.trigger) {
2721 struct snd_pcm_oss_file ofile; 2721 struct snd_pcm_oss_file ofile;
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 51104df924e1..77ba50ddcf9e 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -3147,7 +3147,7 @@ static __poll_t snd_pcm_playback_poll(struct file *file, poll_table * wait)
3147 3147
3148 substream = pcm_file->substream; 3148 substream = pcm_file->substream;
3149 if (PCM_RUNTIME_CHECK(substream)) 3149 if (PCM_RUNTIME_CHECK(substream))
3150 return POLLOUT | POLLWRNORM | POLLERR; 3150 return EPOLLOUT | EPOLLWRNORM | EPOLLERR;
3151 runtime = substream->runtime; 3151 runtime = substream->runtime;
3152 3152
3153 poll_wait(file, &runtime->sleep, wait); 3153 poll_wait(file, &runtime->sleep, wait);
@@ -3159,7 +3159,7 @@ static __poll_t snd_pcm_playback_poll(struct file *file, poll_table * wait)
3159 case SNDRV_PCM_STATE_PREPARED: 3159 case SNDRV_PCM_STATE_PREPARED:
3160 case SNDRV_PCM_STATE_PAUSED: 3160 case SNDRV_PCM_STATE_PAUSED:
3161 if (avail >= runtime->control->avail_min) { 3161 if (avail >= runtime->control->avail_min) {
3162 mask = POLLOUT | POLLWRNORM; 3162 mask = EPOLLOUT | EPOLLWRNORM;
3163 break; 3163 break;
3164 } 3164 }
3165 /* Fall through */ 3165 /* Fall through */
@@ -3167,7 +3167,7 @@ static __poll_t snd_pcm_playback_poll(struct file *file, poll_table * wait)
3167 mask = 0; 3167 mask = 0;
3168 break; 3168 break;
3169 default: 3169 default:
3170 mask = POLLOUT | POLLWRNORM | POLLERR; 3170 mask = EPOLLOUT | EPOLLWRNORM | EPOLLERR;
3171 break; 3171 break;
3172 } 3172 }
3173 snd_pcm_stream_unlock_irq(substream); 3173 snd_pcm_stream_unlock_irq(substream);
@@ -3186,7 +3186,7 @@ static __poll_t snd_pcm_capture_poll(struct file *file, poll_table * wait)
3186 3186
3187 substream = pcm_file->substream; 3187 substream = pcm_file->substream;
3188 if (PCM_RUNTIME_CHECK(substream)) 3188 if (PCM_RUNTIME_CHECK(substream))
3189 return POLLIN | POLLRDNORM | POLLERR; 3189 return EPOLLIN | EPOLLRDNORM | EPOLLERR;
3190 runtime = substream->runtime; 3190 runtime = substream->runtime;
3191 3191
3192 poll_wait(file, &runtime->sleep, wait); 3192 poll_wait(file, &runtime->sleep, wait);
@@ -3198,19 +3198,19 @@ static __poll_t snd_pcm_capture_poll(struct file *file, poll_table * wait)
3198 case SNDRV_PCM_STATE_PREPARED: 3198 case SNDRV_PCM_STATE_PREPARED:
3199 case SNDRV_PCM_STATE_PAUSED: 3199 case SNDRV_PCM_STATE_PAUSED:
3200 if (avail >= runtime->control->avail_min) { 3200 if (avail >= runtime->control->avail_min) {
3201 mask = POLLIN | POLLRDNORM; 3201 mask = EPOLLIN | EPOLLRDNORM;
3202 break; 3202 break;
3203 } 3203 }
3204 mask = 0; 3204 mask = 0;
3205 break; 3205 break;
3206 case SNDRV_PCM_STATE_DRAINING: 3206 case SNDRV_PCM_STATE_DRAINING:
3207 if (avail > 0) { 3207 if (avail > 0) {
3208 mask = POLLIN | POLLRDNORM; 3208 mask = EPOLLIN | EPOLLRDNORM;
3209 break; 3209 break;
3210 } 3210 }
3211 /* Fall through */ 3211 /* Fall through */
3212 default: 3212 default:
3213 mask = POLLIN | POLLRDNORM | POLLERR; 3213 mask = EPOLLIN | EPOLLRDNORM | EPOLLERR;
3214 break; 3214 break;
3215 } 3215 }
3216 snd_pcm_stream_unlock_irq(substream); 3216 snd_pcm_stream_unlock_irq(substream);
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index fae21311723f..69616d00481c 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -1385,11 +1385,11 @@ static __poll_t snd_rawmidi_poll(struct file *file, poll_table * wait)
1385 mask = 0; 1385 mask = 0;
1386 if (rfile->input != NULL) { 1386 if (rfile->input != NULL) {
1387 if (snd_rawmidi_ready(rfile->input)) 1387 if (snd_rawmidi_ready(rfile->input))
1388 mask |= POLLIN | POLLRDNORM; 1388 mask |= EPOLLIN | EPOLLRDNORM;
1389 } 1389 }
1390 if (rfile->output != NULL) { 1390 if (rfile->output != NULL) {
1391 if (snd_rawmidi_ready(rfile->output)) 1391 if (snd_rawmidi_ready(rfile->output))
1392 mask |= POLLOUT | POLLWRNORM; 1392 mask |= EPOLLOUT | EPOLLWRNORM;
1393 } 1393 }
1394 return mask; 1394 return mask;
1395} 1395}
diff --git a/sound/core/seq/oss/seq_oss_rw.c b/sound/core/seq/oss/seq_oss_rw.c
index c538e78ca310..30886f5fb100 100644
--- a/sound/core/seq/oss/seq_oss_rw.c
+++ b/sound/core/seq/oss/seq_oss_rw.c
@@ -204,13 +204,13 @@ snd_seq_oss_poll(struct seq_oss_devinfo *dp, struct file *file, poll_table * wai
204 /* input */ 204 /* input */
205 if (dp->readq && is_read_mode(dp->file_mode)) { 205 if (dp->readq && is_read_mode(dp->file_mode)) {
206 if (snd_seq_oss_readq_poll(dp->readq, file, wait)) 206 if (snd_seq_oss_readq_poll(dp->readq, file, wait))
207 mask |= POLLIN | POLLRDNORM; 207 mask |= EPOLLIN | EPOLLRDNORM;
208 } 208 }
209 209
210 /* output */ 210 /* output */
211 if (dp->writeq && is_write_mode(dp->file_mode)) { 211 if (dp->writeq && is_write_mode(dp->file_mode)) {
212 if (snd_seq_kernel_client_write_poll(dp->cseq, file, wait)) 212 if (snd_seq_kernel_client_write_poll(dp->cseq, file, wait))
213 mask |= POLLOUT | POLLWRNORM; 213 mask |= EPOLLOUT | EPOLLWRNORM;
214 } 214 }
215 return mask; 215 return mask;
216} 216}
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
index b611deef81f5..60db32785f62 100644
--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -1101,7 +1101,7 @@ static __poll_t snd_seq_poll(struct file *file, poll_table * wait)
1101 1101
1102 /* check if data is available in the outqueue */ 1102 /* check if data is available in the outqueue */
1103 if (snd_seq_fifo_poll_wait(client->data.user.fifo, file, wait)) 1103 if (snd_seq_fifo_poll_wait(client->data.user.fifo, file, wait))
1104 mask |= POLLIN | POLLRDNORM; 1104 mask |= EPOLLIN | EPOLLRDNORM;
1105 } 1105 }
1106 1106
1107 if (snd_seq_file_flags(file) & SNDRV_SEQ_LFLG_OUTPUT) { 1107 if (snd_seq_file_flags(file) & SNDRV_SEQ_LFLG_OUTPUT) {
@@ -1109,7 +1109,7 @@ static __poll_t snd_seq_poll(struct file *file, poll_table * wait)
1109 /* check if data is available in the pool */ 1109 /* check if data is available in the pool */
1110 if (!snd_seq_write_pool_allocated(client) || 1110 if (!snd_seq_write_pool_allocated(client) ||
1111 snd_seq_pool_poll_wait(client->pool, file, wait)) 1111 snd_seq_pool_poll_wait(client->pool, file, wait))
1112 mask |= POLLOUT | POLLWRNORM; 1112 mask |= EPOLLOUT | EPOLLWRNORM;
1113 } 1113 }
1114 1114
1115 return mask; 1115 return mask;
diff --git a/sound/core/timer.c b/sound/core/timer.c
index da05e314917f..dc87728c5b74 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -2084,9 +2084,9 @@ static __poll_t snd_timer_user_poll(struct file *file, poll_table * wait)
2084 mask = 0; 2084 mask = 0;
2085 spin_lock_irq(&tu->qlock); 2085 spin_lock_irq(&tu->qlock);
2086 if (tu->qused) 2086 if (tu->qused)
2087 mask |= POLLIN | POLLRDNORM; 2087 mask |= EPOLLIN | EPOLLRDNORM;
2088 if (tu->disconnected) 2088 if (tu->disconnected)
2089 mask |= POLLERR; 2089 mask |= EPOLLERR;
2090 spin_unlock_irq(&tu->qlock); 2090 spin_unlock_irq(&tu->qlock);
2091 2091
2092 return mask; 2092 return mask;
diff --git a/sound/firewire/bebob/bebob_hwdep.c b/sound/firewire/bebob/bebob_hwdep.c
index 83e791810c52..04c321e08c62 100644
--- a/sound/firewire/bebob/bebob_hwdep.c
+++ b/sound/firewire/bebob/bebob_hwdep.c
@@ -63,7 +63,7 @@ hwdep_poll(struct snd_hwdep *hwdep, struct file *file, poll_table *wait)
63 63
64 spin_lock_irq(&bebob->lock); 64 spin_lock_irq(&bebob->lock);
65 if (bebob->dev_lock_changed) 65 if (bebob->dev_lock_changed)
66 events = POLLIN | POLLRDNORM; 66 events = EPOLLIN | EPOLLRDNORM;
67 else 67 else
68 events = 0; 68 events = 0;
69 spin_unlock_irq(&bebob->lock); 69 spin_unlock_irq(&bebob->lock);
diff --git a/sound/firewire/dice/dice-hwdep.c b/sound/firewire/dice/dice-hwdep.c
index 7a8af0f91c96..6498bf6909ba 100644
--- a/sound/firewire/dice/dice-hwdep.c
+++ b/sound/firewire/dice/dice-hwdep.c
@@ -62,7 +62,7 @@ static __poll_t hwdep_poll(struct snd_hwdep *hwdep, struct file *file,
62 62
63 spin_lock_irq(&dice->lock); 63 spin_lock_irq(&dice->lock);
64 if (dice->dev_lock_changed || dice->notification_bits != 0) 64 if (dice->dev_lock_changed || dice->notification_bits != 0)
65 events = POLLIN | POLLRDNORM; 65 events = EPOLLIN | EPOLLRDNORM;
66 else 66 else
67 events = 0; 67 events = 0;
68 spin_unlock_irq(&dice->lock); 68 spin_unlock_irq(&dice->lock);
diff --git a/sound/firewire/digi00x/digi00x-hwdep.c b/sound/firewire/digi00x/digi00x-hwdep.c
index a084c2a834db..426cd39e0233 100644
--- a/sound/firewire/digi00x/digi00x-hwdep.c
+++ b/sound/firewire/digi00x/digi00x-hwdep.c
@@ -70,7 +70,7 @@ static __poll_t hwdep_poll(struct snd_hwdep *hwdep, struct file *file,
70 70
71 spin_lock_irq(&dg00x->lock); 71 spin_lock_irq(&dg00x->lock);
72 if (dg00x->dev_lock_changed || dg00x->msg) 72 if (dg00x->dev_lock_changed || dg00x->msg)
73 events = POLLIN | POLLRDNORM; 73 events = EPOLLIN | EPOLLRDNORM;
74 else 74 else
75 events = 0; 75 events = 0;
76 spin_unlock_irq(&dg00x->lock); 76 spin_unlock_irq(&dg00x->lock);
diff --git a/sound/firewire/fireface/ff-hwdep.c b/sound/firewire/fireface/ff-hwdep.c
index 68e273fa5d23..336c0076ec42 100644
--- a/sound/firewire/fireface/ff-hwdep.c
+++ b/sound/firewire/fireface/ff-hwdep.c
@@ -62,7 +62,7 @@ static __poll_t hwdep_poll(struct snd_hwdep *hwdep, struct file *file,
62 62
63 spin_lock_irq(&ff->lock); 63 spin_lock_irq(&ff->lock);
64 if (ff->dev_lock_changed) 64 if (ff->dev_lock_changed)
65 events = POLLIN | POLLRDNORM; 65 events = EPOLLIN | EPOLLRDNORM;
66 else 66 else
67 events = 0; 67 events = 0;
68 spin_unlock_irq(&ff->lock); 68 spin_unlock_irq(&ff->lock);
diff --git a/sound/firewire/fireworks/fireworks_hwdep.c b/sound/firewire/fireworks/fireworks_hwdep.c
index e0eff9328ee1..5cac26ab20b7 100644
--- a/sound/firewire/fireworks/fireworks_hwdep.c
+++ b/sound/firewire/fireworks/fireworks_hwdep.c
@@ -194,12 +194,12 @@ hwdep_poll(struct snd_hwdep *hwdep, struct file *file, poll_table *wait)
194 194
195 spin_lock_irq(&efw->lock); 195 spin_lock_irq(&efw->lock);
196 if (efw->dev_lock_changed || efw->pull_ptr != efw->push_ptr) 196 if (efw->dev_lock_changed || efw->pull_ptr != efw->push_ptr)
197 events = POLLIN | POLLRDNORM; 197 events = EPOLLIN | EPOLLRDNORM;
198 else 198 else
199 events = 0; 199 events = 0;
200 spin_unlock_irq(&efw->lock); 200 spin_unlock_irq(&efw->lock);
201 201
202 return events | POLLOUT; 202 return events | EPOLLOUT;
203} 203}
204 204
205static int 205static int
diff --git a/sound/firewire/motu/motu-hwdep.c b/sound/firewire/motu/motu-hwdep.c
index 7b6a086866e7..5f772eab588b 100644
--- a/sound/firewire/motu/motu-hwdep.c
+++ b/sound/firewire/motu/motu-hwdep.c
@@ -69,12 +69,12 @@ static __poll_t hwdep_poll(struct snd_hwdep *hwdep, struct file *file,
69 69
70 spin_lock_irq(&motu->lock); 70 spin_lock_irq(&motu->lock);
71 if (motu->dev_lock_changed || motu->msg) 71 if (motu->dev_lock_changed || motu->msg)
72 events = POLLIN | POLLRDNORM; 72 events = EPOLLIN | EPOLLRDNORM;
73 else 73 else
74 events = 0; 74 events = 0;
75 spin_unlock_irq(&motu->lock); 75 spin_unlock_irq(&motu->lock);
76 76
77 return events | POLLOUT; 77 return events | EPOLLOUT;
78} 78}
79 79
80static int hwdep_get_info(struct snd_motu *motu, void __user *arg) 80static int hwdep_get_info(struct snd_motu *motu, void __user *arg)
diff --git a/sound/firewire/oxfw/oxfw-hwdep.c b/sound/firewire/oxfw/oxfw-hwdep.c
index 6c1828aff672..50a1c03b42b9 100644
--- a/sound/firewire/oxfw/oxfw-hwdep.c
+++ b/sound/firewire/oxfw/oxfw-hwdep.c
@@ -62,7 +62,7 @@ static __poll_t hwdep_poll(struct snd_hwdep *hwdep, struct file *file,
62 62
63 spin_lock_irq(&oxfw->lock); 63 spin_lock_irq(&oxfw->lock);
64 if (oxfw->dev_lock_changed) 64 if (oxfw->dev_lock_changed)
65 events = POLLIN | POLLRDNORM; 65 events = EPOLLIN | EPOLLRDNORM;
66 else 66 else
67 events = 0; 67 events = 0;
68 spin_unlock_irq(&oxfw->lock); 68 spin_unlock_irq(&oxfw->lock);
diff --git a/sound/firewire/tascam/tascam-hwdep.c b/sound/firewire/tascam/tascam-hwdep.c
index 37b21647b471..4e4c1e9020e8 100644
--- a/sound/firewire/tascam/tascam-hwdep.c
+++ b/sound/firewire/tascam/tascam-hwdep.c
@@ -60,7 +60,7 @@ static __poll_t hwdep_poll(struct snd_hwdep *hwdep, struct file *file,
60 60
61 spin_lock_irq(&tscm->lock); 61 spin_lock_irq(&tscm->lock);
62 if (tscm->dev_lock_changed) 62 if (tscm->dev_lock_changed)
63 events = POLLIN | POLLRDNORM; 63 events = EPOLLIN | EPOLLRDNORM;
64 else 64 else
65 events = 0; 65 events = 0;
66 spin_unlock_irq(&tscm->lock); 66 spin_unlock_irq(&tscm->lock);
diff --git a/sound/oss/dmasound/dmasound_core.c b/sound/oss/dmasound/dmasound_core.c
index 6b57f8aac1b7..8c0f8a9ee0ba 100644
--- a/sound/oss/dmasound/dmasound_core.c
+++ b/sound/oss/dmasound/dmasound_core.c
@@ -684,7 +684,7 @@ static __poll_t sq_poll(struct file *file, struct poll_table_struct *wait)
684 poll_wait(file, &write_sq.action_queue, wait); 684 poll_wait(file, &write_sq.action_queue, wait);
685 if (file->f_mode & FMODE_WRITE) 685 if (file->f_mode & FMODE_WRITE)
686 if (write_sq.count < write_sq.max_active || write_sq.block_size - write_sq.rear_size > 0) 686 if (write_sq.count < write_sq.max_active || write_sq.block_size - write_sq.rear_size > 0)
687 mask |= POLLOUT | POLLWRNORM; 687 mask |= EPOLLOUT | EPOLLWRNORM;
688 return mask; 688 return mask;
689 689
690} 690}
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c
index 05ccc7fdcc09..56537a156580 100644
--- a/sound/usb/mixer_quirks.c
+++ b/sound/usb/mixer_quirks.c
@@ -246,7 +246,7 @@ static __poll_t snd_usb_sbrc_hwdep_poll(struct snd_hwdep *hw, struct file *file,
246 struct usb_mixer_interface *mixer = hw->private_data; 246 struct usb_mixer_interface *mixer = hw->private_data;
247 247
248 poll_wait(file, &mixer->rc_waitq, wait); 248 poll_wait(file, &mixer->rc_waitq, wait);
249 return mixer->rc_code ? POLLIN | POLLRDNORM : 0; 249 return mixer->rc_code ? EPOLLIN | EPOLLRDNORM : 0;
250} 250}
251 251
252static int snd_usb_soundblaster_remote_init(struct usb_mixer_interface *mixer) 252static int snd_usb_soundblaster_remote_init(struct usb_mixer_interface *mixer)
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c
index e2be10d17118..ebcab5c5465d 100644
--- a/sound/usb/usx2y/us122l.c
+++ b/sound/usb/usx2y/us122l.c
@@ -280,7 +280,7 @@ static __poll_t usb_stream_hwdep_poll(struct snd_hwdep *hw,
280 280
281 poll_wait(file, &us122l->sk.sleep, wait); 281 poll_wait(file, &us122l->sk.sleep, wait);
282 282
283 mask = POLLIN | POLLOUT | POLLWRNORM | POLLERR; 283 mask = EPOLLIN | EPOLLOUT | EPOLLWRNORM | EPOLLERR;
284 if (mutex_trylock(&us122l->mutex)) { 284 if (mutex_trylock(&us122l->mutex)) {
285 struct usb_stream *s = us122l->sk.s; 285 struct usb_stream *s = us122l->sk.s;
286 if (s && s->state == usb_stream_ready) { 286 if (s && s->state == usb_stream_ready) {
@@ -290,7 +290,7 @@ static __poll_t usb_stream_hwdep_poll(struct snd_hwdep *hw,
290 polled = &us122l->second_periods_polled; 290 polled = &us122l->second_periods_polled;
291 if (*polled != s->periods_done) { 291 if (*polled != s->periods_done) {
292 *polled = s->periods_done; 292 *polled = s->periods_done;
293 mask = POLLIN | POLLOUT | POLLWRNORM; 293 mask = EPOLLIN | EPOLLOUT | EPOLLWRNORM;
294 } else 294 } else
295 mask = 0; 295 mask = 0;
296 } 296 }
diff --git a/sound/usb/usx2y/usX2Yhwdep.c b/sound/usb/usx2y/usX2Yhwdep.c
index 07d15bae75bc..d8bd7c99b48c 100644
--- a/sound/usb/usx2y/usX2Yhwdep.c
+++ b/sound/usb/usx2y/usX2Yhwdep.c
@@ -92,12 +92,12 @@ static __poll_t snd_us428ctls_poll(struct snd_hwdep *hw, struct file *file, poll
92 struct usX2Ydev *us428 = hw->private_data; 92 struct usX2Ydev *us428 = hw->private_data;
93 struct us428ctls_sharedmem *shm = us428->us428ctls_sharedmem; 93 struct us428ctls_sharedmem *shm = us428->us428ctls_sharedmem;
94 if (us428->chip_status & USX2Y_STAT_CHIP_HUP) 94 if (us428->chip_status & USX2Y_STAT_CHIP_HUP)
95 return POLLHUP; 95 return EPOLLHUP;
96 96
97 poll_wait(file, &us428->us428ctls_wait_queue_head, wait); 97 poll_wait(file, &us428->us428ctls_wait_queue_head, wait);
98 98
99 if (shm != NULL && shm->CtlSnapShotLast != shm->CtlSnapShotRed) 99 if (shm != NULL && shm->CtlSnapShotLast != shm->CtlSnapShotRed)
100 mask |= POLLIN; 100 mask |= EPOLLIN;
101 101
102 return mask; 102 return mask;
103} 103}
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
index a334399fafec..6e865e8b5b10 100644
--- a/virt/kvm/eventfd.c
+++ b/virt/kvm/eventfd.c
@@ -194,7 +194,7 @@ irqfd_wakeup(wait_queue_entry_t *wait, unsigned mode, int sync, void *key)
194 unsigned seq; 194 unsigned seq;
195 int idx; 195 int idx;
196 196
197 if (flags & POLLIN) { 197 if (flags & EPOLLIN) {
198 idx = srcu_read_lock(&kvm->irq_srcu); 198 idx = srcu_read_lock(&kvm->irq_srcu);
199 do { 199 do {
200 seq = read_seqcount_begin(&irqfd->irq_entry_sc); 200 seq = read_seqcount_begin(&irqfd->irq_entry_sc);
@@ -208,7 +208,7 @@ irqfd_wakeup(wait_queue_entry_t *wait, unsigned mode, int sync, void *key)
208 srcu_read_unlock(&kvm->irq_srcu, idx); 208 srcu_read_unlock(&kvm->irq_srcu, idx);
209 } 209 }
210 210
211 if (flags & POLLHUP) { 211 if (flags & EPOLLHUP) {
212 /* The eventfd is closing, detach from KVM */ 212 /* The eventfd is closing, detach from KVM */
213 unsigned long flags; 213 unsigned long flags;
214 214
@@ -399,12 +399,12 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args)
399 */ 399 */
400 events = f.file->f_op->poll(f.file, &irqfd->pt); 400 events = f.file->f_op->poll(f.file, &irqfd->pt);
401 401
402 if (events & POLLIN) 402 if (events & EPOLLIN)
403 schedule_work(&irqfd->inject); 403 schedule_work(&irqfd->inject);
404 404
405 /* 405 /*
406 * do not drop the file until the irqfd is fully initialized, otherwise 406 * do not drop the file until the irqfd is fully initialized, otherwise
407 * we might race against the POLLHUP 407 * we might race against the EPOLLHUP
408 */ 408 */
409 fdput(f); 409 fdput(f);
410#ifdef CONFIG_HAVE_KVM_IRQ_BYPASS 410#ifdef CONFIG_HAVE_KVM_IRQ_BYPASS