linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
To: Nehal Shah <nehal-bakulchandra.shah@amd.com>,
	Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	"open list:AMD SENSOR FUSION HUB DRIVER" 
	<linux-input@vger.kernel.org>
Cc: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Subject: [PATCH 2/4] amd_sfh: Use dma_set_mask_and_coherent()
Date: Thu, 23 Sep 2021 17:59:28 +0530	[thread overview]
Message-ID: <20210923122930.3873914-3-Basavaraj.Natikar@amd.com> (raw)
In-Reply-To: <20210923122930.3873914-1-Basavaraj.Natikar@amd.com>

Use dma_set_mask_and_coherent() to set both the streaming and
coherent masks.

Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
---
 drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
index f5e580f598cd..ebe396a4570d 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
@@ -245,10 +245,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 = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
+	rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
 	if (rc) {
-		rc = dma_set_mask(&pdev->dev, 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);
-- 
2.25.1


  parent reply	other threads:[~2021-09-23 12:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23 12:29 [PATCH 0/4] Fixes and updates to amd-sfh driver Basavaraj Natikar
2021-09-23 12:29 ` [PATCH 1/4] amd_sfh: Fix potential NULL pointer dereference Basavaraj Natikar
2021-09-23 12:29 ` Basavaraj Natikar [this message]
2021-09-23 12:29 ` [PATCH 3/4] amd_sfh: switch from 'pci_' to 'dev_' API Basavaraj Natikar
2021-09-23 12:29 ` [PATCH 4/4] amd_sfh: Update Copyright details Basavaraj Natikar
2021-09-27  7:46 ` [PATCH 0/4] Fixes and updates to amd-sfh driver Jiri Kosina
2021-09-27  7:56   ` Basavaraj Natikar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210923122930.3873914-3-Basavaraj.Natikar@amd.com \
    --to=basavaraj.natikar@amd.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=nehal-bakulchandra.shah@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).