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