aboutsummaryrefslogtreecommitdiff
path: root/drivers/firewire/fw-device-cdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firewire/fw-device-cdev.c')
-rw-r--r--drivers/firewire/fw-device-cdev.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/firewire/fw-device-cdev.c b/drivers/firewire/fw-device-cdev.c
index d9f3bb2be1c..54ef27b2adb 100644
--- a/drivers/firewire/fw-device-cdev.c
+++ b/drivers/firewire/fw-device-cdev.c
@@ -28,6 +28,7 @@
#include <linux/poll.h>
#include <linux/delay.h>
#include <linux/mm.h>
+#include <linux/idr.h>
#include <linux/compat.h>
#include <asm/uaccess.h>
#include "fw-transaction.h"
@@ -103,7 +104,9 @@ static int fw_device_op_open(struct inode *inode, struct file *file)
struct client *client;
unsigned long flags;
- device = container_of(inode->i_cdev, struct fw_device, cdev);
+ device = fw_device_from_devt(inode->i_rdev);
+ if (device == NULL)
+ return -ENODEV;
client = kzalloc(sizeof *client, GFP_KERNEL);
if (client == NULL)