From patchwork Mon Nov 20 19:32:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Perier X-Patchwork-Id: 10067113 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 50870603FA for ; Mon, 20 Nov 2017 19:34:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 446E628D1A for ; Mon, 20 Nov 2017 19:34:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3959D28DB5; Mon, 20 Nov 2017 19:34:15 +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 CC4FB2930F for ; Mon, 20 Nov 2017 19:34:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752705AbdKTTd5 (ORCPT ); Mon, 20 Nov 2017 14:33:57 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:42224 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752406AbdKTTdL (ORCPT ); Mon, 20 Nov 2017 14:33:11 -0500 Received: by mail-wr0-f195.google.com with SMTP id o14so9125526wrf.9; Mon, 20 Nov 2017 11:33:09 -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=tBtICgQQ1bytD73vycnfRvWwaRTQZU0R0e68paHj6bQ=; b=JwF6UdZY2VcC1WlGgns0DK9rdKotWjena3REFj3KnFuEhoC1zMbdtQSsA79Pzqu5YT 1Zd6j0TN9th1IjtBXdW5iGdWSkCFeCA4fzbedjFHj/z+VlHmfiDOc3PWS83wF8bM09RC 1LSz3ARkvU0TINsWibLP8Kj2ZObOtLVx9KiFEmf2v1FibtPJSO1JfmCMpcV258zgYGaP +CGC55lsESNk+H9byEAqz4YLrVAJ/jaaiNv8Fq1SheYvMl5mk+Y0bKdSiIIRDHR6MTst 3oDh1x2tDOefdUMsE+04yGOGhauoUHm9BgHQ9Y33ZfeNG/skP835cyYPn2G6w6Vk51V2 Tyyw== 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=tBtICgQQ1bytD73vycnfRvWwaRTQZU0R0e68paHj6bQ=; b=j9qir+KH4MypSb+LltpJotQCjmXEcGBD9YaOGNvkSqbGa9+wZ137swKXofnnj1L7C4 hJ4+ZUdD9zPq0gOHeDpRrWqO3FYA7S/FWYh8Dg6yzWfkUdWFa2I/+s7foraHqQUvs+na T0jxW4UuV4e3l6ctWuYY46urfeIFoNtjwwsoWGmvOxKBND9CKVVPXf/C2w7j8XZ7sQAF kPcXIDP7975cGLgS8fMuVuFifuI0DOTWc2k9bD4FRLvEE+3QF8q+WYaHLh3a2gqfjae7 gcWZ7w1xYaRaJwpMOSabqsA31nkb8xd5ZhsT3IUpiIgYIfQaJDAqUtViwCFcVu/bnYao F0pA== X-Gm-Message-State: AJaThX71cF5zVAZMT1YTHzTVNNj4E7+N0Th6ORFpxYAsbVq0dKyySQbH n9qpgTyptcOi60SFWA8w0Dk= X-Google-Smtp-Source: AGs4zMbIPgSj7Eq32qwcWTW7YynT4q+iwok1R2QI2l36LdQ9PbiEpgzQNgvlPQGdmMz56EvPpc0lOg== X-Received: by 10.223.185.121 with SMTP id b54mr11843111wrg.264.1511206388835; Mon, 20 Nov 2017 11:33:08 -0800 (PST) Received: from rperier-xps-l502x (AToulouse-651-1-44-123.w92-134.abo.wanadoo.fr. [92.134.227.123]) by smtp.gmail.com with ESMTPSA id t43sm15750443wrc.74.2017.11.20.11.33.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 11:33:08 -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, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Romain Perier Subject: [PATCH v15 3/5] hinic: Replace PCI pool old API Date: Mon, 20 Nov 2017 20:32:45 +0100 Message-Id: <20171120193247.8187-4-romain.perier@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171120193247.8187-1-romain.perier@gmail.com> References: <20171120193247.8187-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 --- 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;