Skip to content

Commit 0f9ef14

Browse files
ahunter6alexandrebelloni
authored andcommitted
i3c: mipi-i3c-hci-pci: Change callback parameter
Prepare to add more callbacks in mipi_i3c_hci_pci_info. Change ->init() callback parameter from PCI device pointer to mipi_i3c_hci_pci_info device pointer. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20251128064038.55158-10-adrian.hunter@intel.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent da8116a commit 0f9ef14

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
#include <linux/platform_device.h>
1616

1717
struct mipi_i3c_hci_pci {
18+
struct pci_dev *pci;
1819
struct platform_device *pdev;
1920
};
2021

2122
struct mipi_i3c_hci_pci_info {
22-
int (*init)(struct pci_dev *pci);
23+
int (*init)(struct mipi_i3c_hci_pci *hci);
2324
};
2425

2526
static DEFINE_IDA(mipi_i3c_hci_pci_ida);
@@ -50,14 +51,14 @@ static void __iomem *intel_priv(struct pci_dev *pci)
5051
return devm_ioremap(&pci->dev, base + INTEL_PRIV_OFFSET, INTEL_PRIV_SIZE);
5152
}
5253

53-
static int intel_i3c_init(struct pci_dev *pci)
54+
static int intel_i3c_init(struct mipi_i3c_hci_pci *hci)
5455
{
55-
void __iomem *priv = intel_priv(pci);
56+
void __iomem *priv = intel_priv(hci->pci);
5657

5758
if (!priv)
5859
return -ENOMEM;
5960

60-
dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(64));
61+
dma_set_mask_and_coherent(&hci->pci->dev, DMA_BIT_MASK(64));
6162

6263
intel_reset(priv);
6364

@@ -80,6 +81,8 @@ static int mipi_i3c_hci_pci_probe(struct pci_dev *pci,
8081
if (!hci)
8182
return -ENOMEM;
8283

84+
hci->pci = pci;
85+
8386
ret = pcim_enable_device(pci);
8487
if (ret)
8588
return ret;
@@ -113,7 +116,7 @@ static int mipi_i3c_hci_pci_probe(struct pci_dev *pci,
113116

114117
info = (const struct mipi_i3c_hci_pci_info *)id->driver_data;
115118
if (info && info->init) {
116-
ret = info->init(pci);
119+
ret = info->init(hci);
117120
if (ret)
118121
goto err;
119122
}

0 commit comments

Comments
 (0)