Thread (11 messages) 11 messages, 3 authors, 2012-03-20

Re: [PATCH v2 3/4] libfcoe: Add fcoe_sysfs

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2012-03-20 21:01:56

On Sat, Mar 17, 2012 at 01:12:10AM +0000, Love, Robert W wrote:
quoted
quoted
+	ctlr->f = f;
+	INIT_LIST_HEAD(&ctlr->fcfs);
+	mutex_init(&ctlr->lock);
+	device_initialize(&ctlr->dev);
+	ctlr->dev.parent = get_device(parent);
I thought you dropped these get_device() calls on the parent?  The
driver core handles this for you, please don't do it here, it's not
needed.
How would the driver core know what this device's parent is? This is the 
only place I do that assignment.
I'm not saying that assigning the parent is wrong, I'm saying you don't
need to grab the reference to the parent here.

The code should just be:
	ctrl->dev.parent = parent;

When you register the device, the parent will be properly reference
counted.

thanks,

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help