lkml.org 
[lkml]   [2015]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/4] regulator: qcom: Refactor of-parsing code
On 03/02/15 20:25, Bjorn Andersson wrote:
> +
> +static int rpm_reg_probe(struct platform_device *pdev)
> +{
> + struct regulator_init_data *initdata;
> + const struct qcom_rpm_reg *template;
> + const struct of_device_id *match;
> + struct regulator_config config = { };
> + struct regulator_dev *rdev;
> + struct qcom_rpm_reg *vreg;
> + const char *key;
> + u32 val;
> + int ret;
> +
> + match = of_match_device(rpm_of_match, &pdev->dev);
> + template = match->data;
> +
> + vreg = devm_kmalloc(&pdev->dev, sizeof(*vreg), GFP_KERNEL);
> + if (!vreg) {
> + dev_err(&pdev->dev, "failed to allocate vreg\n");

We don't need error messages on allocation failures.

> + return -ENOMEM;
> + }


--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project



\
 
 \ /
  Last update: 2015-03-03 20:01    [W:0.262 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site