Skip to content

Commit

Permalink
regulator: anatop: remove unneeded name field of struct anatop_regulator
Browse files Browse the repository at this point in the history
sreg->name is only used as an intermediate assign of rdesc->name, plus
another strcmp. Since we already have rdesc->name, no need it anymore.

Signed-off-by: Dong Aisheng <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
Dong Aisheng authored and broonie committed Apr 11, 2017
1 parent 5062e04 commit aeb1404
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/regulator/anatop-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#define LDO_FET_FULL_ON 0x1f

struct anatop_regulator {
const char *name;
u32 control_reg;
struct regmap *anatop;
int vol_bit_shift;
Expand Down Expand Up @@ -194,12 +193,12 @@ static int anatop_regulator_probe(struct platform_device *pdev)
if (!sreg)
return -ENOMEM;

of_property_read_string(np, "regulator-name", &sreg->name);
rdesc = &sreg->rdesc;
rdesc->name = sreg->name;
rdesc->type = REGULATOR_VOLTAGE;
rdesc->owner = THIS_MODULE;

of_property_read_string(np, "regulator-name", &rdesc->name);

initdata = of_get_regulator_init_data(dev, np, rdesc);
if (!initdata)
return -ENOMEM;
Expand Down Expand Up @@ -297,7 +296,7 @@ static int anatop_regulator_probe(struct platform_device *pdev)
* a sane default until imx6-cpufreq was probed and changes the
* voltage to the correct value. In this case we set 1.25V.
*/
if (!sreg->sel && !strcmp(sreg->name, "vddpu"))
if (!sreg->sel && !strcmp(rdesc->name, "vddpu"))
sreg->sel = 22;

if (!sreg->bypass && !sreg->sel) {
Expand Down

0 comments on commit aeb1404

Please sign in to comment.