lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK9yfHyo7Qd_BQzEmViNJmLfd2bUk9dd8ud7GGrRxRkHm+UPXg@mail.gmail.com>
Date:	Wed, 3 Jul 2013 17:23:28 +0530
From:	Sachin Kamat <sachin.kamat@...aro.org>
To:	Yadwinder Singh Brar <yadi.brar@...sung.com>
Cc:	linux-kernel@...r.kernel.org, yadi.brar01@...il.com,
	sbkim73@...sung.com, broonie@...nel.org, lgirdwood@...il.com,
	sameo@...ux.intel.com, rob.herring@...xeda.com,
	grant.likely@...aro.org
Subject: Re: [PATCH 4/4] regulator: s2mps11: Add device tree support

> +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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ