public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rolf Eike Beer <eike-kernel@sf-tec.de>
To: akataria@vmware.com
Cc: James Bottomley <James.Bottomley@hansenpartnership.com>,
	Robert Love <robert.w.love@intel.com>,
	Randy Dunlap <randy.dunlap@oracle.com>,
	Mike Christie <michaelc@cs.wisc.edu>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Dmitry Torokhov <dtor@vmware.com>,
	Maxime Austruy <maustruy@vmware.com>
Subject: Re: [PATCH] SCSI driver for VMware's virtual HBA.
Date: Mon, 31 Aug 2009 20:51:18 +0200	[thread overview]
Message-ID: <200908312051.26264.eike-kernel@sf-tec.de> (raw)
In-Reply-To: <1251739571.16169.17.camel@ank32.eng.vmware.com>

[-- Attachment #1: Type: Text/Plain, Size: 1569 bytes --]

Alok Kataria wrote:
> Hi Eike,

> > > +static int __devinit pvscsi_probe(struct pci_dev *pdev,
> > > +				  const struct pci_device_id *id)
> > > +{
> > > +	struct pvscsi_adapter *adapter;
> > > +	struct Scsi_Host *host;
> > > +	unsigned long base, i;
> > > +	int error;
> > > +
> > > +	error = -ENODEV;
> > > +
> > > +	if (pci_enable_device(pdev))
> > > +		return error;
> >
> > As always I suggest having a look on devres (see Documentation/driver-
> > model/devres.txt) which could simplify your error handling here and your
> > release function a lot. You only need to make sure it doesn't hurt if all
> > the PCI resources are freed after the scsi ones as you would end up
> > cleaning the scsi ones by hand and afterwards devres would throw all it
> > handles (which will probably be most of your PCI stuff) away itself.
>
> I took a quick look, but would prefer not to change this right now. Will
> do this as a incremental change later. Hope that is fine.

Just a suggestion ;)

> > > +	adapter->dev  = pdev;
> > > +	adapter->host = host;
> > > +
> > > +	spin_lock_init(&adapter->hw_lock);
> > > +
> > > +	host->max_channel = 0;
> > > +	host->max_id      = 16;
> > > +	host->max_lun     = 1;
> > > +
> > > +	pci_read_config_byte(pdev, PCI_CLASS_REVISION, &adapter->rev);
> >
> > That's in pdev->revision anyway, isn't it?
>
> Yep, though, its needed in pvscsi_info, so will keep this in adapter
> too.

Yes, but you don't need to do pci_read_config_byte() but simply copying that 
over from pdev->revision.

Eike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2009-08-31 18:51 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-27 23:17 [PATCH] SCSI driver for VMware's virtual HBA Alok Kataria
2009-08-28  6:03 ` Rolf Eike Beer
2009-08-31 17:26   ` Alok Kataria
2009-08-31 18:51     ` Rolf Eike Beer [this message]
2009-08-31 21:54       ` Alok Kataria
2009-08-28 21:18 ` Chetan.Loke
2009-08-28 22:30   ` Alok Kataria
2009-08-29 12:04     ` Chetan.Loke
2009-08-31 22:35       ` Alok Kataria
2009-08-31 17:28 ` Alok Kataria
2009-08-31 18:00   ` James Bottomley
2009-08-31 21:53     ` Alok Kataria
2009-09-01 14:23       ` James Bottomley
2009-09-01 16:08         ` Alok Kataria
2009-09-01 16:13           ` Matthew Wilcox
2009-09-01 16:20             ` Boaz Harrosh
2009-09-01 16:47               ` Alok Kataria
2009-09-01 14:26       ` James Bottomley
2009-09-01 11:12     ` Bart Van Assche
2009-09-01 14:17       ` James Bottomley
2009-09-01 16:12       ` Roland Dreier
2009-09-01 16:16         ` Matthew Wilcox
2009-09-01 16:33           ` Dmitry Torokhov
2009-09-01 16:52             ` James Bottomley
2009-09-01 16:59               ` Alok Kataria
2009-09-01 17:25                 ` James Bottomley
2009-09-01 17:41                   ` Alok Kataria
2009-09-01 18:15                     ` James Bottomley
2009-09-02  2:55                       ` Alok Kataria
2009-09-02 15:06                         ` James Bottomley
2009-09-02 17:16                           ` Alok Kataria
2009-09-03 20:03                             ` James Bottomley
2009-09-03 20:31                               ` Dmitry Torokhov
2009-09-03 21:21                                 ` Ric Wheeler
2009-09-03 21:41                                   ` Dmitry Torokhov
2009-09-04  3:28                               ` Alok Kataria
2009-09-01 17:25               ` Roland Dreier
2009-09-01 17:40                 ` James Bottomley
2009-09-01 17:54                   ` Alok Kataria
2009-09-01 18:38                     ` Christoph Hellwig
2009-09-02  9:50                       ` Bart Van Assche
2009-09-01 16:34         ` Bart Van Assche

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=200908312051.26264.eike-kernel@sf-tec.de \
    --to=eike-kernel@sf-tec.de \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=akataria@vmware.com \
    --cc=akpm@linux-foundation.org \
    --cc=dtor@vmware.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=maustruy@vmware.com \
    --cc=michaelc@cs.wisc.edu \
    --cc=randy.dunlap@oracle.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox