gpio: sim: 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: 7fb3287946 ("gpio: sim: stop using dev-sync-probe")
Link: https://patch.msgid.link/20260518-gpio-dev-lock-v1-1-cc4736f3ff0b@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
This commit is contained in:
parent
61fef83f23
commit
e70ae40d66
1 changed files with 7 additions and 4 deletions
|
|
@ -901,7 +901,7 @@ static int gpio_sim_device_activate(struct gpio_sim_device *dev)
|
|||
struct platform_device *pdev;
|
||||
struct fwnode_handle *swnode;
|
||||
struct gpio_sim_bank *bank;
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
lockdep_assert_held(&dev->lock);
|
||||
|
||||
|
|
@ -945,9 +945,12 @@ static int gpio_sim_device_activate(struct gpio_sim_device *dev)
|
|||
}
|
||||
|
||||
wait_for_device_probe();
|
||||
if (!device_is_bound(&pdev->dev)) {
|
||||
ret = -ENXIO;
|
||||
goto err_unregister_pdev;
|
||||
|
||||
scoped_guard(device, &pdev->dev) {
|
||||
if (!device_is_bound(&pdev->dev)) {
|
||||
ret = -ENXIO;
|
||||
goto err_unregister_pdev;
|
||||
}
|
||||
}
|
||||
|
||||
dev->pdev = pdev;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue