Skip to content

Commit a6e757e

Browse files
author
Jiri Kosina
committed
Merge branch 'for-5.16/amd-sfh' into for-linus
- code cleanups (Basavaraj Natikar, Christophe JAILLET)
2 parents 43775e6 + f75203c commit a6e757e

8 files changed

Lines changed: 26 additions & 14 deletions

File tree

drivers/hid/amd-sfh-hid/amd_sfh_client.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22
/*
33
* AMD SFH Client Layer
4-
* Copyright 2020 Advanced Micro Devices, Inc.
4+
* Copyright 2020-2021 Advanced Micro Devices, Inc.
55
* Authors: Nehal Bakulchandra Shah <Nehal-Bakulchandra.Shah@amd.com>
66
* Sandeep Singh <Sandeep.singh@amd.com>
7+
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
78
*/
89

910
#include <linux/dma-mapping.h>

drivers/hid/amd-sfh-hid/amd_sfh_hid.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
/*
33
* AMD MP2 Sensors transport driver
44
*
5+
* Copyright 2020-2021 Advanced Micro Devices, Inc.
56
* Authors: Nehal Bakulchandra Shah <Nehal-bakulchandra.shah@amd.com>
67
* Sandeep Singh <sandeep.singh@amd.com>
8+
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
79
*/
810
#include <linux/hid.h>
911
#include <linux/wait.h>

drivers/hid/amd-sfh-hid/amd_sfh_hid.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
/*
33
* AMD MP2 Sensors transport driver
44
*
5+
* Copyright 2020-2021 Advanced Micro Devices, Inc.
56
* Authors: Nehal Bakulchandra Shah <Nehal-bakulchandra.shah@amd.com>
67
* Sandeep Singh <sandeep.singh@amd.com>
8+
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
79
*/
810

911
#ifndef AMDSFH_HID_H

drivers/hid/amd-sfh-hid/amd_sfh_pcie.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22
/*
33
* AMD MP2 PCIe communication driver
4-
* Copyright 2020 Advanced Micro Devices, Inc.
4+
* Copyright 2020-2021 Advanced Micro Devices, Inc.
55
*
66
* Authors: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
77
* Sandeep Singh <Sandeep.singh@amd.com>
8+
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
89
*/
910

1011
#include <linux/bitops.h>
@@ -234,7 +235,7 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
234235
return -ENOMEM;
235236

236237
privdata->pdev = pdev;
237-
pci_set_drvdata(pdev, privdata);
238+
dev_set_drvdata(&pdev->dev, privdata);
238239
rc = pcim_enable_device(pdev);
239240
if (rc)
240241
return rc;
@@ -245,10 +246,13 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
245246

246247
privdata->mmio = pcim_iomap_table(pdev)[2];
247248
pci_set_master(pdev);
248-
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
249+
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
249250
if (rc) {
250-
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
251-
return rc;
251+
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
252+
if (rc) {
253+
dev_err(&pdev->dev, "failed to set DMA mask\n");
254+
return rc;
255+
}
252256
}
253257

254258
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
266270

267271
static int __maybe_unused amd_mp2_pci_resume(struct device *dev)
268272
{
269-
struct pci_dev *pdev = to_pci_dev(dev);
270-
struct amd_mp2_dev *mp2 = pci_get_drvdata(pdev);
273+
struct amd_mp2_dev *mp2 = dev_get_drvdata(dev);
271274
struct amdtp_cl_data *cl_data = mp2->cl_data;
272275
struct amd_mp2_sensor_info info;
273276
int i, status;
@@ -292,8 +295,7 @@ static int __maybe_unused amd_mp2_pci_resume(struct device *dev)
292295

293296
static int __maybe_unused amd_mp2_pci_suspend(struct device *dev)
294297
{
295-
struct pci_dev *pdev = to_pci_dev(dev);
296-
struct amd_mp2_dev *mp2 = pci_get_drvdata(pdev);
298+
struct amd_mp2_dev *mp2 = dev_get_drvdata(dev);
297299
struct amdtp_cl_data *cl_data = mp2->cl_data;
298300
int i, status;
299301

@@ -334,3 +336,4 @@ MODULE_DESCRIPTION(DRIVER_DESC);
334336
MODULE_LICENSE("Dual BSD/GPL");
335337
MODULE_AUTHOR("Shyam Sundar S K <Shyam-sundar.S-k@amd.com>");
336338
MODULE_AUTHOR("Sandeep Singh <Sandeep.singh@amd.com>");
339+
MODULE_AUTHOR("Basavaraj Natikar <Basavaraj.Natikar@amd.com>");

drivers/hid/amd-sfh-hid/amd_sfh_pcie.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/* SPDX-License-Identifier: GPL-2.0-or-later */
22
/*
33
* AMD MP2 PCIe communication driver
4-
* Copyright 2020 Advanced Micro Devices, Inc.
4+
* Copyright 2020-2021 Advanced Micro Devices, Inc.
55
* Authors: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
66
* Sandeep Singh <Sandeep.singh@amd.com>
7+
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
78
*/
89

910
#ifndef PCIE_MP2_AMD_H

drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22
/*
33
* AMD SFH Report Descriptor generator
4-
* Copyright 2020 Advanced Micro Devices, Inc.
4+
* Copyright 2020-2021 Advanced Micro Devices, Inc.
55
* Authors: Nehal Bakulchandra Shah <Nehal-Bakulchandra.Shah@amd.com>
66
* Sandeep Singh <sandeep.singh@amd.com>
7+
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
78
*/
89

910
#include <linux/kernel.h>

drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/* SPDX-License-Identifier: GPL-2.0-or-later */
22
/*
33
* HID report descriptors, structures and routines
4-
* Copyright 2020 Advanced Micro Devices, Inc.
4+
* Copyright 2020-2021 Advanced Micro Devices, Inc.
55
* Authors: Nehal Bakulchandra Shah <Nehal-bakulchandra.shah@amd.com>
66
* Sandeep Singh <Sandeep.singh@amd.com>
7+
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
78
*/
89

910
#ifndef AMD_SFH_HID_DESCRIPTOR_H

drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_report_desc.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/* SPDX-License-Identifier: GPL-2.0-or-later */
22
/*
33
* HID descriptor stuructures
4-
* Copyright 2020 Advanced Micro Devices, Inc.
4+
* Copyright 2020-2021 Advanced Micro Devices, Inc.
55
* Authors: Nehal Bakulchandra Shah <Nehal-bakulchandra.shah@amd.com>
66
* Sandeep Singh <Sandeep.singh@amd.com>
7+
* Basavaraj Natikar <Basavaraj.Natikar@amd.com>
78
*/
89

910
#ifndef AMD_SFH_HID_REPORT_DESCRIPTOR_H

0 commit comments

Comments
 (0)