Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4273551pxb; Tue, 2 Mar 2021 10:46:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJyix3HnnVkquXoEQByO3TuRPo35pjEnv5pGgGTY+yt0vUcdeoquA298yZoqba1oqFyPk+y1 X-Received: by 2002:a17:906:5043:: with SMTP id e3mr22240325ejk.260.1614710781501; Tue, 02 Mar 2021 10:46:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614710781; cv=none; d=google.com; s=arc-20160816; b=GWfpCkHJK3eRdqMyh2DVhwD316tbKB52Cu75BI8TL+alDZ19ehDgjWLp0kGJfgz83I iT8rbuNdlE3QFBYBRTsg+EMCPfL0f4d2GcNK/OGimsIYXCI/zK2iMD1gJhHUyoLioE00 7xgVqIduSzQ8i0Ikvb5SITkFa+xOpTZPPWHu+SMPZ0OMI1RJMSkQ8sNyWrwvBZzxP1/N JKCUzA6lF3Rqd1uMPyb5xyQg6vbZL5hOI7aTQuBY5ygsFOZEqHaD2baTzXkpdpQ3AO3Y 9lN1xTLfY9INDeCUmwxjD/WrOt6j2IGgiRXRaQwGcnNsoYgHsasbEG24h3KFLJZkpGgJ TWRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+IZNoE4E9l3eWMVT2Obt86H5jq5BW9DleHnD2g9iNvw=; b=UFzg7cnlARctx65SlH9m0aP/irVfGLYf8r7/orYQFBP69ho1SvrUqPgnOKznvnt0QV TSbdEXaER0/5TD/xu9WFTyUVwKUBXdDcdw2SmUjw+zVezzuwEOmO00F3mFEcijYIvZL1 QU0rdh7DxxtS9qf6ouKm63jxFKjLRXeqYNbbLXNPsOt8TJwzGcrwREYJ9OZHbqOffvnY IHjzJwylfJfPL/lKucaWR6gXz21CXieuxr6GoXckWGQebQZhUzAPLYmsUm4wlFIvcQgo BxhrD/woyiCftflw9rfm2KqXFAIoS3rFch998gToKtNuxv/Blj2JE/94bkzJZHCqaUpM /c3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="ZxZq/smZ"; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g7si14853352edj.528.2021.03.02.10.45.56; Tue, 02 Mar 2021 10:46:21 -0800 (PST) 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=@linaro.org header.s=google header.b="ZxZq/smZ"; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377636AbhCBEt3 (ORCPT + 99 others); Mon, 1 Mar 2021 23:49:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1445225AbhCBC5Q (ORCPT ); Mon, 1 Mar 2021 21:57:16 -0500 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C49BC06178B for ; Mon, 1 Mar 2021 18:56:36 -0800 (PST) Received: by mail-pj1-x102a.google.com with SMTP id l18so946831pji.3 for ; Mon, 01 Mar 2021 18:56:36 -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=+IZNoE4E9l3eWMVT2Obt86H5jq5BW9DleHnD2g9iNvw=; b=ZxZq/smZVpC9WlNe4MDL4pHr/HTA8pP44i22GmGeqCqsuxStxJ4pS8cxERjZNkuZJv 8ThxGCSXUkL8yTS3EGUx59IAQU79hIJHzEhVtZgCwJzx52YmlJnwYycZSCG6YihxCgp1 izaFAkOo5+o+BgIGuJGfhK7cHViZ9bhCuDpSQWQXWEotbeWx5+54lYZ7tYs19GAjAnsj alU2a9xA68rEEvsHLTC178xs2Qu07kCF6dB/DdNVP/xGoZDAh3TMTyLjOtg/14rbwUDR 7khnMT7o0YBRpOWwaNWaRCcFoONoegT8TGGUL2zx9WGRlys1kU0qhrA37BbmvamwGydq alPg== 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=+IZNoE4E9l3eWMVT2Obt86H5jq5BW9DleHnD2g9iNvw=; b=Zvr74BxchWK9MrQig2eL8rEitq3FrALUuGJ7W2ywQsX8YxEMIh0XS3Pr3vO4kJUKKS 20B8OzMLQ8vonPc99aafAtg3uy42hsep6QaBE2ixEX94flYJAt5CrPrTWajeePvRFNZn nk5HBqDX/NIoz+OQF8H2PjLsq+Cu+8KB3QFP2TCJ73rqwj1MbVJd6Y4wp3+OJm0SqrDB fGmwp9nbBNAogI++Flv+KkKx4m+0krZQYU+MW0ZyJzlM7Q5Ji/rK5RRYFyyKD06oLIX3 5CtqfMKPf3VOpFZVnOkQ8OorNTthbwtxDdFgEEfnSRXRxGIrAw2xU/+D09GC8v6Nf1P9 Yctg== X-Gm-Message-State: AOAM5303GbBYKRypboVSgRhfP8RbHuo6NkZh8+XOU3Ij/esit2mmVyJY q1q2Po2TFi5OkcPzI1rkUb5ThDZk6xPz3A== X-Received: by 2002:a17:90b:3890:: with SMTP id mu16mr2014337pjb.9.1614653795608; Mon, 01 Mar 2021 18:56:35 -0800 (PST) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id r16sm18928400pfh.168.2021.03.01.18.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Mar 2021 18:56:35 -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=20Eide?= , Robin Murphy , Ezequiel Garcia , Simon Ser , James Jones , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [RESEND][PATCH v2 1/2] dma-buf: dma-heap: Provide accessor to get heap name Date: Tue, 2 Mar 2021 02:56:28 +0000 Message-Id: <20210302025629.2558215-1-john.stultz@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 6b5db954569f..56bf5ad01ad5 100644 --- a/drivers/dma-buf/dma-heap.c +++ b/drivers/dma-buf/dma-heap.c @@ -202,6 +202,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 5bc5c946af58..0c05561cad6e 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 -- 2.25.1