Re: [PATCH 4/4] regulator: s2mps11: Add device tree support

From: Sachin Kamat
Date: Wed Jul 03 2013 - 07:53:34 EST


> +static void s2mps11_pmic_set_buck_ramp(struct regulator_init_data *init_data,
> + struct s2mps11_info *s2mps11, int id)
> +{
> + unsigned int ramp_rate;
> +
> + if (!init_data)
> + return;
> +
> + ramp_rate = init_data->constraints.ramp_delay;
> +
> + switch (id) {
> + case S2MPS11_BUCK2:
> + s2mps11->ramp_delay2 = ramp_rate;
> + break;
> + case S2MPS11_BUCK3:
> + case S2MPS11_BUCK4:
> + if (ramp_rate > s2mps11->ramp_delay34)
> + s2mps11->ramp_delay34 = ramp_rate;
> + break;
> + case S2MPS11_BUCK5:
> + s2mps11->ramp_delay5 = ramp_rate;
> + break;
> + case S2MPS11_BUCK1:
> + case S2MPS11_BUCK6:
> + if (ramp_rate > s2mps11->ramp_delay16)
> + s2mps11->ramp_delay16 = ramp_rate;
> + break;
> + case S2MPS11_BUCK7:
> + case S2MPS11_BUCK8:
> + case S2MPS11_BUCK10:
> + if (ramp_rate > s2mps11->ramp_delay7810)
> + s2mps11->ramp_delay7810 = ramp_rate;
> + break;
> + case S2MPS11_BUCK9:
> + s2mps11->ramp_delay9 = ramp_rate;

How about adding a 'break' here for completeness.

[snip]

> static int s2mps11_pmic_probe(struct platform_device *pdev)
> {
> struct sec_pmic_dev *iodev = dev_get_drvdata(pdev->dev.parent);
> struct sec_platform_data *pdata = dev_get_platdata(iodev->dev);
> + struct of_regulator_match rdata[S2MPS11_REGULATOR_MAX];
> + struct device_node *reg_np = NULL;
> struct regulator_config config = { };
> struct s2mps11_info *s2mps11;
> - int i, ret;
> + int i, id, ret;
> unsigned char ramp_enable, ramp_reg = 0;
>
> - if (!pdata) {
> - dev_err(pdev->dev.parent, "Platform data not supplied\n");
> - return -ENODEV;
> - }
> -
> s2mps11 = devm_kzalloc(&pdev->dev, sizeof(struct s2mps11_info),

sizeof(*s2mps11) is preferred.

--
With warm regards,
Sachin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/