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.

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>

authored by

Johan Hovold and committed by
Andi Shyti
7021f6c0 518edab3

+5 -3
+5 -3
drivers/i2c/busses/i2c-amd-mp2-pci.c
··· 456 456 457 457 struct amd_mp2_dev *amd_mp2_find_device(void) 458 458 { 459 + struct amd_mp2_dev *privdata; 459 460 struct device *dev; 460 461 struct pci_dev *pci_dev; 461 - struct amd_mp2_dev *mp2_dev; 462 462 463 463 dev = driver_find_next_device(&amd_mp2_pci_driver.driver, NULL); 464 464 if (!dev) 465 465 return NULL; 466 466 467 467 pci_dev = to_pci_dev(dev); 468 - mp2_dev = (struct amd_mp2_dev *)pci_get_drvdata(pci_dev); 468 + privdata = pci_get_drvdata(pci_dev); 469 + 469 470 put_device(dev); 470 - return mp2_dev; 471 + 472 + return privdata; 471 473 } 472 474 EXPORT_SYMBOL_GPL(amd_mp2_find_device); 473 475