Unverified Commit 12c574d8 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

regulator: slg51000: Remove unneeded regl_pdata from struct slg51000



Just use a local variable *ena_gpiod in slg51000_of_parse_cb instead.
With this change, the struct slg51000_pdata can be removed.

Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0a33d4fe
Loading
Loading
Loading
Loading
+6 −11
Original line number Diff line number Diff line
@@ -35,14 +35,9 @@ enum slg51000_regulators {
	SLG51000_MAX_REGULATORS,
};

struct slg51000_pdata {
	struct gpio_desc *ena_gpiod;
};

struct slg51000 {
	struct device *dev;
	struct regmap *regmap;
	struct slg51000_pdata regl_pdata[SLG51000_MAX_REGULATORS];
	struct regulator_desc *rdesc[SLG51000_MAX_REGULATORS];
	struct regulator_dev *rdev[SLG51000_MAX_REGULATORS];
	struct gpio_desc *cs_gpiod;
@@ -204,14 +199,14 @@ static int slg51000_of_parse_cb(struct device_node *np,
				struct regulator_config *config)
{
	struct slg51000 *chip = config->driver_data;
	struct slg51000_pdata *rpdata = &chip->regl_pdata[desc->id];
	struct gpio_desc *ena_gpiod;
	enum gpiod_flags gflags = GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE;

	rpdata->ena_gpiod = devm_gpiod_get_from_of_node(chip->dev, np,
	ena_gpiod = devm_gpiod_get_from_of_node(chip->dev, np,
						"enable-gpios", 0,
						gflags, "gpio-en-ldo");
	if (rpdata->ena_gpiod) {
		config->ena_gpiod = rpdata->ena_gpiod;
	if (ena_gpiod) {
		config->ena_gpiod = ena_gpiod;
		devm_gpiod_unhinge(chip->dev, config->ena_gpiod);
	}