[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJAp7OjCswEwXAmqB0kHeNBdZEN0EQ1aYnXF9g9YNQehAb+Njg@mail.gmail.com>
Date: Mon, 6 Apr 2015 09:59:36 -0700
From: Bjorn Andersson <bjorn@...o.se>
To: Stephen Boyd <sboyd@...eaurora.org>
Cc: Bjorn Andersson <bjorn.andersson@...ymobile.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Andy Gross <agross@...eaurora.org>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
linux-arm-msm <linux-arm-msm@...r.kernel.org>
Subject: Re: [PATCH v2 5/5] regulator: qcom: Rework to single platform device
On Thu, Apr 2, 2015 at 4:02 PM, Stephen Boyd <sboyd@...eaurora.org> wrote:
> On 04/01/15 15:55, Bjorn Andersson wrote:
>> +static int rpm_reg_probe(struct platform_device *pdev)
>> +{
>> + const struct rpm_regulator_data *reg;
>> + const struct of_device_id *match;
>> + struct regulator_config config = { };
>> + struct regulator_dev *rdev;
>> + struct qcom_rpm_reg *vreg;
>>
>> - ret = rpm_reg_of_parse(pdev->dev.of_node, &vreg->desc, &config);
>> - if (ret)
>> - return ret;
>> + match = of_match_device(rpm_of_match, &pdev->dev);
>> + for (reg = match->data; reg->name; reg++) {
>> + vreg = devm_kmalloc(&pdev->dev, sizeof(*vreg), GFP_KERNEL);
>> + if (!vreg) {
>> + dev_err(&pdev->dev, "failed to allocate vreg\n");
>
> Please remove useless error message on allocation failures.
>
I didn't want to touch this line, to keep the diff as clean as
possible. But I forgot about the promised patch to clean up this and
the rpm reference retrieval.
Sorry about that - will prepare the patch and send it out.
[..]
>>
>> - rdev = devm_regulator_register(&pdev->dev, &vreg->desc, &config);
>> - if (IS_ERR(rdev)) {
>> - dev_err(&pdev->dev, "can't register regulator\n");
>> - return PTR_ERR(rdev);
>> + config.dev = &pdev->dev;
>> + config.driver_data = vreg;
>> + rdev = devm_regulator_register(&pdev->dev, &vreg->desc, &config);
>> + if (IS_ERR(rdev)) {
>> + dev_err(&pdev->dev, "can't register regulator\n");
>
> It'd be nice to know which regulator failed to register.
>
I agree, will update this.
Regards,
Bjorn
--
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