Patchwork [1/2] pci: Set dev->dev.type in alloc_pci_dev

login
register
mail settings
Submitter Brian King
Date April 8, 2013, 1:05 p.m.
Message ID <201304081305.r38D5765032748@d01av04.pok.ibm.com>
Download mbox | patch
Permalink /patch/234763/
State Not Applicable
Headers show

Comments

Brian King - April 8, 2013, 1:05 p.m.
Set dev->dev.type in alloc_pci_dev so that archs that have their own
versions of pci_setup_device get this set properly in order to ensure
things like the boot_vga sysfs parameter get created as expected.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
---

 drivers/pci/probe.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Bjorn Helgaas - April 8, 2013, 5:20 p.m.
On Mon, Apr 8, 2013 at 7:05 AM, Brian King <brking@linux.vnet.ibm.com> wrote:
>
> Set dev->dev.type in alloc_pci_dev so that archs that have their own
> versions of pci_setup_device get this set properly in order to ensure
> things like the boot_vga sysfs parameter get created as expected.
>
> Signed-off-by: Brian King <brking@linux.vnet.ibm.com>

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

Feel free to put this in the powerpc tree along with the "set default
VGA device" patch.

> ---
>
>  drivers/pci/probe.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff -puN drivers/pci/probe.c~pci_set_dev_type_early drivers/pci/probe.c
> --- linux/drivers/pci/probe.c~pci_set_dev_type_early    2013-04-08 06:12:51.000000000 -0500
> +++ linux-bjking1/drivers/pci/probe.c   2013-04-08 06:14:33.000000000 -0500
> @@ -988,7 +988,6 @@ int pci_setup_device(struct pci_dev *dev
>         dev->sysdata = dev->bus->sysdata;
>         dev->dev.parent = dev->bus->bridge;
>         dev->dev.bus = &pci_bus_type;
> -       dev->dev.type = &pci_dev_type;
>         dev->hdr_type = hdr_type & 0x7f;
>         dev->multifunction = !!(hdr_type & 0x80);
>         dev->error_state = pci_channel_io_normal;
> @@ -1208,6 +1207,7 @@ struct pci_dev *alloc_pci_dev(void)
>                 return NULL;
>
>         INIT_LIST_HEAD(&dev->bus_list);
> +       dev->dev.type = &pci_dev_type;
>
>         return dev;
>  }
> _
>
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff -puN drivers/pci/probe.c~pci_set_dev_type_early drivers/pci/probe.c
--- linux/drivers/pci/probe.c~pci_set_dev_type_early	2013-04-08 06:12:51.000000000 -0500
+++ linux-bjking1/drivers/pci/probe.c	2013-04-08 06:14:33.000000000 -0500
@@ -988,7 +988,6 @@  int pci_setup_device(struct pci_dev *dev
 	dev->sysdata = dev->bus->sysdata;
 	dev->dev.parent = dev->bus->bridge;
 	dev->dev.bus = &pci_bus_type;
-	dev->dev.type = &pci_dev_type;
 	dev->hdr_type = hdr_type & 0x7f;
 	dev->multifunction = !!(hdr_type & 0x80);
 	dev->error_state = pci_channel_io_normal;
@@ -1208,6 +1207,7 @@  struct pci_dev *alloc_pci_dev(void)
 		return NULL;
 
 	INIT_LIST_HEAD(&dev->bus_list);
+	dev->dev.type = &pci_dev_type;
 
 	return dev;
 }