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.

i3c: mipi-i3c-hci-pci: Factor out private registers ioremapping

For neatness, factor out private registers ioremapping.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20251128064038.55158-7-adrian.hunter@intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Adrian Hunter and committed by
Alexandre Belloni
9dfa23c4 fc6152dc

+8 -4
+8 -4
drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c
··· 27 27 #define INTEL_RESETS_RESET_DONE BIT(1) 28 28 #define INTEL_RESETS_TIMEOUT_US (10 * USEC_PER_MSEC) 29 29 30 + static void __iomem *intel_priv(struct pci_dev *pci) 31 + { 32 + resource_size_t base = pci_resource_start(pci, 0); 33 + 34 + return devm_ioremap(&pci->dev, base + INTEL_PRIV_OFFSET, INTEL_PRIV_SIZE); 35 + } 36 + 30 37 static int intel_i3c_init(struct pci_dev *pci) 31 38 { 32 - void __iomem *priv; 39 + void __iomem *priv = intel_priv(pci); 33 40 u32 reg; 34 41 35 - priv = devm_ioremap(&pci->dev, 36 - pci_resource_start(pci, 0) + INTEL_PRIV_OFFSET, 37 - INTEL_PRIV_SIZE); 38 42 if (!priv) 39 43 return -ENOMEM; 40 44