Skip to content

Commit 0f20394

Browse files
tititiou36Jiri Kosina
authored andcommitted
HID: amd_sfh: Remove useless DMA-32 fallback configuration
As stated in [1], dma_set_mask() with a 64-bit mask never fails if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. Simplify code and remove some dead code accordingly. [1]: https://lore.kernel.org/linux-kernel/YL3vSPK5DXTNvgdx@infradead.org/#t Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent 9b57f45 commit 0f20394

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,8 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
248248
pci_set_master(pdev);
249249
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
250250
if (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-
}
251+
dev_err(&pdev->dev, "failed to set DMA mask\n");
252+
return rc;
256253
}
257254

258255
privdata->cl_data = devm_kzalloc(&pdev->dev, sizeof(struct amdtp_cl_data), GFP_KERNEL);

0 commit comments

Comments
 (0)