On Mon, Feb 15, 2016 at 05:49:29PM +0530, Vaibhav Agarwal wrote:
This is preperation to allow dynamic DAI link insertion & removal.
Which there is no proposed user of here...
Currently, DAI links are added/removed once during soc-card instatiate & removal. Thus, irrespective of usage count by multiple DAI links, DAIs and components are probed or removed only once while maintaining 'probed' flag. However, in case of dynamic DAI link insertion/removal we need to ensure DAI/components are not unnecessarily probed multiple & not removed mistakenly while in use by any other existing DAI link. Thus, ref_count is used to maintain their usage count.
Please use normal changelog formatting - either consistent line lengths or blank lines between paragraphs depending on what you're trying to accomplish here.
- if (!dai->probed && dai->driver->probe_order == order) {
if (dai->driver->probe) {
ret = dai->driver->probe(dai);
if (ret < 0) {
dev_err(dai->dev,
"ASoC: failed to probe DAI %s: %d\n",
dai->name, ret);
return ret;
- if (dai->driver->probe_order == order) {
if (!dai->probed) {
if (dai->driver->probe) {
ret = dai->driver->probe(dai);
if (ret < 0) {
dev_err(dai->dev,
"ASoC: failed to probe DAI %s: %d\n",
dai->name, ret);
return ret;
} }
}
dai->probed = 1;
dai->probed = 1;
}
}dai->ref_count++;
I don't understand this at all - why the complete reindent and change of condition, don't we just increase the refcount when we flag as probed (and why do we still have the probed flag after this)?