Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

PCI/pwrctrl: tc9563: Use put_device() instead of i2c_put_adapter()

The API comment for of_find_i2c_adapter_by_node() recommends using
put_device() to drop the reference count of I2C adapter instead of using
i2c_put_adapter(). So replace i2c_put_adapter() with put_device().

Fixes: 4c9c7be47310 ("PCI: pwrctrl: Add power control driver for TC9563")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260115-pci-pwrctrl-rework-v5-3-9d26da3ce903@oss.qualcomm.com

authored by

Manivannan Sadhasivam and committed by
Bjorn Helgaas
99ee5837 e40d16e6

+3 -3
+3 -3
drivers/pci/pwrctrl/pci-pwrctrl-tc9563.c
··· 533 533 ctx->client = i2c_new_dummy_device(ctx->adapter, addr); 534 534 if (IS_ERR(ctx->client)) { 535 535 dev_err(dev, "Failed to create I2C client\n"); 536 - i2c_put_adapter(ctx->adapter); 536 + put_device(&ctx->adapter->dev); 537 537 return PTR_ERR(ctx->client); 538 538 } 539 539 ··· 613 613 tc9563_pwrctrl_power_off(ctx); 614 614 remove_i2c: 615 615 i2c_unregister_device(ctx->client); 616 - i2c_put_adapter(ctx->adapter); 616 + put_device(&ctx->adapter->dev); 617 617 return ret; 618 618 } 619 619 ··· 623 623 624 624 tc9563_pwrctrl_power_off(ctx); 625 625 i2c_unregister_device(ctx->client); 626 - i2c_put_adapter(ctx->adapter); 626 + put_device(&ctx->adapter->dev); 627 627 } 628 628 629 629 static const struct of_device_id tc9563_pwrctrl_of_match[] = {