diff options
author | Rafael J. Wysocki | 2021-07-23 17:06:15 +0200 |
---|---|---|
committer | Rafael J. Wysocki | 2021-07-23 17:06:15 +0200 |
commit | 0b8a53a8444c267114f6b5a85d21153ddea190eb (patch) | |
tree | 760576b9b9f0b1b335fd4102b027a7bed6e8e3c4 /drivers/media | |
parent | d2cbbf1fe503c07e466c62f83aa1926d74d15821 (diff) | |
parent | 71f6428332844f38c7cb10461d9f29e9c9b983a0 (diff) |
Merge branch 'acpi-utils'
* acpi-utils:
ACPI: utils: Fix reference counting in for_each_acpi_dev_match()
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/pci/intel/ipu3/cio2-bridge.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/pci/intel/ipu3/cio2-bridge.c b/drivers/media/pci/intel/ipu3/cio2-bridge.c index 4657e99df033..59a36f922675 100644 --- a/drivers/media/pci/intel/ipu3/cio2-bridge.c +++ b/drivers/media/pci/intel/ipu3/cio2-bridge.c @@ -173,10 +173,8 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg, int ret; for_each_acpi_dev_match(adev, cfg->hid, NULL, -1) { - if (!adev->status.enabled) { - acpi_dev_put(adev); + if (!adev->status.enabled) continue; - } if (bridge->n_sensors >= CIO2_NUM_PORTS) { acpi_dev_put(adev); @@ -185,7 +183,6 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg, } sensor = &bridge->sensors[bridge->n_sensors]; - sensor->adev = adev; strscpy(sensor->name, cfg->hid, sizeof(sensor->name)); ret = cio2_bridge_read_acpi_buffer(adev, "SSDB", @@ -215,6 +212,7 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg, goto err_free_swnodes; } + sensor->adev = acpi_dev_get(adev); adev->fwnode.secondary = fwnode; dev_info(&cio2->dev, "Found supported sensor %s\n", |