.irq_mode = 0,
};
-static int ipc_probe(struct pci_dev *dev, const struct pci_device_id *id);
-static void ipc_remove(struct pci_dev *pdev);
-
struct intel_scu_ipc_dev {
- struct pci_dev *pdev;
+ struct device *dev;
void __iomem *ipc_base;
void __iomem *i2c_base;
struct completion cmd_complete;
}
if (status & BIT(0)) {
- dev_err(&scu->pdev->dev, "IPC timed out");
+ dev_err(scu->dev, "IPC timed out");
return -ETIMEDOUT;
}
int status;
if (!wait_for_completion_timeout(&scu->cmd_complete, 3 * HZ)) {
- struct device *dev = &scu->pdev->dev;
- dev_err(dev, "IPC timed out\n");
+ dev_err(scu->dev, "IPC timed out\n");
return -ETIMEDOUT;
}
mutex_lock(&ipclock);
- if (scu->pdev == NULL) {
+ if (scu->dev == NULL) {
mutex_unlock(&ipclock);
return -ENODEV;
}
int err;
mutex_lock(&ipclock);
- if (scu->pdev == NULL) {
+ if (scu->dev == NULL) {
mutex_unlock(&ipclock);
return -ENODEV;
}
int i, err;
mutex_lock(&ipclock);
- if (scu->pdev == NULL) {
+ if (scu->dev == NULL) {
mutex_unlock(&ipclock);
return -ENODEV;
}
u32 cmd = 0;
mutex_lock(&ipclock);
- if (scu->pdev == NULL) {
+ if (scu->dev == NULL) {
mutex_unlock(&ipclock);
return -ENODEV;
}
mdelay(1);
writel(addr, scu->i2c_base + IPC_I2C_CNTRL_ADDR);
} else {
- dev_err(&scu->pdev->dev,
+ dev_err(scu->dev,
"intel_scu_ipc: I2C INVALID_CMD = 0x%x\n", cmd);
mutex_unlock(&ipclock);
/**
* ipc_probe - probe an Intel SCU IPC
- * @dev: the PCI device matching
+ * @pdev: the PCI device matching
* @id: entry in the match table
*
* Enable and install an intel SCU IPC. This appears in the PCI space
* but uses some hard coded addresses as well.
*/
-static int ipc_probe(struct pci_dev *dev, const struct pci_device_id *id)
+static int ipc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{
int err;
struct intel_scu_ipc_dev *scu = &ipcdev;
struct intel_scu_ipc_pdata_t *pdata;
- if (scu->pdev) /* We support only one SCU */
+ if (scu->dev) /* We support only one SCU */
return -EBUSY;
pdata = (struct intel_scu_ipc_pdata_t *)id->driver_data;
- scu->pdev = pci_dev_get(dev);
+ scu->dev = &pdev->dev;
scu->irq_mode = pdata->irq_mode;
- err = pcim_enable_device(dev);
+ err = pcim_enable_device(pdev);
if (err)
return err;
- err = pcim_iomap_regions(dev, 1 << 0, pci_name(dev));
+ err = pcim_iomap_regions(pdev, 1 << 0, pci_name(pdev));
if (err)
return err;
init_completion(&scu->cmd_complete);
- err = devm_request_irq(&dev->dev, dev->irq, ioc, 0, "intel_scu_ipc",
+ err = devm_request_irq(&pdev->dev, pdev->irq, ioc, 0, "intel_scu_ipc",
scu);
if (err)
return err;
- scu->ipc_base = pcim_iomap_table(dev)[0];
+ scu->ipc_base = pcim_iomap_table(pdev)[0];
scu->i2c_base = ioremap_nocache(pdata->i2c_base, pdata->i2c_len);
if (!scu->i2c_base)
intel_scu_devices_create();
- pci_set_drvdata(dev, scu);
+ pci_set_drvdata(pdev, scu);
return 0;
}
{
struct intel_scu_ipc_dev *scu = pci_get_drvdata(pdev);
- pci_dev_put(scu->pdev);
- scu->pdev = NULL;
+ scu->dev = NULL;
iounmap(scu->i2c_base);
intel_scu_devices_destroy();
}