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: 379383 Delivered-To: patches@linaro.org Received: by 2002:a17:906:48d2:0:0:0:0 with SMTP id d18csp695474ejt; Tue, 9 Feb 2021 11:48:25 -0800 (PST) X-Received: by 2002:a17:903:8b:b029:e2:d409:cba2 with SMTP id o11-20020a170903008bb02900e2d409cba2mr11507130pld.79.1612900105535; Tue, 09 Feb 2021 11:48:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612900105; cv=none; d=google.com; s=arc-20160816; b=UxdMtecM9wQBwKcgOzYqfMdcRR9oCZWnQlSkto2n1gShaB7NdR80ApHNFTjvGZ/nB3 zknfdsw92MNpB1OyCKzlDNct7DERsykhWYAnJy9aTe20F5zukRiI0n+VyLDyIPYtP4sV pBOVTz8YW/t4NVRItRtn8L+rhTQ5euPgj8P/2iDMkS/zB4NfICMOxvnGGVwNeQygN0hK W5nGD1oiTaFjPiIIwN84JF4KZjv5yFlkB/sCPnLSYmJQA28qQdNRAtl7uDsnjbjb95Vp qBLXLvJIE6L3rnl6Iyu4Y1g2bfsBvDI45YJvi7SwiRtct7jrxVWJTNbBkmJWu7rZ3Jar /XuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=afF2pHGG502t/84V5YNHmCiVWiQMRNdlEkUy2NZuKx8=; b=XZAyHmHyRoNnXw8sGaYR/sekh5cNsCLhTfIcYA9frfmhoVzoqHWz19wSiyuXAWxlpE /2tyH5bTV5NY97K6qA1K5erFFRC1rl2xYbcEfK9JwZqnkNessytDgWkDiL2AcQi7bvR/ sUc6PgWzBu/lWQUVx9+8pOoZ/YB794SCny0GG4kVWxRrW3K3EBMmFWxFzSwt/M6iaqOf XkJup5pQybHUxyZC2/aTAZ/GNgjXXrLOQEDFW9kEwalCssgJgnj3F4kaKpLo0FBEqVKb w53YBYWfatbwqkLgfY/0rgVfzsucY6PgtLXT6oNYdvrRJp1XyJWEQ8zbu1kkce0tH5BJ WnCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yRaJ+PJ+; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id jz15sor1968959pjb.7.2021.02.09.11.48.25 for (Google Transport Security); Tue, 09 Feb 2021 11:48:25 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yRaJ+PJ+; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.41 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=IFuJ+m9Z4MRGVDZisS4fmSVKfbivHIm3NIivWHxSFPeSWgZOrnopEa+bPhlZVvXZWc Sc7CWcoeJpKs7Js/7v5ji+x1x+1MQXLkAycT0EzP49BQSK21GSL5DOL8ja9PpLghv/Sh G5xWBckRx8/VdfKQvqfpquzokXvWImCqWQvQ5qPd45+ewEzULaf/LhQ1BvLyMFHwaMKd V4iPuCvpeofMstByLjYSGSRvIB2zYT9yHSYQR808iyPF0LZkFJDpZRigeNM4ZtWp9wL8 P5oJxo8rSFTkJz0+j8isMRd1woLy+ijTHVjQO4/bw9sVa6T3AHP0BC8huoeWzPnAauC8 H6cA== X-Gm-Message-State: AOAM532li3bSpmWkZ6uBJzhZxFCVjfTbW31Hoqs5oe07+5QvL7VLYF7g U7BLDeS7d45EJlRAP8X1TrUATFQ8Q0iLXXA7 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) Return-Path: 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 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(+) -- 2.25.1 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