firewire: nosy: simplify grabbing context pointer in open()
RFC PATCH 1/1 firewire: nosy: simplify grabbing context pointer in open()
Signed-off-by Martin Kepplinger <[email protected]>
---
This is a question: What's the real difference between the two solutions? I'm not sure if they are equivalent :(
drivers/firewire/nosy.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/firewire/nosy.c +3 -7
@@ -275,16 +275,12 @@ set_phy_reg(struct pcilynx *lynx, int addr, int val)static int nosy_open (struct inode *inode,struct file *file) { -int minor =iminor (inode);struct client *client; -struct pcilynx *tmp, *lynx =NULL ; +struct pcilynx *lynx =NULL ;mutex_lock (&card_mutex); -list_for_each_entry (tmp, &card_list, link) -if (tmp->misc.minor == minor) { - lynx =lynx_get (tmp); -break ; - } + lynx = container_of(file->private_data, struct pcilynx, misc); + lynx =lynx_get (lynx);mutex_unlock (&card_mutex);if (lynx ==NULL )return -ENODEV ;
Signature · 1 line
2.1.4