intel_th: Set root device's drvdata early
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>
Mon, 15 Feb 2016 17:11:59 +0000 (19:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Feb 2016 22:09:14 +0000 (14:09 -0800)
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>
drivers/hwtracing/intel_th/core.c
drivers/hwtracing/intel_th/pci.c

index b8b9895da5d18d8982cc5e46e24a2db1f2eca036..6df3cd9774bc42682bb2a1d0bd40e8df54806949 100644 (file)
@@ -584,6 +584,8 @@ intel_th_alloc(struct device *dev, struct resource *devres,
        }
        th->dev = dev;
 
+       dev_set_drvdata(dev, th);
+
        err = intel_th_populate(th, devres, ndevres, irq);
        if (err)
                goto err_chrdev;
index 09017073d7a416dd2ce751f39b006e5f8d11ef95..bca7a2ac00d63ab50ba04e12299d9178608f4218 100644 (file)
@@ -46,8 +46,6 @@ static int intel_th_pci_probe(struct pci_dev *pdev,
        if (IS_ERR(th))
                return PTR_ERR(th);
 
-       pci_set_drvdata(pdev, th);
-
        return 0;
 }