PCI: make pci_name use dev_name
Subsystems (5)
PATCH 1/1 PCI: make pci_name use dev_name
From: Greg Kroah-Hartman <[email protected]>
Also fixes up the sparc PCI code that was assuming this is not a constant.
This is done in anticipation of removing the bus_id field from struct driver.
--- arch/sparc64/kernel/pci.c | 2 +- include/linux/pci.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
arch/sparc64/kernel/pci.c +1 -1
@@ -408,7 +408,7 @@ struct pci_dev *of_create_pci_dev(struct dev->class = class >>8 ; dev->revision = class &0xff ; -sprintf (pci_name (dev),"%04x:%02x:%02x.%d" ,pci_domain_nr (bus), +sprintf (dev->dev.bus_id,"%04x:%02x:%02x.%d" ,pci_domain_nr (bus), dev->bus->number,PCI_SLOT (devfn),PCI_FUNC (devfn));if (ofpci_verbose)
include/linux/pci.h +2 -2
@@ -977,9 +977,9 @@ static inline void pci_set_drvdata(struc/* If you want to know what to call your pci_dev, ask this function. * Again, it's a wrapper around the generic device. */ -static inline char *pci_name (struct pci_dev *pdev) +static inline const char *pci_name (struct pci_dev *pdev) { -return pdev->dev.bus_id; +return dev_name (&pdev->dev); }
Quoted 30 lines · Greg Kroah-Hartman
From: Greg Kroah-Hartman <[email protected]>
Also fixes up the sparc PCI code that was assuming this is not a constant.
This is done in anticipation of removing the
bus_idfield from struct driver.Signed-off-by Kay Sievers <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- arch/sparc64/kernel/pci.c | 2 +- include/linux/pci.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)arch/sparc64/kernel/pci.c +1
-1@@ -408,7 +408,7 @@ struct pci_dev *of_create_pci_dev(struct dev->class = class >>8 ; dev->revision = class &0xff ; -sprintf (pci_name (dev),"%04x:%02x:%02x.%d" ,pci_domain_nr (bus), +sprintf (dev->dev.bus_id,"%04x:%02x:%02x.%d" ,pci_domain_nr (bus), dev->bus->number,PCI_SLOT (devfn),PCI_FUNC (devfn));if (ofpci_verbose)
include/linux/pci.h static inline void pci_set_drvdata(struc · line 980
Quoted 5 lines
include/linux/pci.h +1
-1@@ -977,9 +977,9 @@ static inline void pci_set_drvdata(struc/* If you want to know what to call your pci_dev, ask this function. * Again, it's a wrapper around the generic device. */ -static inline char *pci_name (struct pci_dev *pdev) +static inline const char *pci_name (struct pci_dev *pdev)
Andrew just pointed out to me that this causes a bunch of compiler warnings to be generated. I'll go audit the tree to fix them as well and send you a follow-on patch if that's ok.
thanks,
greg k-h
Quoted 27 lines · Greg Kroah-Hartman
Quoted 26 lines · Greg Kroah-Hartman
From: Greg Kroah-Hartman <[email protected]>
Also fixes up the sparc PCI code that was assuming this is not a constant.
This is done in anticipation of removing the
bus_idfield from struct driver.Signed-off-by Kay Sievers <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- arch/sparc64/kernel/pci.c | 2 +- include/linux/pci.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)arch/sparc64/kernel/pci.c +1
-1@@ -408,7 +408,7 @@ struct pci_dev *of_create_pci_dev(struct dev->class = class >>8 ; dev->revision = class &0xff ; -sprintf (pci_name (dev),"%04x:%02x:%02x.%d" ,pci_domain_nr (bus), +sprintf (dev->dev.bus_id,"%04x:%02x:%02x.%d" ,pci_domain_nr (bus), dev->bus->number,PCI_SLOT (devfn),PCI_FUNC (devfn));
Quoted 13 lines
include/linux/pci.h static inline void pci_set_drvdata(struc · line 980
Quoted 9 lines
arch/sparc64/kernel/pci.c +0
-0if (ofpci_verbose)include/linux/pci.h +1
-1@@ -977,9 +977,9 @@ static inline void pci_set_drvdata(struc/* If you want to know what to call your pci_dev, ask this function. * Again, it's a wrapper around the generic device. */ -static inline char *pci_name (struct pci_dev *pdev) +static inline const char *pci_name (struct pci_dev *pdev)Andrew just pointed out to me that this causes a bunch of compiler warnings to be generated. I'll go audit the tree to fix them as well and send you a follow-on patch if that's ok.
Yeah, works for me. I've got at least one other patch along these lines already. Assuming Dave doesn't want to handle these SPARC PCI patches anyway...
Thanks,
Jesse
Quoted 42 lines · Jesse Barnes
Quoted 27 lines · Greg Kroah-Hartman
Quoted 26 lines · Greg Kroah-Hartman
From: Greg Kroah-Hartman <[email protected]>
Also fixes up the sparc PCI code that was assuming this is not a constant.
This is done in anticipation of removing the
bus_idfield from struct driver.Signed-off-by Kay Sievers <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- arch/sparc64/kernel/pci.c | 2 +- include/linux/pci.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)arch/sparc64/kernel/pci.c +1
-1@@ -408,7 +408,7 @@ struct pci_dev *of_create_pci_dev(struct dev->class = class >>8 ; dev->revision = class &0xff ; -sprintf (pci_name (dev),"%04x:%02x:%02x.%d" ,pci_domain_nr (bus), +sprintf (dev->dev.bus_id,"%04x:%02x:%02x.%d" ,pci_domain_nr (bus), dev->bus->number,PCI_SLOT (devfn),PCI_FUNC (devfn));Quoted 13 lines
include/linux/pci.h static inline void pci_set_drvdata(struc · line 980
Quoted 9 lines
arch/sparc64/kernel/pci.c +0
-0if (ofpci_verbose)include/linux/pci.h +1
-1@@ -977,9 +977,9 @@ static inline void pci_set_drvdata(struc/* If you want to know what to call your pci_dev, ask this function. * Again, it's a wrapper around the generic device. */ -static inline char *pci_name (struct pci_dev *pdev) +static inline const char *pci_name (struct pci_dev *pdev)Andrew just pointed out to me that this causes a bunch of compiler warnings to be generated. I'll go audit the tree to fix them as well and send you a follow-on patch if that's ok.
Quoted 3 lines
Yeah, works for me. I've got at least one other patch along these lines already. Assuming Dave doesn't want to handle these SPARC PCI patches anyway...
Well, it's only used in 837 different places, so it might take me a few hours to ensure I catch all the usages :(
thanks,
greg k-h
Quoted 43 lines · Greg KH
Quoted 42 lines · Jesse Barnes
Quoted 40 lines · Greg Kroah-Hartman
Quoted 30 lines · Greg Kroah-Hartman
From: Greg Kroah-Hartman <[email protected]>
Also fixes up the sparc PCI code that was assuming this is not a constant.
This is done in anticipation of removing the
bus_idfield from struct driver.Signed-off-by Kay Sievers <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- arch/sparc64/kernel/pci.c | 2 +- include/linux/pci.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)arch/sparc64/kernel/pci.c +1
-1@@ -408,7 +408,7 @@ struct pci_dev *of_create_pci_dev(struct dev->class = class >>8 ; dev->revision = class &0xff ; -sprintf (pci_name (dev),"%04x:%02x:%02x.%d" ,pci_domain_nr (bus), +sprintf (dev->dev.bus_id,"%04x:%02x:%02x.%d" ,pci_domain_nr (bus), dev->bus->number,PCI_SLOT (devfn),PCI_FUNC (devfn));if (ofpci_verbose)include/linux/pci.h static inline void pci_set_drvdata(struc · line 980
Quoted 5 lines
include/linux/pci.h +1
-1@@ -977,9 +977,9 @@ static inline void pci_set_drvdata(struc/* If you want to know what to call your pci_dev, ask this function. * Again, it's a wrapper around the generic device. */ -static inline char *pci_name (struct pci_dev *pdev) +static inline const char *pci_name (struct pci_dev *pdev)Andrew just pointed out to me that this causes a bunch of compiler warnings to be generated. I'll go audit the tree to fix them as well and send you a follow-on patch if that's ok.
Quoted 6 lines
Quoted 3 lines
Yeah, works for me. I've got at least one other patch along these lines already. Assuming Dave doesn't want to handle these SPARC PCI patches anyway...
Well, it's only used in 837 different places, so it might take me a few hours to ensure I catch all the usages :(
Ok, here are 4 patches that fix the few places that this pci change caused problems.
Jesse, do you want to add these to your tree? I can take the single USB one if you want, or you can take all 4, it's fine with me.
thanks,
greg k-h
PATCH 1/4 MTD: handle pci_name() being const
This changes the MTD core to handle pci_name() now returning a constant string.
--- drivers/mtd/devices/block2mtd.c | 8 +++++--- include/linux/mtd/map.h | 2 +- include/linux/mtd/mtd.h | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-)
drivers/mtd/devices/block2mtd.c +5 -3
@@ -241,6 +241,7 @@ static struct block2mtd_dev *add_device( {struct block_device *bdev;struct block2mtd_dev *dev; +char *name;if (!devname)return NULL ;
@@ -279,12 +280,13 @@ static struct block2mtd_dev *add_device(/* Setup the MTD structure */ /* make the name contain the block device in */ - dev->mtd.name =kmalloc (sizeof ("block2mtd: " ) +strlen (devname), + name =kmalloc (sizeof ("block2mtd: " ) +strlen (devname) +1 ,GFP_KERNEL ); -if (!dev->mtd.name) +if (!name) goto devinit_err; -sprintf (dev->mtd.name,"block2mtd: %s" , devname); +sprintf (name,"block2mtd: %s" , devname); + dev->mtd.name = name; dev->mtd.size = dev->blkdev->bd_inode->i_size &PAGE_MASK ; dev->mtd.erasesize = erase_size;
include/linux/mtd/map.h +1 -1
@@ -189,7 +189,7 @@ typedef union {*/ struct map_info { -char *name; +const char *name;unsigned long size;resource_size_t phys;#define NO_XIP (-1UL)
include/linux/mtd/mtd.h +1 -1
@@ -121,7 +121,7 @@ struct mtd_info {u_int32_t oobavail;// Available OOB bytes per block // Kernel-only stuff starts here. -char *name; +const char *name;int index;/* ecc layout structure pointer - read only ! */
PATCH 2/4 PCI: handle pci_name() being const
In reply to Greg KHThis changes pci_setup_device to handle pci_name() now returning a constant string.
--- drivers/pci/probe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/pci/probe.c +3 -2
@@ -711,8 +711,9 @@ static int pci_setup_device(struct pci_d {u32 class; -sprintf (pci_name (dev),"%04x:%02x:%02x.%d" ,pci_domain_nr (dev->bus), - dev->bus->number,PCI_SLOT (dev->devfn),PCI_FUNC (dev->devfn)); +dev_set_name (&dev->dev,"%04x:%02x:%02x.%d" ,pci_domain_nr (dev->bus), + dev->bus->number,PCI_SLOT (dev->devfn), +PCI_FUNC (dev->devfn));pci_read_config_dword (dev,PCI_CLASS_REVISION , &class); dev->revision = class &0xff ;
Re: [patch 02/04] PCI: handle pci_name() being const
Quoted 14 lines · Greg Kroah-Hartman
This changes
pci_setup_deviceto handlepci_name()now returning a constant string.Cc Jesse Barns <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/pci/probe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/pci/probe.c +0
-0@@ -711,8 +711,9 @@ static int pci_setup_device(struct pci_d {
drivers/pci/probe.c static int pci_setup_device(struct pci_d · line 719
Quoted 10 lines
drivers/pci/probe.c +3
-2u32 class; -sprintf (pci_name (dev),"%04x:%02x:%02x.%d" ,pci_domain_nr (dev->bus), - dev->bus->number,PCI_SLOT (dev->devfn),PCI_FUNC (dev->devfn)); +dev_set_name (&dev->dev,"%04x:%02x:%02x.%d" ,pci_domain_nr (dev->bus), + dev->bus->number,PCI_SLOT (dev->devfn), +PCI_FUNC (dev->devfn));pci_read_config_dword (dev,PCI_CLASS_REVISION , &class); dev->revision = class &0xff ;
Just applied this to my linux-next branch (fortunately I already had the dev_set_name commit). Doing a quick build & test before I push it out.
Thanks,
Jesse
PATCH 3/4 3c59x: handle pci_name() being const
In reply to Greg KHThis changes vortex_prob1() to handle pci_name() now returning a constant string.
--- drivers/net/3c59x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/3c59x.c +1 -1
@@ -1010,7 +1010,7 @@ static int __devinit vortex_probe1(strucstatic int printed_version;int retval, print_info;struct vortex_chip_info *const vci = &vortex_info_tbl[chip_idx]; -char *print_name ="3c59x" ; +const char *print_name ="3c59x" ;struct pci_dev *pdev =NULL ;struct eisa_device *edev =NULL ;DECLARE_MAC_BUF (mac);
Re: [patch 03/04] 3c59x: handle pci_name() being const
Quoted 14 lines · On Wed, 2 Jul 2008 13:24:53 -0700 Greg Kroah-Hartman <[email protected]> wrote:
This changes
vortex_prob1()to handlepci_name()now returning a constant string.Cc Steffen Klassert <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/net/3c59x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/3c59x.c static int __devinit vortex_probe1(struc · line 1016
Quoted 8 lines
drivers/net/3c59x.c +1
-1@@ -1010,7 +1010,7 @@ static int __devinit vortex_probe1(strucstatic int printed_version;int retval, print_info;struct vortex_chip_info *const vci = &vortex_info_tbl[chip_idx]; -char *print_name ="3c59x" ; +const char *print_name ="3c59x" ;struct pci_dev *pdev =NULL ;struct eisa_device *edev =NULL ;DECLARE_MAC_BUF (mac);
Well this one applied. The others didn't.
Please prefer to not raise patches against a 30MB-old kernel ;)
Re: [patch 03/04] 3c59x: handle pci_name() being const
In reply to Greg Kroah-HartmanQuoted 3 lines · Greg Kroah-Hartman
This changes
vortex_prob1()to handlepci_name()now returning a constant string.
I got the same patch from David Howells already,
that one is acked and send to Jeff Garzik.
Steffen
Re: [patch 03/04] 3c59x: handle pci_name() being const
Quoted 6 lines · Steffen Klassert
Quoted 3 lines · Greg Kroah-Hartman
This changes
vortex_prob1()to handlepci_name()now returning a constant string.I got the same patch from David Howells already,
that one is acked and send to Jeff Garzik.
Great, thanks for letting us know.
greg k-h
Re: [patch 03/04] 3c59x: handle pci_name() being const
In reply to Steffen KlassertQuoted 6 lines · Steffen Klassert
Quoted 3 lines · Greg Kroah-Hartman
This changes
vortex_prob1()to handlepci_name()now returning a constant string.I got the same patch from David Howells already,
that one is acked and send to Jeff Garzik.
could you resend, I only have the patch in quoted email...
Re: [patch 03/04] 3c59x: handle pci_name() being const
Quoted 9 lines · Jeff Garzik
Quoted 6 lines · Steffen Klassert
Quoted 3 lines · Greg Kroah-Hartman
This changes
vortex_prob1()to handlepci_name()now returning a constant string.I got the same patch from David Howells already,
that one is acked and send to Jeff Garzik.could you resend, I only have the patch in quoted email...
The "3c59x: handle pci_name() being const" patch is already mainline, so there is no need to resend.
Steffen
PATCH 4/4 USB: handle pci_name() being const
In reply to Greg KHThis changes usb_create_hcd() to be able to handle the fact that pci_name() has changed to a constant string.
--- drivers/usb/core/hcd.c | 2 +- drivers/usb/core/hcd.h | 2 +- include/linux/usb.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/usb/core/hcd.c +1 -1
@@ -1755,7 +1755,7 @@ EXPORT_SYMBOL_GPL (usb_hc_died);* If memory is unavailable, returns NULL. */ struct usb_hcd *usb_create_hcd (const struct hc_driver *driver, -struct device *dev,char *bus_name) +struct device *dev,const char *bus_name) {struct usb_hcd *hcd;
drivers/usb/core/hcd.h +1 -1
@@ -233,7 +233,7 @@ extern void usb_hcd_disable_endpoint(strextern int usb_hcd_get_frame_number (struct usb_device *udev);extern struct usb_hcd *usb_create_hcd (const struct hc_driver *driver, -struct device *dev,char *bus_name); +struct device *dev,const char *bus_name);extern struct usb_hcd *usb_get_hcd (struct usb_hcd *hcd);extern void usb_put_hcd (struct usb_hcd *hcd); extern int usb_add_hcd(struct usb_hcd *hcd,
include/linux/usb.h +1 -1
@@ -293,7 +293,7 @@ struct usb_devmap {struct usb_bus {struct device *controller;/* host/master side hardware */ int busnum;/* Bus number (in order of reg) */ -char *bus_name;/* stable id (PCI slot_name etc) */ +const char *bus_name;/* stable id (PCI slot_name etc) */ u8 uses_dma;/* Does the host controller use DMA? */ u8 otg_port;/* 0, or number of OTG/HNP port */ unsigned is_b_host:1 ;/* true during some HNP roleswitches */
Quoted 9 lines · Greg KH
Quoted 2 lines · Greg KH
Well, it's only used in 837 different places, so it might take me a few hours to ensure I catch all the usages :(
Ok, here are 4 patches that fix the few places that this pci change caused problems.
Jesse, do you want to add these to your tree? I can take the single USB one if you want, or you can take all 4, it's fine with me.
I'd rather just take the PCI patch (which I'm doing now). The other stuff can come in through the appropriate tree.
Thanks,
Jesse
Quoted 5 lines · Jesse Barnes
Quoted 4 lines · Greg KH
Quoted 2 lines · Greg KH
Well, it's only used in 837 different places, so it might take me a few hours to ensure I catch all the usages :(
Quoted 8 lines
Quoted 5 lines
Ok, here are 4 patches that fix the few places that this pci change caused problems.
Jesse, do you want to add these to your tree? I can take the single USB one if you want, or you can take all 4, it's fine with me.
I'd rather just take the PCI patch (which I'm doing now). The other stuff can come in through the appropriate tree.
Fair enough, I'll make sure they don't get dropped.
thanks,
greg k-h
Quoted 9 lines · Greg KH
Quoted 8 lines · Jesse Barnes
Quoted 7 lines · Greg KH
Quoted 2 lines · Greg KH
Well, it's only used in 837 different places, so it might take me a few hours to ensure I catch all the usages :(
Ok, here are 4 patches that fix the few places that this pci change caused problems.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Jesse, do you want to add these to your tree? I can take the single USB one if you want, or you can take all 4, it's fine with me.
I'd rather just take the PCI patch (which I'm doing now). The other stuff can come in through the appropriate tree.
Fair enough, I'll make sure they don't get dropped.
Cool thanks. I assume you'll only push the pci_name change once all or most of the compiler warnings have been fixed up?
Thanks,
Jesse
Quoted 13 lines · Jesse Barnes
Quoted 12 lines · Greg KH
Quoted 11 lines · Jesse Barnes
Quoted 9 lines · Greg KH
Quoted 2 lines · Greg KH
Well, it's only used in 837 different places, so it might take me a few hours to ensure I catch all the usages :(
Ok, here are 4 patches that fix the few places that this pci change caused problems.
Jesse, do you want to add these to your tree? I can take the single USB one if you want, or you can take all 4, it's fine with me.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
I'd rather just take the PCI patch (which I'm doing now). The other stuff can come in through the appropriate tree.
Fair enough, I'll make sure they don't get dropped.
Cool thanks. I assume you'll only push the
pci_namechange once all or most of the compiler warnings have been fixed up?
As there were only 4 patches for the warnings, yes, I can handle that :)
thanks,
greg k-h