From: Jeff Garzik <jgarzik@mandrakesoft.com>
To: Marcus Meissner <Marcus.Meissner@caldera.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers/sound/nm256_audio.c
Date: Thu, 19 Apr 2001 11:56:01 -0400 [thread overview]
Message-ID: <3ADF0A91.F803266F@mandrakesoft.com> (raw)
In-Reply-To: <20010419173502.A13934@caldera.de>
Marcus Meissner wrote:
>
> Hi,
>
> This updates the nm256_audio driver to the 2.4 PCI API.
>
> Patch is against 2.4.3-ac9, verified on Sony VAIO Laptop.
"verified" is the really important part with this driver, since its
really finicky. I have a patch I would love to bounce to you in
private, that I have been searching for a tester for -months- because I
had no test hardware of my own.
Your patch looks ok to me and I would say apply it. But I also think it
is incomplete.
* there is no need for a linked list of cards, since
pci_{get,set}_drvdata is used. This eliminates the list walk in
nm256_remove
* the new PCI API has suspend/resume hooks, and those should be used in
preference to register_pm_...
* there is rarely a need to compare PCI ids manually in a driver. Do
this implicitly by using the struct pci_device_id::driver_data field.
In the following code, you could simply pass these two strings as your
driver_data:
> + if (pcidev->device == PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO)
> + return nm256_install(pcidev, REV_NM256AV, "256AV");
> + if (pcidev->device == PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO)
> + return nm256_install(pcidev, REV_NM256ZX, "256ZX");
* typically you don't want to -always- printout the module version when
built into the kernel. that can get ugly, when you have a bunch of
drivers in the kernel. you should surround the existing version printk
code with ifdef MODULE, and then add some additional code in your
pci_driver::probe routine which looks something like
#ifndef MODULE
static int printed_version;
if (!printed_version++)
printk(version);
#endif
and further, declare your version string like the following code, so it
can be dropped from the kernel image...
static char version[] __devinitdata =
KERN_INFO "... version ...\n";
Looks good, thanks for the work! If you spot any other drivers you can
convert, feel free.
Jeff
--
Jeff Garzik | "The universe is like a safe to which there is a
Building 1024 | combination -- but the combination is locked up
MandrakeSoft | in the safe." -- Peter DeVries
next prev parent reply other threads:[~2001-04-19 15:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-19 15:35 Marcus Meissner
2001-04-19 15:56 ` Jeff Garzik [this message]
2001-04-19 16:08 ` Marcus Meissner
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=3ADF0A91.F803266F@mandrakesoft.com \
--to=jgarzik@mandrakesoft.com \
--cc=Marcus.Meissner@caldera.de \
--cc=alan@lxorguk.ukuu.org.uk \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®