From patchwork Tue Jan 2 17:53:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Perier X-Patchwork-Id: 10141121 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AC2F16034B for ; Tue, 2 Jan 2018 17:55:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B4DF28C61 for ; Tue, 2 Jan 2018 17:55:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9014C28C62; Tue, 2 Jan 2018 17:55:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BCD328D78 for ; Tue, 2 Jan 2018 17:55:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751315AbeABRyx (ORCPT ); Tue, 2 Jan 2018 12:54:53 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:45580 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751403AbeABRyP (ORCPT ); Tue, 2 Jan 2018 12:54:15 -0500 Received: by mail-wm0-f65.google.com with SMTP id 9so62408669wme.4; Tue, 02 Jan 2018 09:54:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BO92f0svKDbm088vQV1pPcBYzGMMhcXZaDKES1TEzdA=; b=qV1eWBWDQwhZuIhFk+/vu8+SOeTadOkaJdn1a6pWsh5p+dGGw6pq8oVl6yWUCJmz+m Gz3iCW2W4RKRiB0KUSlsiaSh3Is3XvD21eaaTO+AQ3evqxTd9UbluBoHdBNoo7FYALj2 OTym0UB6sDjXFNYu0L9l80Ae7HqSmP+D5qifOo+VzsDZpDmVAhS50IRWojkTi3Ed5DZG dTno7ds5DCRga6XZIjq4E8oRq6nxMqmCqjf00pXWTDwwIASx3e+SpbV3s2VIz8UZmICH +lCGapC96N+fLT5fg/r0i3jGvrxOia2PIgVu9u+ZIO0oVomxUDaG/1oxQwB4ja+UGVIg ia7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BO92f0svKDbm088vQV1pPcBYzGMMhcXZaDKES1TEzdA=; b=Zj+YCRRWBF3xx6BbypUxAyzsmYLT3kIupSAlfqDPAJqxJOakqaUx9bkkvfWfbrRIRl Ax3hCi26Nk+bWRCc4gQ/14AjkhOIZdg0s1VZbc2u4Nrzm8Klbu50mG4sQUgmghHOJaN6 s9I0dl475ZPEgB51Iif5b/l19J7E8HNIQtBP+F8ve1xzkIlehsJc0l8vifvk2ah9EX/3 aKyQnuQuDMuB1ptpN6l0HFiYe9gGuaM4ZZMoUfrwTbYxm+g+VYu3C0/gYX4fnhBx9RX5 ZGYyFl9Ez2aeV2qDFsg41xTsap3lEkObLE4wZ9XfhY43kz1BcbUVyxkAAG/559ltuk91 14IA== X-Gm-Message-State: AKGB3mK/qlWMcRQBufBse2q8CEi7BEVW4gyP6kxs82NJpFf8wpvwSwgj nmg7wtOOSZCi6M3zUuSbKQw= X-Google-Smtp-Source: ACJfBovbCQpSdkjngY0YNZZTp8utOvL8WBljfOlwSfQA5Ny9Dl38GQwfSFA061+Vvasp1n3ETiCEpg== X-Received: by 10.28.51.21 with SMTP id z21mr38572309wmz.94.1514915653116; Tue, 02 Jan 2018 09:54:13 -0800 (PST) Received: from rperier-xps-l502x (AToulouse-651-1-229-42.w90-38.abo.wanadoo.fr. [90.38.44.42]) by smtp.gmail.com with ESMTPSA id s11sm17382332wrb.30.2018.01.02.09.54.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jan 2018 09:54:12 -0800 (PST) From: Romain Perier To: Jens Axboe , Andrew Morton , Dan Williams , Vinod Koul , Jeff Kirsher , Aviad Krawczyk , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, Bjorn Helgaas , linux-pci@vger.kernel.org Cc: dmaengine@vger.kernel.org, "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Romain Perier Subject: [PATCH v17 3/4] hinic: Replace PCI pool old API Date: Tue, 2 Jan 2018 18:53:55 +0100 Message-Id: <20180102175356.7999-4-romain.perier@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180102175356.7999-1-romain.perier@gmail.com> References: <20180102175356.7999-1-romain.perier@gmail.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Romain Perier The PCI pool API is deprecated. This commit replaces the PCI pool old API by the appropriate function with the DMA pool API. Signed-off-by: Romain Perier Acked-by: David S. Miller --- drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c | 10 +++++----- drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c index 7d95f0866fb0..28a81ac97af5 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c @@ -143,7 +143,7 @@ int hinic_alloc_cmdq_buf(struct hinic_cmdqs *cmdqs, struct hinic_hwif *hwif = cmdqs->hwif; struct pci_dev *pdev = hwif->pdev; - cmdq_buf->buf = pci_pool_alloc(cmdqs->cmdq_buf_pool, GFP_KERNEL, + cmdq_buf->buf = dma_pool_alloc(cmdqs->cmdq_buf_pool, GFP_KERNEL, &cmdq_buf->dma_addr); if (!cmdq_buf->buf) { dev_err(&pdev->dev, "Failed to allocate cmd from the pool\n"); @@ -161,7 +161,7 @@ int hinic_alloc_cmdq_buf(struct hinic_cmdqs *cmdqs, void hinic_free_cmdq_buf(struct hinic_cmdqs *cmdqs, struct hinic_cmdq_buf *cmdq_buf) { - pci_pool_free(cmdqs->cmdq_buf_pool, cmdq_buf->buf, cmdq_buf->dma_addr); + dma_pool_free(cmdqs->cmdq_buf_pool, cmdq_buf->buf, cmdq_buf->dma_addr); } static unsigned int cmdq_wqe_size_from_bdlen(enum bufdesc_len len) @@ -875,7 +875,7 @@ int hinic_init_cmdqs(struct hinic_cmdqs *cmdqs, struct hinic_hwif *hwif, int err; cmdqs->hwif = hwif; - cmdqs->cmdq_buf_pool = pci_pool_create("hinic_cmdq", pdev, + cmdqs->cmdq_buf_pool = dma_pool_create("hinic_cmdq", &pdev->dev, HINIC_CMDQ_BUF_SIZE, HINIC_CMDQ_BUF_SIZE, 0); if (!cmdqs->cmdq_buf_pool) @@ -916,7 +916,7 @@ int hinic_init_cmdqs(struct hinic_cmdqs *cmdqs, struct hinic_hwif *hwif, devm_kfree(&pdev->dev, cmdqs->saved_wqs); err_saved_wqs: - pci_pool_destroy(cmdqs->cmdq_buf_pool); + dma_pool_destroy(cmdqs->cmdq_buf_pool); return err; } @@ -942,5 +942,5 @@ void hinic_free_cmdqs(struct hinic_cmdqs *cmdqs) devm_kfree(&pdev->dev, cmdqs->saved_wqs); - pci_pool_destroy(cmdqs->cmdq_buf_pool); + dma_pool_destroy(cmdqs->cmdq_buf_pool); } diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.h b/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.h index b35583400cb6..23f8d39eab68 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.h +++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.h @@ -157,7 +157,7 @@ struct hinic_cmdq { struct hinic_cmdqs { struct hinic_hwif *hwif; - struct pci_pool *cmdq_buf_pool; + struct dma_pool *cmdq_buf_pool; struct hinic_wq *saved_wqs;