drm/i915: Improve CRTDDC mapping by using VBT info
[safe/jmp/linux-2.6] / drivers / ieee1394 / ieee1394_core.h
index 21d50f7..28b9f58 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"
@@ -155,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;