From: Jeff Garzik <jgarzik@pobox.com>
To: Stephen Hemminger <shemminger@osdl.org>
Cc: Jes Sorensen <jes@wildopensource.com>, netdev@oss.sgi.com
Subject: Re: [PATCH] Road Runner HIPPI driver (rrunner)
Date: Fri, 12 Sep 2003 18:06:55 -0400 [thread overview]
Message-ID: <3F62437F.9080202@pobox.com> (raw)
In-Reply-To: <20030912144208.2886e2b9.shemminger@osdl.org>
Stephen Hemminger wrote:
> @@ -209,9 +208,9 @@ static int __devinit rr_init_one(struct
>
> dev->base_addr = 0;
>
> - ret = register_netdev(dev);
> - if (ret)
> + if (register_netdev(dev))
> goto out;
> +
> return 0;
>
> out:
We lose the register_netdev() return value, whereas the driver got it
right before.
> static void __devexit rr_remove_one (struct pci_dev *pdev)
> {
> - struct net_device *dev = pci_get_drvdata(pdev);
> - struct rr_private *rr = (struct rr_private *)dev->priv;
> + struct net_device *dev;
> + struct rr_private *rr;
>
> - if (dev) {
> - if (!(readl(&rr->regs->HostCtrl) & NIC_HALTED)){
> - printk(KERN_ERR "%s: trying to unload running NIC\n",
> - dev->name);
> - writel(HALT_NIC, &rr->regs->HostCtrl);
> - }
> -
> - pci_free_consistent(pdev, EVT_RING_SIZE, rr->evt_ring,
> - rr->evt_ring_dma);
> - pci_free_consistent(pdev, RX_TOTAL_SIZE, rr->rx_ring,
> - rr->rx_ring_dma);
> - pci_free_consistent(pdev, TX_TOTAL_SIZE, rr->tx_ring,
> - rr->tx_ring_dma);
> - unregister_netdev(dev);
> - iounmap(rr->regs);
> - free_netdev(dev);
> - pci_release_regions(pdev);
> - pci_disable_device(pdev);
> - pci_set_drvdata(pdev, NULL);
> + if (!(dev = pci_get_drvdata(pdev)))
> + return;
this is a fairly ugly construct. It looks better as the driver had it,
as an initializer. Don't combine C statements when you don't need to.
> @@ -1201,8 +1205,8 @@ static int rr_open(struct net_device *de
> readl(®s->HostCtrl);
> spin_unlock_irqrestore(&rrpriv->lock, flags);
>
> - if (request_irq(dev->irq, rr_interrupt, SA_SHIRQ, rrpriv->name, dev))
> - {
> + if (request_irq(dev->irq, rr_interrupt, SA_SHIRQ,
> + "RoadRunner serial HIPPI", dev)) {
> printk(KERN_WARNING "%s: Requested IRQ %d is busy\n",
> dev->name, dev->irq);
> ecode = -EAGAIN;
If Jes doesn't mind, I would prefer that we pass in the interface name
(dev->name I assume?) here.
Jeff
next prev parent reply other threads:[~2003-09-12 22:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-12 21:42 [PATCH] Road Runner HIPPI driver (rrunner) Stephen Hemminger
2003-09-12 22:06 ` Jeff Garzik [this message]
2003-09-12 22:25 ` Stephen Hemminger
2003-09-13 3:22 ` Jes Sorensen
2003-09-20 19:11 ` Jeff Garzik
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=3F62437F.9080202@pobox.com \
--to=jgarzik@pobox.com \
--cc=jes@wildopensource.com \
--cc=netdev@oss.sgi.com \
--cc=shemminger@osdl.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.