]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - drivers/usb/mon/mon_bin.c
USB: gadget: functionfs: stale Makefile entry removed
[mirror_ubuntu-jammy-kernel.git] / drivers / usb / mon / mon_bin.c
index ddf7f9a1b3362c37178ac2cccc9f81f828d7bfcd..1be0b9f933662b59ba32e4b1e96e57df9e110017 100644 (file)
@@ -416,13 +416,13 @@ static unsigned int mon_bin_get_data(const struct mon_reader_bin *rp,
 
        } else {
                /* If IOMMU coalescing occurred, we cannot trust sg_page */
-               if (urb->sg->nents != urb->num_sgs) {
+               if (urb->transfer_flags & URB_DMA_SG_COMBINED) {
                        *flag = 'D';
                        return length;
                }
 
                /* Copy up to the first non-addressable segment */
-               for_each_sg(urb->sg->sg, sg, urb->num_sgs, i) {
+               for_each_sg(urb->sg, sg, urb->num_sgs, i) {
                        if (length == 0 || PageHighMem(sg_page(sg)))
                                break;
                        this_len = min_t(unsigned int, sg->length, length);
@@ -646,17 +646,14 @@ static int mon_bin_open(struct inode *inode, struct file *file)
        size_t size;
        int rc;
 
-       lock_kernel();
        mutex_lock(&mon_lock);
        if ((mbus = mon_bus_lookup(iminor(inode))) == NULL) {
                mutex_unlock(&mon_lock);
-               unlock_kernel();
                return -ENODEV;
        }
        if (mbus != &mon_bus0 && mbus->u_bus == NULL) {
                printk(KERN_ERR TAG ": consistency error on open\n");
                mutex_unlock(&mon_lock);
-               unlock_kernel();
                return -ENODEV;
        }
 
@@ -689,7 +686,6 @@ static int mon_bin_open(struct inode *inode, struct file *file)
 
        file->private_data = rp;
        mutex_unlock(&mon_lock);
-       unlock_kernel();
        return 0;
 
 err_allocbuff:
@@ -698,7 +694,6 @@ err_allocvec:
        kfree(rp);
 err_alloc:
        mutex_unlock(&mon_lock);
-       unlock_kernel();
        return rc;
 }
 
@@ -954,8 +949,7 @@ static int mon_bin_queued(struct mon_reader_bin *rp)
 
 /*
  */
-static int mon_bin_ioctl(struct inode *inode, struct file *file,
-    unsigned int cmd, unsigned long arg)
+static long mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
        struct mon_reader_bin *rp = file->private_data;
        // struct mon_bus* mbus = rp->r.m_bus;
@@ -1148,14 +1142,13 @@ static long mon_bin_compat_ioctl(struct file *file,
                return 0;
 
        case MON_IOCG_STATS:
-               return mon_bin_ioctl(NULL, file, cmd,
-                                           (unsigned long) compat_ptr(arg));
+               return mon_bin_ioctl(file, cmd, (unsigned long) compat_ptr(arg));
 
        case MON_IOCQ_URB_LEN:
        case MON_IOCQ_RING_SIZE:
        case MON_IOCT_RING_SIZE:
        case MON_IOCH_MFLUSH:
-               return mon_bin_ioctl(NULL, file, cmd, arg);
+               return mon_bin_ioctl(file, cmd, arg);
 
        default:
                ;
@@ -1239,7 +1232,7 @@ static const struct file_operations mon_fops_binary = {
        .read =         mon_bin_read,
        /* .write =     mon_text_write, */
        .poll =         mon_bin_poll,
-       .ioctl =        mon_bin_ioctl,
+       .unlocked_ioctl = mon_bin_ioctl,
 #ifdef CONFIG_COMPAT
        .compat_ioctl = mon_bin_compat_ioctl,
 #endif