On Fri, 2011-04-08 at 12:59 +0200, Antonio Ospite wrote:
> Add a regulator consumer driver for rfkill to enable controlling radio
> transmitters connected to voltage regulators using the regulator
> framework.
> 
> A new "vrfkill" virtual supply is provided to use in platform code.
> 
> Signed-off-by: Guiming Zhuo <gmz...@gmail.com>
> Signed-off-by: Antonio Ospite <osp...@studenti.unina.it>
> ---
> 
> Changes since v1:
> 
>   - changed "voltage regulator" to "voltage regulators" in the commit
>     message
> 
>   - drop rfkill_init_sw_state() as requested by Johannes Berg
> 
>   - moved assignment fields of rfkill_data _before_ rfkill_register(),
>     as the latter will call .set_block (via schedule_work()) which would
>     find NULL pointers for the .vcc and .rf_kill fields otherwise.
> 
>     This issue was masked when I was using rfkill_init_sw_state() which
>     was setting the persistent flag: rfkill_register() does not call
>     schedule_work() immediately when the persistent flag is set.
> 
>     So please take another look at this part of rfkill_regulator_probe().
> 
> Mark, I left in the RFKILL || !RFKILL part.
> 
> If there are no more comments, who is going to merge the driver, Johannes?

I don't have a tree, John can merge it, but I found a few more bugs:

> + * static struct regulator_consumer_supply pcap_regulator_V6_consumers [] = {
> + *   { .dev_name = "rfkill-regulator.0", supply = "vrfkill" },
> + * };

It's a comment, but it should be .supply = (missing the .)

> +     if (pdata->name == NULL || pdata->type == 0) {
> +             dev_err(&pdev->dev, "invalid name or type in platform data\n");
> +             return -EINVAL;
> +     }
> +
> +     vcc = regulator_get_exclusive(&pdev->dev, "vrfkill");

Wasn't that supposed to use pdata->supply? Actually, there's no member
"supply" in the struct?

> +     dev_info(&pdev->dev, "initialized\n");

Is that message really useful?

Other than that, looks good to me.

johannes


Reply via email to