All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: "Wiran, Francis" <francis.wiran@hp.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] cpqarray update
Date: Mon, 26 Jan 2004 20:51:48 -0500	[thread overview]
Message-ID: <4015C434.5070108@pobox.com> (raw)
In-Reply-To: <CBD6B29E2DA6954FABAC137771769D6504E15965@cceexc19.americas.cpqcorp.net>

Wiran, Francis wrote:
>>You need to check the return value of pci_module_init() for errors.
> 
> No, because the return value is determined from number of ctrls found,
> and not from function return.
> 
> int __init cpqarray_init(void)
> {
> ...
> 	pci_module_init(&cpqarray_pci_driver);
> 	cpqarray_eisa_detect();
> 
> 	for(i=0;i<MAX_CTLR;i++) {
> 		if(hba[i] != NULL)
> 			num_ctlrs_reg++
> 	}
> 
> 	return (num_ctlrs_reg);
> }
> 
> int __init cpqarray_init_module(void)
> {
> 	if (cpqarray_init() == 0)
> 		return -ENODEV;
> 	return 0;
> }


Nope, this needs to be turned inside out.  The proper PCI driver looks like

static int __init cp_init (void)
{
         return pci_module_init (&cp_driver);
}

static void __exit cp_exit (void)
{
         pci_unregister_driver (&cp_driver);
}

We already handle the cases you describe.  The cpqarray code -breaks- 
the API design by doing it this way.

cpqarray does not fully support the pci_ids features and hotplug without 
this.

	Jeff




  reply	other threads:[~2004-01-27  1:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-26 22:32 [PATCH] cpqarray update Wiran, Francis
2004-01-27  1:51 ` Jeff Garzik [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-01-30 16:22 Wiran, Francis
2004-01-29 19:20 Wiran, Francis
2004-01-29 20:14 ` Jeff Garzik
2004-01-29 16:39 Wiran, Francis
2004-01-29 16:56 ` Jeff Garzik
2004-01-28 23:10 Wiran, Francis
2004-01-28 23:28 ` Greg KH
2004-01-28 22:53 Wiran, Francis
2004-01-27  4:50 Wiran, Francis
2004-01-27  4:48 Wiran, Francis
     [not found] <200401262002.i0QK2iAH031857@hera.kernel.org>
2004-01-26 20:15 ` Jeff Garzik
2004-01-28 15:46   ` Hollis Blanchard
2004-01-28 17:40     ` Greg KH
2004-01-28 23:39     ` Jeff Garzik
2004-01-28 23:44       ` Jeff Garzik
2004-01-28 23:51         ` 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=4015C434.5070108@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=francis.wiran@hp.com \
    --cc=linux-kernel@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 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.