Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1690617ybh; Tue, 14 Jul 2020 04:56:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/9xOUkoQGN2VBoIrx2MjJxhr69r6uMXRp5iySWYqDVKTM+bPPpJpeaeJfOJ4Drvx3XbFa X-Received: by 2002:a17:906:da19:: with SMTP id fi25mr4035434ejb.369.1594727778682; Tue, 14 Jul 2020 04:56:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594727778; cv=none; d=google.com; s=arc-20160816; b=SSdJpPieiUIBJjRcamTCm+Zg48WOMQOjVb4sPyaJ26L0t2KK2L2qvJQ8Mikfypl130 WLVppgz39kU1ilWx1YeXG+bgiOY4fdBp7GLZYqWzPDk5FCHZYK01RjOebvCnlAE7UkQ0 RRKJnHcFqGO0Fow5QQRDUg2AJxtCV28mJQqUJbnF+O8QFUq4SvvniHFo1D4Ta3rwxq5X wqpoBQbgQQgsqGf2iSltEeydwQ1XPFdv/fsvfOQpc8Wk8sKYVKu7bFT4so4W+YxiMSCX 3WXBVg0XpLQaAr4irsfxJu7k8sDESs9az6DFzr5O8ij8steWUNNSG44d4PMB7GM+pHxP i9og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=gcGnZKmOcvQR6JjKvFpEHmamTFte6m24wBtwFxccrg0=; b=tEdLnwmCNesBfhVFhKzCq4/xMC8DF9T2mZYKhFiAuaFppneaeOGEvlexXpfQDjCkNJ LliPPt42wQhvNEUzhEY76oKkkz+yxXsF9FMRUoHbcRUat1ymWYB8ve9ZQP3z7yrq6klq rsQW5MZYdq9K8BOJVo4ywwn/upGQ4PiD0yF9TLIvfY06jJUnwhHiD8akKLt4UO2EjqRt rCm5ZIMKnJIhd1IDcDi1a9nWF8U7u45jE4qv08o/VQj+OTeo5mkGNsQiQlon3QwYHv18 9e5IME10RDl4X4ZjsaWIPYXQkaIUYI9Vfdn/8YTghaHW38i+VptLYdz5YYXzj/UB2hfK xBJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dW7IjMJ+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k6si11337034edn.299.2020.07.14.04.55.53; Tue, 14 Jul 2020 04:56:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dW7IjMJ+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728032AbgGNLxJ (ORCPT + 99 others); Tue, 14 Jul 2020 07:53:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727991AbgGNLxH (ORCPT ); Tue, 14 Jul 2020 07:53:07 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3ECAEC061755; Tue, 14 Jul 2020 04:53:07 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id w2so7485442pgg.10; Tue, 14 Jul 2020 04:53:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=gcGnZKmOcvQR6JjKvFpEHmamTFte6m24wBtwFxccrg0=; b=dW7IjMJ+MmtbcJCvGERY0fKKNbNVEGpkKBt+QKvOfV0raXbPhVTdFJ15c/F3EoMOIP W4MHVxHoT4KPT7wGpNjkaDIQukZDXFi4F0SVN37jGB6Whhkqiwv0n2nBh7pDpwhK7+pz tk+U2ekQl+BcEDcPa2jbD71DoBFYUn2P+BR16yuEjZkMYk/hd8vmnrd14m1iLp4Xehxw Rk8CAED+knH/QWR56T1mqzlzRogmossepTgGXfJ4g9LVg4l5gB9IGbTkggVAamBtuYIa RoVYRy1KiEuE9cACMIHEJy/c1yDRnZpQpukkFab0flTzgQuTfHPgltSfrdgHc3TCv5+7 O3pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=gcGnZKmOcvQR6JjKvFpEHmamTFte6m24wBtwFxccrg0=; b=m9gZy51EYxwWAuEuJFR/yo00dfl/HG9d+1HzyTQ3lxszwm7Tqm+qWoIkyM9nIlYe9m OaMwaTNLlYDIWTqXxdPvusfo4Jw+tzVVYJUENyfd/0LATGqbPRLrfjW04TQl9K44gQa4 aEov7R9E6LOAIUbGb+xt98ofjIdwJ7aafMmVRdQMpgbyXWSsfiFcv5WjL0EscQFTsF5+ pORt0aFX1NhrZBZozqhnVwh0jxx3UAtkJYRRASIIUfPuV5tk75SxbNv33QnbfqeBPIGa WljBpGcZHgTQ6lrgXo/WFi4M3AJcxfD9hOz5kcle9/otzT4QGu8Tk6nrB4qcg8GAfRMR /a+Q== X-Gm-Message-State: AOAM532jd0Mxlj+8VAQjtJtph8TKh0rIcx7AVfLWId5ejC18r8VLSmll O771HJxVL6KtD4v+Gp9v9Xs9Ge35rJNGIA== X-Received: by 2002:a62:cd0c:: with SMTP id o12mr3951843pfg.70.1594727586628; Tue, 14 Jul 2020 04:53:06 -0700 (PDT) Received: from blackclown ([103.88.82.145]) by smtp.gmail.com with ESMTPSA id u8sm2480068pjn.24.2020.07.14.04.53.03 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 Jul 2020 04:53:05 -0700 (PDT) Date: Tue, 14 Jul 2020 17:22:49 +0530 From: Suraj Upadhyay To: stern@rowland.harvard.edu, gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] USB: Remove pci-dma-compat wrapper APIs. Message-ID: <20200714115249.GA8563@blackclown> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jI8keyz6grp/JLjh" Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --jI8keyz6grp/JLjh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable The legacy API wrappers in include/linux/pci-dma-compat.h should go away as it creates unnecessary midlayering for include/linux/dma-mapping.h APIs, instead use dma-mapping.h APIs directly. The patch has been generated with the coccinelle script below and compile-tested. @@@@ - PCI_DMA_BIDIRECTIONAL + DMA_BIDIRECTIONAL @@@@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@@@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@@@ - PCI_DMA_NONE + DMA_NONE @@ expression E1, E2, E3; @@ - pci_alloc_consistent(E1, E2, E3) + dma_alloc_coherent(&E1->dev, E2, E3, GFP_) @@ expression E1, E2, E3; @@ - pci_zalloc_consistent(E1, E2, E3) + dma_alloc_coherent(&E1->dev, E2, E3, GFP_) @@ expression E1, E2, E3, E4; @@ - pci_free_consistent(E1, E2, E3, E4) + dma_free_coherent(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4; @@ - pci_map_single(E1, E2, E3, E4) + dma_map_single(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4; @@ - pci_unmap_single(E1, E2, E3, E4) + dma_unmap_single(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4, E5; @@ - pci_map_page(E1, E2, E3, E4, E5) + dma_map_page(&E1->dev, E2, E3, E4, E5) @@ expression E1, E2, E3, E4; @@ - pci_unmap_page(E1, E2, E3, E4) + dma_unmap_page(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4; @@ - pci_map_sg(E1, E2, E3, E4) + dma_map_sg(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4; @@ - pci_unmap_sg(E1, E2, E3, E4) + dma_unmap_sg(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4; @@ - pci_dma_sync_single_for_cpu(E1, E2, E3, E4) + dma_sync_single_for_cpu(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4; @@ - pci_dma_sync_single_for_device(E1, E2, E3, E4) + dma_sync_single_for_device(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4; @@ - pci_dma_sync_sg_for_cpu(E1, E2, E3, E4) + dma_sync_sg_for_cpu(&E1->dev, E2, E3, E4) @@ expression E1, E2, E3, E4; @@ - pci_dma_sync_sg_for_device(E1, E2, E3, E4) + dma_sync_sg_for_device(&E1->dev, E2, E3, E4) @@ expression E1, E2; @@ - pci_dma_mapping_error(E1, E2) + dma_mapping_error(&E1->dev, E2) @@ expression E1, E2; @@ - pci_set_consistent_dma_mask(E1, E2) + dma_set_coherent_mask(&E1->dev, E2) @@ expression E1, E2; @@ - pci_set_dma_mask(E1, E2) + dma_set_mask(&E1->dev, E2) Signed-off-by: Suraj Upadhyay --- drivers/usb/host/ehci-pci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index af3c1b9b38b2..71ec3025686f 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c @@ -124,8 +124,7 @@ static int ehci_pci_setup(struct usb_hcd *hcd) case 0x005b: /* CK804 */ case 0x00d8: /* CK8 */ case 0x00e8: /* CK8S */ - if (pci_set_consistent_dma_mask(pdev, - DMA_BIT_MASK(31)) < 0) + if (dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(31)) < 0) ehci_warn(ehci, "can't enable NVidia " "workaround for >2GB RAM\n"); break; --=20 2.17.1 --jI8keyz6grp/JLjh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE7AbCa0kOsMJ4cx0j+gRsbIfe744FAl8NnIYACgkQ+gRsbIfe 746pMRAAgh0C4G7yswFeFhknFnQoPRapRiqqXFb0kUimI5bl/yqvpdeJjzU37woq AXbP5yLLJCYkWsw2aJzuVrsB3Dj4MJ77+nWSx7iLwUp+0ys/9mf/bDoPD7EB/RNG EQymoql8dc1aSO3kIJwHzKe3CZ99gW8y0GONMoKuXtmJljbCrNVPOK9yV2YAzDTJ HRJ5n0xyKu9q8cZ0+uK2Hj48sDVragz+qmTZPdZCaGRr9dDwKO8hq5kn5yprbRsH ctj2UsJcgY+zWEZHbUQhBd91QrFNezMN62STle0HYOXar79dMxuNv5sTaMPgVd09 30MrjTBm1dgkBKQlaUrAx5BmS6mVlilnYQEByBHlJaeHQe4aGr92z438dPZqDSNS SiukbO+R6r5fQY87U0/Qeu6J8rVbNBjQJPzl1BgHV4VWrbgeA9v2r010qTtMNYPY emqCyrDJ0lQQaDA3qD8NUCRX/+W+50tDljbvRoxxnjoVpJmo0EZiN84sQ+R119ms UZY8fMXcLDbrKf5wTpg3Cf/SnVE8IAr3vXHFquzf5CFoCK/sU9muOiVbpPtxYu6S OSDjtLEWvNN7TdB7CL8fq9t1mCoj/YZFjty1N2+poxlRKy6WPUdy0lRqzUBGH3ee liYhecVR+SyexL69Vf04oE0DoMPG6M4Y8XIrU3YeDgKpR5COn5Y= =DIFZ -----END PGP SIGNATURE----- --jI8keyz6grp/JLjh--