mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-11 07:39:47 +00:00
soundwire: bus_type: convert open-coded while() to for() loop
No functionality change, just more structured code. Suggested-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20200608205436.2402-3-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
e3f88cdb8f
commit
ee9173db50
@ -20,14 +20,12 @@
|
||||
static const struct sdw_device_id *
|
||||
sdw_get_device_id(struct sdw_slave *slave, struct sdw_driver *drv)
|
||||
{
|
||||
const struct sdw_device_id *id = drv->id_table;
|
||||
const struct sdw_device_id *id;
|
||||
|
||||
while (id && id->mfg_id) {
|
||||
for (id = drv->id_table; id && id->mfg_id; id++)
|
||||
if (slave->id.mfg_id == id->mfg_id &&
|
||||
slave->id.part_id == id->part_id)
|
||||
return id;
|
||||
id++;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user