]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
regulator: tps65910: Fix using wrong dev argument for calling of_regulator_match
authorAxel Lin <axel.lin@ingics.com>
Thu, 24 Jan 2013 02:31:45 +0000 (10:31 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 24 Jan 2013 10:59:53 +0000 (18:59 +0800)
The dev parameter is the device requesting the data.
In this case it should be &pdev->dev rather than pdev->dev.parent.

The dev parameter is used to call devm_kzalloc in of_get_regulator_init_data(),
which means this fixes a memory leak because the memory is allocated every time
probe() is called, thus it should be freed when this driver is unloaded.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Laxman Dewangan<ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/tps65910-regulator.c

index 59c3770fa77dbe5b77ae1b3c96c1e105cae8f58e..b0e4c0bc85c319c9265e12ab193a0aec86156a64 100644 (file)
@@ -998,7 +998,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data(
                return NULL;
        }
 
-       ret = of_regulator_match(pdev->dev.parent, regulators, matches, count);
+       ret = of_regulator_match(&pdev->dev, regulators, matches, count);
        if (ret < 0) {
                dev_err(&pdev->dev, "Error parsing regulator init data: %d\n",
                        ret);