All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: "Love, Robert W" <robert.w.love@intel.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"giridhar.malavali@qlogic.com" <giridhar.malavali@qlogic.com>,
	"james.smart@emulex.com" <james.smart@emulex.com>,
	"bprakash@broadcom.com" <bprakash@broadcom.com>
Subject: Re: [PATCH v2 3/4] libfcoe: Add fcoe_sysfs
Date: Tue, 20 Mar 2012 14:01:50 -0700	[thread overview]
Message-ID: <20120320210150.GA18136@kroah.com> (raw)
In-Reply-To: <4F63E4E9.2010504@intel.com>

On Sat, Mar 17, 2012 at 01:12:10AM +0000, Love, Robert W wrote:
> >> +	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

  parent reply	other threads:[~2012-03-20 21:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-16 19:36 [PATCH v2 0/4] FCoE Sysfs Robert Love
2012-03-16 19:36 ` [PATCH v2 1/4] fcoe: Allocate fcoe_ctlr with fcoe_interface, not as a member Robert Love
2012-03-16 19:36 ` [PATCH v2 2/4] bnx2fc: Allocate fcoe_ctlr with bnx2fc_interface, " Robert Love
2012-03-16 19:36 ` [PATCH v2 3/4] libfcoe: Add fcoe_sysfs Robert Love
2012-03-17  0:25   ` Greg KH
2012-03-17  1:12     ` Love, Robert W
2012-03-17  9:07       ` James Bottomley
2012-03-20 21:01       ` Greg KH [this message]
2012-03-20  1:23     ` Love, Robert W
2012-03-20 21:05       ` Greg KH
2012-03-16 19:37 ` [PATCH v2 4/4] fcoe, bnx2fc, libfcoe: SW FCoE and bnx2fc use FCoE Syfs Robert Love

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120320210150.GA18136@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=bprakash@broadcom.com \
    --cc=giridhar.malavali@qlogic.com \
    --cc=james.smart@emulex.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=robert.w.love@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.