Commit 598a2b3e authored by Bartosz Golaszewski's avatar Bartosz Golaszewski
Browse files

gpio: aggregator: lock device when calling device_is_bound()

The kerneldoc for device_is_bound() says it must be called with the
device lock taken. Add missing synchronization to this driver.

Fixes: 3a27f40b ("gpio: aggregator: stop using dev-sync-probe")
Link: https://patch.msgid.link/20260518-gpio-dev-lock-v1-2-cc4736f3ff0b@oss.qualcomm.com


Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
parent e70ae40d
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -968,10 +968,13 @@ static int gpio_aggregator_activate(struct gpio_aggregator *aggr)
	}

	wait_for_device_probe();

	scoped_guard(device, &pdev->dev) {
		if (!device_is_bound(&pdev->dev)) {
			ret = -ENXIO;
			goto err_unregister_pdev;
		}
	}

	aggr->pdev = pdev;
	return 0;