Re: [PATCH 4/4] ASoC: OMAP: ams-delta: drop .set_bias_level callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Dec 24, 2011 at 12:12:24AM +0100, Janusz Krzysztofik wrote:

> +struct regulator_consumer_data {
> +	struct mutex lock;
> +	struct regulator *regulator;
> +	bool enabled;
> +};
> +
> +static int regulator_toggle(struct regulator_consumer_data *consumer,
> +		bool enable)
> +{
> +	int err = 0;
> +
> +	if (!consumer->regulator)
> +		return -ENODEV;
> +
> +	mutex_lock(&consumer->lock);
> +	if (IS_ERR(consumer->regulator)) {
> +		err = PTR_ERR(consumer->regulator);
> +	} else if (enable) {
> +		if (!consumer->enabled) {
> +			err = regulator_enable(consumer->regulator);
> +			consumer->enabled = true;
> +		}
> +	} else {
> +		if (consumer->enabled) {
> +			err = regulator_disable(consumer->regulator);
> +			consumer->enabled = false;
> +		}
> +	}
> +	mutex_unlock(&consumer->lock);
> +
> +	return err;
> +}
> +

Why's this code not been dropped and what is it for?
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux