Loading drivers/hid/intel-ish-hid/ipc/ipc.c +6 −3 Original line number Diff line number Diff line Loading @@ -907,7 +907,8 @@ struct ishtp_device *ish_dev_init(struct pci_dev *pdev) struct ishtp_device *dev; int i; dev = kzalloc(sizeof(struct ishtp_device) + sizeof(struct ish_hw), dev = devm_kzalloc(&pdev->dev, sizeof(struct ishtp_device) + sizeof(struct ish_hw), GFP_KERNEL); if (!dev) return NULL; Loading @@ -925,7 +926,9 @@ struct ishtp_device *ish_dev_init(struct pci_dev *pdev) for (i = 0; i < IPC_TX_FIFO_SIZE; ++i) { struct wr_msg_ctl_info *tx_buf; tx_buf = kzalloc(sizeof(struct wr_msg_ctl_info), GFP_KERNEL); tx_buf = devm_kzalloc(&pdev->dev, sizeof(struct wr_msg_ctl_info), GFP_KERNEL); if (!tx_buf) { /* * IPC buffers may be limited or not available Loading drivers/hid/intel-ish-hid/ipc/pci-ish.c +11 −2 Original line number Diff line number Diff line Loading @@ -95,6 +95,13 @@ static int ish_init(struct ishtp_device *dev) return 0; } static const struct pci_device_id ish_invalid_pci_ids[] = { /* Mehlow platform special pci ids */ {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xA309)}, {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xA30A)}, {} }; /** * ish_probe() - PCI driver probe callback * @pdev: pci device Loading @@ -110,6 +117,10 @@ static int ish_probe(struct pci_dev *pdev, const struct pci_device_id *ent) struct ish_hw *hw; int ret; /* Check for invalid platforms for ISH support */ if (pci_dev_present(ish_invalid_pci_ids)) return -ENODEV; /* enable pci dev */ ret = pci_enable_device(pdev); if (ret) { Loading Loading @@ -172,7 +183,6 @@ static int ish_probe(struct pci_dev *pdev, const struct pci_device_id *ent) free_irq(pdev->irq, dev); free_device: pci_iounmap(pdev, hw->mem_addr); kfree(dev); release_regions: pci_release_regions(pdev); disable_device: Loading Loading @@ -202,7 +212,6 @@ static void ish_remove(struct pci_dev *pdev) pci_release_regions(pdev); pci_clear_master(pdev); pci_disable_device(pdev); kfree(ishtp_dev); } static struct device __maybe_unused *ish_resume_device; Loading Loading
drivers/hid/intel-ish-hid/ipc/ipc.c +6 −3 Original line number Diff line number Diff line Loading @@ -907,7 +907,8 @@ struct ishtp_device *ish_dev_init(struct pci_dev *pdev) struct ishtp_device *dev; int i; dev = kzalloc(sizeof(struct ishtp_device) + sizeof(struct ish_hw), dev = devm_kzalloc(&pdev->dev, sizeof(struct ishtp_device) + sizeof(struct ish_hw), GFP_KERNEL); if (!dev) return NULL; Loading @@ -925,7 +926,9 @@ struct ishtp_device *ish_dev_init(struct pci_dev *pdev) for (i = 0; i < IPC_TX_FIFO_SIZE; ++i) { struct wr_msg_ctl_info *tx_buf; tx_buf = kzalloc(sizeof(struct wr_msg_ctl_info), GFP_KERNEL); tx_buf = devm_kzalloc(&pdev->dev, sizeof(struct wr_msg_ctl_info), GFP_KERNEL); if (!tx_buf) { /* * IPC buffers may be limited or not available Loading
drivers/hid/intel-ish-hid/ipc/pci-ish.c +11 −2 Original line number Diff line number Diff line Loading @@ -95,6 +95,13 @@ static int ish_init(struct ishtp_device *dev) return 0; } static const struct pci_device_id ish_invalid_pci_ids[] = { /* Mehlow platform special pci ids */ {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xA309)}, {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xA30A)}, {} }; /** * ish_probe() - PCI driver probe callback * @pdev: pci device Loading @@ -110,6 +117,10 @@ static int ish_probe(struct pci_dev *pdev, const struct pci_device_id *ent) struct ish_hw *hw; int ret; /* Check for invalid platforms for ISH support */ if (pci_dev_present(ish_invalid_pci_ids)) return -ENODEV; /* enable pci dev */ ret = pci_enable_device(pdev); if (ret) { Loading Loading @@ -172,7 +183,6 @@ static int ish_probe(struct pci_dev *pdev, const struct pci_device_id *ent) free_irq(pdev->irq, dev); free_device: pci_iounmap(pdev, hw->mem_addr); kfree(dev); release_regions: pci_release_regions(pdev); disable_device: Loading Loading @@ -202,7 +212,6 @@ static void ish_remove(struct pci_dev *pdev) pci_release_regions(pdev); pci_clear_master(pdev); pci_disable_device(pdev); kfree(ishtp_dev); } static struct device __maybe_unused *ish_resume_device; Loading