From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: "Ha, Tristram" <Tristram.Ha@Micrel.Com>
Cc: "Dave Miller" <davem@davemloft.net>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2.6.33 1/3] net: Micrel KSZ8841/2 PCI Ethernet driver
Date: Tue, 19 Jan 2010 21:32:14 +0000 [thread overview]
Message-ID: <20100119213214.024b7794@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <14385191E87B904DBD836449AA30269D580A93@MORGANITE.micrel.com>
> >> +#define PCI_VENDOR_ID_KS884X 0x16C6
> >> +#define PCI_DEVICE_ID_KS8841 0x8841
> >> +#define PCI_DEVICE_ID_KS8842 0x8842
> >
> > Those belong in the pci device id header.
> >
> >
>
> I do not quite understand your suggestion. Do I need to put those IDs
> in one of the kernel headers?
Into include/linux/pci_ids.h
> >> + hw->pdev = pdev;
> >
> >
> > If you make a private copy of pdev in your struct you should refcount
> it and use
> > pci_dev_get/pci_dev_put when you take and release the reference.
> I do not understand how pci_dev_get/pci_dev_put work. Does the pdev
> pointer actually change during the lifetime of the PCI driver?
No but it can go away if the device is removed. The pci_dev_get ensures
it won't go away while you have a pointer to it. and the pci_dev_put
gives up your reference.
> I also like the attribute to associate with the network device rather
> than the PCI device, as the KSZ8842 driver can create another virtual
> network device. I tried to pass the device pointer of the network
> device to device_create_file function and the driver crashed. I will
> investigate this matter further.
Ok
next prev parent reply other threads:[~2010-01-19 21:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-16 2:57 [PATCH 2.6.33 1/3] net: Micrel KSZ8841/2 PCI Ethernet driver Ha, Tristram
2010-01-16 9:20 ` David Miller
2010-01-19 20:03 ` Ha, Tristram
2010-01-19 21:40 ` Stephen Hemminger
2010-01-19 23:48 ` Ha, Tristram
2010-01-20 0:11 ` Stephen Hemminger
2010-01-20 0:34 ` Ha, Tristram
2010-01-20 0:50 ` Stephen Hemminger
2010-01-16 14:50 ` Alan Cox
2010-01-19 21:22 ` Ha, Tristram
2010-01-19 21:32 ` Alan Cox [this message]
2010-01-20 0:12 ` Ha, Tristram
2010-01-16 16:00 ` Michał Mirosław
2010-01-16 16:16 ` Felix Fietkau
2010-01-19 21:51 ` Ha, Tristram
2010-01-19 22:11 ` Felix Fietkau
2010-02-08 21:36 Ha, Tristram
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=20100119213214.024b7794@lxorguk.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=Tristram.Ha@Micrel.Com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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).