]> Pileus Git - ~andy/linux/commitdiff
regulator: get pcap data from the parent device
authorAntonio Ospite <ospite@studenti.unina.it>
Fri, 7 Aug 2009 21:18:41 +0000 (23:18 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 17 Sep 2009 07:47:13 +0000 (09:47 +0200)
Right now the pcap core driver passes a reference to its pcap data abusing the
subdrivers platform drvdata, this is not good.

Get the reference directly from the parent device.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/regulator/pcap-regulator.c

index 137b455ecb442379307a98b09d7f811c596818fd..33d7d899e03073597b1f80f5ab10e85925b6e0c8 100644 (file)
@@ -271,7 +271,7 @@ static struct regulator_desc pcap_regulators[] = {
 static int __devinit pcap_regulator_probe(struct platform_device *pdev)
 {
        struct regulator_dev *rdev;
-       void *pcap = platform_get_drvdata(pdev);
+       void *pcap = dev_get_drvdata(pdev->dev.parent);
 
        rdev = regulator_register(&pcap_regulators[pdev->id], &pdev->dev,
                                pdev->dev.platform_data, pcap);