From patchwork Tue Feb 9 19:48:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 379653 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 637A0C433DB for ; Tue, 9 Feb 2021 20:00:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1398464EC8 for ; Tue, 9 Feb 2021 20:00:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233395AbhBIT7F (ORCPT ); Tue, 9 Feb 2021 14:59:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233622AbhBITtK (ORCPT ); Tue, 9 Feb 2021 14:49:10 -0500 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87E92C061A29 for ; Tue, 9 Feb 2021 11:48:25 -0800 (PST) Received: by mail-pj1-x1030.google.com with SMTP id q72so2166854pjq.2 for ; Tue, 09 Feb 2021 11:48:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=afF2pHGG502t/84V5YNHmCiVWiQMRNdlEkUy2NZuKx8=; b=yRaJ+PJ+E44+mqB5LJcQUiR6volXPqvWk7B54rrcPwNuggp7DXthL43qFxwiJaIthR HStcVglg8xIqrW9BKyqY4zPS+KQ0Ooh89+0ENhwQP/mK/2f/dJkzbd0fjdZhCmnkeTXo zrtDpP/gAUVndHlTx7IIiuhwXwmlOFXBS7Bp/wO0+I2Qwc/ntb7r3kP5blH+FynCJPxW v/M0ClZzR6U0x6nA2IolnjcozeqdJh+39gOMTpMFIaVj+ga+r7/IJCccxiPETvn5thso CvDoN0CfebHTczcBATJwgu0i8jhadc+FJUgjcdcpw6+/P9dFdvZFH4xBDmtKhcs++J9/ i/Sg== 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:mime-version :content-transfer-encoding; bh=afF2pHGG502t/84V5YNHmCiVWiQMRNdlEkUy2NZuKx8=; b=LIdodNRXeou9y5rlU+SHW6sHCvcyPar5LZCiItG2ioVi8uyInp7mDyyqO8v65xisQc IWLBHRzGFifGxW6vk6Q/rDgWbn+oBeH/G5Bxr/ibQV5e2pVwVmREaiJ0KxASD9ek+q1h PwIohC/aIp9BCtu07UVfu7zxm8L+aXBbvM2hVa/yQ4Qkr0loGRVara7J9BrvARC7Ow9D dUfMyAG6HV7eVSqRNpRlbrNhE5Rs6RwL5K+izg1BglL39gaN4SLlS5TGRKoXqSfwrhTo U4UJ2NzXuoLtRxsD3e/IURU7bRiO8Odhh8/2FbfB/HJ6Upr/RsIqcvuu2IVa/P7HlQbV 1IJQ== X-Gm-Message-State: AOAM5307t97X49nrrQJw0b+v6a0x3W1DKzHXD38pyfQhiDO79G2PfEhK 16cRDzVLzv4L9KEYOH+2kwnrCA== X-Google-Smtp-Source: ABdhPJykD/cVLPq3p06Nm/JMKvPVGXYlG9cVWzIEFPq4tJeqUZX+9Dn/vzf27apxe3n4hL48CaR0Sw== X-Received: by 2002:a17:90a:4588:: with SMTP id v8mr5562008pjg.58.1612900105090; Tue, 09 Feb 2021 11:48:25 -0800 (PST) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id j17sm22365836pfh.183.2021.02.09.11.48.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 11:48:24 -0800 (PST) From: John Stultz To: lkml Cc: John Stultz , Daniel Vetter , Sumit Semwal , Liam Mark , Chris Goldsworthy , Laura Abbott , Brian Starkey , Hridya Valsaraju , Suren Baghdasaryan , Sandeep Patil , Daniel Mentz , =?utf-8?q?=C3=98rjan_Eide?= , Robin Murphy , Ezequiel Garcia , Simon Ser , James Jones , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v2 1/2] dma-buf: dma-heap: Provide accessor to get heap name Date: Tue, 9 Feb 2021 19:48:17 +0000 Message-Id: <20210209194818.2459062-1-john.stultz@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org It can be useful to access the name for the heap, so provide an accessor to do so. Cc: Daniel Vetter Cc: Sumit Semwal Cc: Liam Mark Cc: Chris Goldsworthy Cc: Laura Abbott Cc: Brian Starkey Cc: Hridya Valsaraju Cc: Suren Baghdasaryan Cc: Sandeep Patil Cc: Daniel Mentz Cc: Ørjan Eide Cc: Robin Murphy Cc: Ezequiel Garcia Cc: Simon Ser Cc: James Jones Cc: linux-media@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: John Stultz --- v2: * Make sure to use "const char *" as Reported-by: kernel test robot --- drivers/dma-buf/dma-heap.c | 12 ++++++++++++ include/linux/dma-heap.h | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c index afd22c9dbdcf..70e410c64c1c 100644 --- a/drivers/dma-buf/dma-heap.c +++ b/drivers/dma-buf/dma-heap.c @@ -190,6 +190,18 @@ void *dma_heap_get_drvdata(struct dma_heap *heap) return heap->priv; } +/** + * dma_heap_get_name() - get heap name + * @heap: DMA-Heap to retrieve private data for + * + * Returns: + * The char* for the heap name. + */ +const char *dma_heap_get_name(struct dma_heap *heap) +{ + return heap->name; +} + struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info) { struct dma_heap *heap, *h, *err_ret; diff --git a/include/linux/dma-heap.h b/include/linux/dma-heap.h index 454e354d1ffb..83b8cfb2d760 100644 --- a/include/linux/dma-heap.h +++ b/include/linux/dma-heap.h @@ -50,6 +50,15 @@ struct dma_heap_export_info { */ void *dma_heap_get_drvdata(struct dma_heap *heap); +/** + * dma_heap_get_name() - get heap name + * @heap: DMA-Heap to retrieve private data for + * + * Returns: + * The char* for the heap name. + */ +const char *dma_heap_get_name(struct dma_heap *heap); + /** * dma_heap_add - adds a heap to dmabuf heaps * @exp_info: information needed to register this heap