convert some DMA_nnBIT_MASK() callers
[firefly-linux-kernel-4.4.55.git] / drivers / ieee1394 / ieee1394_core.h
index 11fd324ee045c150a5a647e9f10024410bba9f1c..28b9f58bafd25963232c9de7d3e704d1084a6f49 100644 (file)
@@ -5,6 +5,7 @@
 #include <linux/fs.h>
 #include <linux/list.h>
 #include <linux/types.h>
+#include <linux/cdev.h>
 #include <asm/atomic.h>
 
 #include "hosts.h"
@@ -24,9 +25,8 @@ struct hpsb_packet {
 
        nodeid_t node_id;
 
-       /* Async and Iso types should be clear, raw means send-as-is, do not
-        * CRC!  Byte swapping shall still be done in this case. */
-       enum { hpsb_async, hpsb_iso, hpsb_raw } __attribute__((packed)) type;
+       /* hpsb_raw = send as-is, do not CRC (but still byte-swap it) */
+       enum { hpsb_async, hpsb_raw } __attribute__((packed)) type;
 
        /* Okay, this is core internal and a no care for hosts.
         * queued   = queued for sending
@@ -156,7 +156,10 @@ void hpsb_packet_received(struct hpsb_host *host, quadlet_t *data, size_t size,
  */
 static inline unsigned char ieee1394_file_to_instance(struct file *file)
 {
-       return file->f_path.dentry->d_inode->i_cindex;
+       int idx = cdev_index(file->f_path.dentry->d_inode);
+       if (idx < 0)
+               idx = 0;
+       return idx;
 }
 
 extern int hpsb_disable_irm;