linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: long <tlnguyen@snoqualmie.dp.intel.com>
Cc: linux-kernel@vger.kernel.org, tom.l.nguyen@intel.com
Subject: Re: [PATCH] PCI: add PCI Express Port Bus Driver subsystem
Date: Tue, 18 Jan 2005 10:36:33 -0800	[thread overview]
Message-ID: <20050118183633.GA13783@kroah.com> (raw)
In-Reply-To: <200501181928.j0IJSvVv023915@snoqualmie.dp.intel.com>

On Tue, Jan 18, 2005 at 11:28:57AM -0800, long wrote:
> On Mon, 17 Jan 2005 15:49:08 -0800 Greg KH wrote:
> > > +int pcie_port_device_register(struct pci_dev *dev)
> > > +{
> > > +	struct pcie_device *parent;
> > > +	int status, type, capabilities, irq_mode, i;
> > > +	int vectors[PCIE_PORT_DEVICE_MAXSERVICES];
> > > +	u16 reg16;
> > > +
> > > +	/* Get port type */
> > > +	pci_read_config_word(dev, 
> > > +		pci_find_capability(dev, PCI_CAP_ID_EXP) + 
> > > +		PCIE_CAPABILITIES_REG, &reg16);
> > > +	type = (reg16 >> 4) & PORT_TYPE_MASK;
> > > +
> > > +	/* Now get port services */
> > > +	capabilities = get_port_device_capability(dev);
> > > +	irq_mode = assign_interrupt_mode(dev, vectors, capabilities);
> > > +
> > > +	/* Allocate parent */
> > > +	parent = alloc_pcie_device(NULL, dev, type, 0, dev->irq, irq_mode);
> > > +	if (!parent) 
> > > +		return -ENOMEM;
> > > +	
> > > +	status = device_register(&parent->device);
> > > +	if (status) {
> > > +		kfree(parent);
> > > +		return status;
> > > +	}
> >
> >
> > This puts all of the pcie "port" structures in /sys/devices/  Shouldn't
> > you make the parent of the device you create point to the pci_dev
> > structure that's passed into this function?  That would make the sysfs
> > tree a lot saner I think.
> 
> The patch makes the parent of the device point to the pci_dev structure
> that is passed into this function. If you think it is cleaner that the
> patch should not, I will update the patch to reflect your input.

That would be great, but it doesn't show up that way on my box.  All of
the portX devices are in /sys/devices/ which is what I don't think you
want.  I would love for them to have the parent of the pci_dev structure
:)

thanks,

greg k-h

  reply	other threads:[~2005-01-18 18:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-18 19:28 Re:[PATCH] PCI: add PCI Express Port Bus Driver subsystem long
2005-01-18 18:36 ` Greg KH [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-01-24 20:10 long
2005-02-01  7:39 ` [PATCH] " Greg KH
2005-01-19  1:59 long
2005-01-19  1:03 ` [PATCH] " Greg KH
2005-01-17 22:01 [BK PATCH] PCI fixes and PCI Express drivers for 2.6.11-rc1 Greg KH
2005-01-17 22:01 ` [PATCH] PCI: add PCI Express Port Bus Driver subsystem Greg KH
2005-01-17 23:49   ` Greg KH

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=20050118183633.GA13783@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tlnguyen@snoqualmie.dp.intel.com \
    --cc=tom.l.nguyen@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).