public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@debian.org>
To: Matthew Wilcox <willy@debian.org>
Cc: Greg KH <greg@kroah.com>,
	linux-pci@atrey.karlin.mff.cuni.cz, linux-kernel@vger.kernel.org
Subject: Re: [RFC] pci_name()
Date: Thu, 26 Jun 2003 03:52:10 +0100	[thread overview]
Message-ID: <20030626025210.GF451@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <20030626025057.GE451@parcelfarce.linux.theplanet.co.uk>

On Thu, Jun 26, 2003 at 03:50:57AM +0100, Matthew Wilcox wrote:
> On Wed, Jun 25, 2003 at 06:02:40PM -0700, Greg KH wrote:
> > Ok, I'll buy that, feel free to send the patch :)
> 
> It's kind of late to be writing patches ... but this boots & works for me.

Here's an example of converting a driver (tg3, just to annoy jeff ;-) to
pci_name().

Index: drivers/net/tg3.c
===================================================================
RCS file: /var/cvs/linux-2.5/drivers/net/tg3.c,v
retrieving revision 1.16
diff -u -p -r1.16 tg3.c
--- drivers/net/tg3.c	14 Jun 2003 22:15:21 -0000	1.16
+++ drivers/net/tg3.c	26 Jun 2003 02:45:54 -0000
@@ -5118,7 +5118,7 @@ static int tg3_ethtool_ioctl (struct net
 		strcpy (info.driver, DRV_MODULE_NAME);
 		strcpy (info.version, DRV_MODULE_VERSION);
 		memset(&info.fw_version, 0, sizeof(info.fw_version));
-		strcpy (info.bus_info, pci_dev->slot_name);
+		strcpy (info.bus_info, pci_name(pci_dev));
 		info.eedump_len = 0;
 		info.regdump_len = TG3_REGDUMP_LEN;
 		if (copy_to_user (useraddr, &info, sizeof (info)))
@@ -6087,7 +6087,7 @@ static int __devinit tg3_get_invariants(
 	err = tg3_set_power_state(tp, 0);
 	if (err) {
 		printk(KERN_ERR PFX "(%s) transition to D0 failed\n",
-		       tp->pdev->slot_name);
+		       pci_name(tp->pdev));
 		return err;
 	}
 
@@ -6198,7 +6198,7 @@ static int __devinit tg3_get_invariants(
 	err = tg3_phy_probe(tp);
 	if (err) {
 		printk(KERN_ERR PFX "(%s) phy probe failed, err %d\n",
-		       tp->pdev->slot_name, err);
+		       pci_name(tp->pdev), err);
 		/* ... but do not return immediately ... */
 	}
 
@@ -6682,7 +6682,7 @@ static int __devinit tg3_init_one(struct
 	if (!pci_set_dma_mask(pdev, (u64) 0xffffffffffffffffULL)) {
 		pci_using_dac = 1;
 		if (pci_set_consistent_dma_mask(pdev,
-						(u64) 0xffffffffffffffff)) {
+						(u64) 0xffffffffffffffffULL)) {
 			printk(KERN_ERR PFX "Unable to obtain 64 bit DMA "
 			       "for consistent allocations\n");
 			goto err_out_free_res;

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk

  reply	other threads:[~2003-06-26  2:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-25 23:35 [RFC] pci_name() Matthew Wilcox
2003-06-26  0:21 ` Jeff Garzik
2003-06-26  0:36 ` Greg KH
2003-06-26  0:53   ` Matthew Wilcox
2003-06-26  1:02     ` Greg KH
2003-06-26  2:50       ` Matthew Wilcox
2003-06-26  2:52         ` Matthew Wilcox [this message]
2003-06-26 11:20         ` Matthew Wilcox
2003-06-26  1:09 ` Anton Blanchard

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=20030626025210.GF451@parcelfarce.linux.theplanet.co.uk \
    --to=willy@debian.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    /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