Selaa lähdekoodia

intel_th: Set root device's drvdata early

Already during the subdevice initialization time, devices will need
to reference Intel TH controller descriptor structure.

This patch moves setting the drvdata from the pci glue to intel_th
core, before subdevices are populated.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Alexander Shishkin 9 vuotta sitten
vanhempi
commit
d7b1787161
2 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 0
      drivers/hwtracing/intel_th/core.c
  2. 0 2
      drivers/hwtracing/intel_th/pci.c

+ 2 - 0
drivers/hwtracing/intel_th/core.c

@@ -584,6 +584,8 @@ intel_th_alloc(struct device *dev, struct resource *devres,
 	}
 	}
 	th->dev = dev;
 	th->dev = dev;
 
 
+	dev_set_drvdata(dev, th);
+
 	err = intel_th_populate(th, devres, ndevres, irq);
 	err = intel_th_populate(th, devres, ndevres, irq);
 	if (err)
 	if (err)
 		goto err_chrdev;
 		goto err_chrdev;

+ 0 - 2
drivers/hwtracing/intel_th/pci.c

@@ -46,8 +46,6 @@ static int intel_th_pci_probe(struct pci_dev *pdev,
 	if (IS_ERR(th))
 	if (IS_ERR(th))
 		return PTR_ERR(th);
 		return PTR_ERR(th);
 
 
-	pci_set_drvdata(pdev, th);
-
 	return 0;
 	return 0;
 }
 }