diff options
Diffstat (limited to 'drivers/hid/amd-sfh-hid/amd_sfh_pcie.c')
-rw-r--r-- | drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c index 05c007b213f2..2503be0253d3 100644 --- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c @@ -1,10 +1,11 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * AMD MP2 PCIe communication driver - * Copyright 2020 Advanced Micro Devices, Inc. + * Copyright 2020-2021 Advanced Micro Devices, Inc. * * Authors: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> * Sandeep Singh <Sandeep.singh@amd.com> + * Basavaraj Natikar <Basavaraj.Natikar@amd.com> */ #include <linux/bitops.h> @@ -234,7 +235,7 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i return -ENOMEM; privdata->pdev = pdev; - pci_set_drvdata(pdev, privdata); + dev_set_drvdata(&pdev->dev, privdata); rc = pcim_enable_device(pdev); if (rc) return rc; @@ -245,10 +246,13 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i privdata->mmio = pcim_iomap_table(pdev)[2]; pci_set_master(pdev); - rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(64)); + rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); if (rc) { - rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); - return rc; + rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); + if (rc) { + dev_err(&pdev->dev, "failed to set DMA mask\n"); + return rc; + } } privdata->cl_data = devm_kzalloc(&pdev->dev, sizeof(struct amdtp_cl_data), GFP_KERNEL); @@ -266,8 +270,7 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i static int __maybe_unused amd_mp2_pci_resume(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct amd_mp2_dev *mp2 = pci_get_drvdata(pdev); + struct amd_mp2_dev *mp2 = dev_get_drvdata(dev); struct amdtp_cl_data *cl_data = mp2->cl_data; struct amd_mp2_sensor_info info; int i, status; @@ -292,8 +295,7 @@ static int __maybe_unused amd_mp2_pci_resume(struct device *dev) static int __maybe_unused amd_mp2_pci_suspend(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct amd_mp2_dev *mp2 = pci_get_drvdata(pdev); + struct amd_mp2_dev *mp2 = dev_get_drvdata(dev); struct amdtp_cl_data *cl_data = mp2->cl_data; int i, status; @@ -334,3 +336,4 @@ MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("Dual BSD/GPL"); MODULE_AUTHOR("Shyam Sundar S K <Shyam-sundar.S-k@amd.com>"); MODULE_AUTHOR("Sandeep Singh <Sandeep.singh@amd.com>"); +MODULE_AUTHOR("Basavaraj Natikar <Basavaraj.Natikar@amd.com>"); |