2014-03-31 2:45 GMT+08:00 Olliver Schinagl <[email protected]>:
> On 03/30/2014 03:22 PM, Huang Benn wrote:
>
>> for 3.4 kernel, it fail to get regulator. who know what happen. I was
>> tracing the issue without success :P
>> anyone can help ? thanks
>>
> On what hardware is this happening? all a10/a20 or all axp20* based
> hardware?
>
> The bug you point out does look odd., I don't think your supposed to pass
> NULL to it, but what do I know ;)
>
Both exist on Cubieboard2 and Cubietruck.
When I found the following code, I get surprised. I think it's a mistake to
pass NULL to regulator_get.
//drvdata->regulator = regulator_get(&pdev->dev, reg_id); //I've
tried this line, the same result.
drvdata->regulator = regulator_get(NULL, reg_id); ----- Bug ?
//drvdata->regulator = regulator_get(NULL, "axp20_analog/fm");
>
> Olliver
>
>>
>> kernel: linux-sunxi/stage/sunxi-3.4
>>
>>
>> CODE:
>>
>> drivers/power/axp_power/virtual20.c
>> static int regulator_virtual_consumer_probe(struct platform_device *pdev)
>> {
>> char *reg_id = pdev->dev.platform_data;
>> struct virtual_consumer_data *drvdata;
>> int ret, i;
>>
>> pr_warning("[%s] enter1, pdev=%s, reg_id=%s\n", __FUNCTION__,
>> pdev->name, reg_id);
>>
>> drvdata = kzalloc(sizeof(struct virtual_consumer_data),
>> GFP_KERNEL);
>> if (drvdata == NULL) {
>> pr_warning("[%s] enter 2\n", __FUNCTION__);
>> ret = -ENOMEM;
>> goto err;
>> }
>>
>> mutex_init(&drvdata->lock);
>>
>> pr_warning("[%s] pdev=%p, reg_id=%s\n", __FUNCTION__, pdev,
>> reg_id);
>>
>> //drvdata->regulator = regulator_get(&pdev->dev, reg_id);
>> drvdata->regulator = regulator_get(NULL, reg_id); ----- Bug ?
>> //drvdata->regulator = regulator_get(NULL, "axp20_analog/fm");
>>
>> if (IS_ERR(drvdata->regulator)) {
>> ret = PTR_ERR(drvdata->regulator);
>> pr_warning("[%s] enter3\n", __FUNCTION__);
>> goto err;
>> }
>>
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "linux-sunxi" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to [email protected]
>> <mailto:[email protected]>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.