lkml.org 
[lkml]   [2015]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 4/5] regulators: tps65912: Add regulator driver for the TPS65912 PMIC
On Thu, Sep 24, 2015 at 09:52:53AM -0500, Andrew F. Davis wrote:

> +static int tps65912_regulator_probe(struct platform_device *pdev)
> +{
> + struct tps65912 *tps = dev_get_drvdata(pdev->dev.parent);
> + struct regulator_init_data *init_data;
> + const struct tps_info *template;
> + struct regulator_dev *rdev;
> + const struct of_device_id *match;
> + struct regulator_config config = { };
> + int id;
> +
> + match = of_match_device(tps65912_regulator_of_match_table, &pdev->dev);
> + if (!match)
> + return -ENODEV;
> +
> + template = match->data;
> + id = template->id;
> + init_data = of_get_regulator_init_data(&pdev->dev, pdev->dev.of_node,
> + &regulators[id]);

Don't open code this stuff, use the core DT matching in the
regulator_desc instead.

Please also use subject lines mathcing the style for the subsystem.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2015-09-25 20:21    [W:0.130 / U:8.428 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site