Skip to content

Commit f9dc0c4

Browse files
author
Wolfram Sang
committed
Merge branch 'i2c/for-current' into i2c/for-mergewindow
I missed the last chance to send this in for 6.9, so it now goes into the 6.10 queue
2 parents fec1982 + 3f858bb commit f9dc0c4

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

drivers/i2c/i2c-core-acpi.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,11 @@ static struct i2c_client *i2c_acpi_find_client_by_adev(struct acpi_device *adev)
445445
return i2c_find_device_by_fwnode(acpi_fwnode_handle(adev));
446446
}
447447

448+
static struct i2c_adapter *i2c_acpi_find_adapter_by_adev(struct acpi_device *adev)
449+
{
450+
return i2c_find_adapter_by_fwnode(acpi_fwnode_handle(adev));
451+
}
452+
448453
static int i2c_acpi_notify(struct notifier_block *nb, unsigned long value,
449454
void *arg)
450455
{
@@ -471,11 +476,17 @@ static int i2c_acpi_notify(struct notifier_block *nb, unsigned long value,
471476
break;
472477

473478
client = i2c_acpi_find_client_by_adev(adev);
474-
if (!client)
475-
break;
479+
if (client) {
480+
i2c_unregister_device(client);
481+
put_device(&client->dev);
482+
}
483+
484+
adapter = i2c_acpi_find_adapter_by_adev(adev);
485+
if (adapter) {
486+
acpi_unbind_one(&adapter->dev);
487+
put_device(&adapter->dev);
488+
}
476489

477-
i2c_unregister_device(client);
478-
put_device(&client->dev);
479490
break;
480491
}
481492

0 commit comments

Comments
 (0)