diff options
| author | Johan Hovold <johan@kernel.org> | 2025-12-10 13:02:58 +0900 |
|---|---|---|
| committer | Andi Shyti <andi.shyti@kernel.org> | 2026-01-16 13:45:05 +0100 |
| commit | 7021f6c038d0ecd1535e279dfd18dc4bf2dd899e (patch) | |
| tree | 70c4d85b2a9df3fea89841c98a94d698d5e4f713 | |
| parent | 518edab3ad4f61204af788b3dcf9ed4087cdc275 (diff) | |
i2c: amd-mp2: clean up amd_mp2_find_device()
Rename the driver data pointer for consistency with the rest of the
driver and drop a redundant cast.
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://lore.kernel.org/r/20251210040258.60106-1-johan@kernel.org
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
| -rw-r--r-- | drivers/i2c/busses/i2c-amd-mp2-pci.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-amd-mp2-pci.c b/drivers/i2c/busses/i2c-amd-mp2-pci.c index 60edbabc2986..5b41d18b62d3 100644 --- a/drivers/i2c/busses/i2c-amd-mp2-pci.c +++ b/drivers/i2c/busses/i2c-amd-mp2-pci.c @@ -456,18 +456,20 @@ module_pci_driver(amd_mp2_pci_driver); struct amd_mp2_dev *amd_mp2_find_device(void) { + struct amd_mp2_dev *privdata; struct device *dev; struct pci_dev *pci_dev; - struct amd_mp2_dev *mp2_dev; dev = driver_find_next_device(&amd_mp2_pci_driver.driver, NULL); if (!dev) return NULL; pci_dev = to_pci_dev(dev); - mp2_dev = (struct amd_mp2_dev *)pci_get_drvdata(pci_dev); + privdata = pci_get_drvdata(pci_dev); + put_device(dev); - return mp2_dev; + + return privdata; } EXPORT_SYMBOL_GPL(amd_mp2_find_device); |
