Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tee: remove unused tee_shm_priv_alloc()

tee_shm_priv_alloc() isn't useful in the current state and it's also not
not used so remove it.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

+2 -43
+2 -31
drivers/tee/tee_shm.c
··· 89 89 .mmap = tee_shm_op_mmap, 90 90 }; 91 91 92 - static struct tee_shm *__tee_shm_alloc(struct tee_context *ctx, 93 - struct tee_device *teedev, 94 - size_t size, u32 flags) 92 + struct tee_shm *tee_shm_alloc(struct tee_context *ctx, size_t size, u32 flags) 95 93 { 94 + struct tee_device *teedev = ctx->teedev; 96 95 struct tee_shm_pool_mgr *poolm = NULL; 97 96 struct tee_shm *shm; 98 97 void *ret; 99 98 int rc; 100 - 101 - if (ctx && ctx->teedev != teedev) { 102 - dev_err(teedev->dev.parent, "ctx and teedev mismatch\n"); 103 - return ERR_PTR(-EINVAL); 104 - } 105 99 106 100 if (!(flags & TEE_SHM_MAPPED)) { 107 101 dev_err(teedev->dev.parent, ··· 176 182 tee_device_put(teedev); 177 183 return ret; 178 184 } 179 - 180 - /** 181 - * tee_shm_alloc() - Allocate shared memory 182 - * @ctx: Context that allocates the shared memory 183 - * @size: Requested size of shared memory 184 - * @flags: Flags setting properties for the requested shared memory. 185 - * 186 - * Memory allocated as global shared memory is automatically freed when the 187 - * TEE file pointer is closed. The @flags field uses the bits defined by 188 - * TEE_SHM_* in <linux/tee_drv.h>. TEE_SHM_MAPPED must currently always be 189 - * set. If TEE_SHM_DMA_BUF global shared memory will be allocated and 190 - * associated with a dma-buf handle, else driver private memory. 191 - */ 192 - struct tee_shm *tee_shm_alloc(struct tee_context *ctx, size_t size, u32 flags) 193 - { 194 - return __tee_shm_alloc(ctx, ctx->teedev, size, flags); 195 - } 196 185 EXPORT_SYMBOL_GPL(tee_shm_alloc); 197 - 198 - struct tee_shm *tee_shm_priv_alloc(struct tee_device *teedev, size_t size) 199 - { 200 - return __tee_shm_alloc(NULL, teedev, size, TEE_SHM_MAPPED); 201 - } 202 - EXPORT_SYMBOL_GPL(tee_shm_priv_alloc); 203 186 204 187 struct tee_shm *tee_shm_register(struct tee_context *ctx, unsigned long addr, 205 188 size_t length, u32 flags)
-12
include/linux/tee_drv.h
··· 316 316 struct tee_shm *tee_shm_alloc(struct tee_context *ctx, size_t size, u32 flags); 317 317 318 318 /** 319 - * tee_shm_priv_alloc() - Allocate shared memory privately 320 - * @dev: Device that allocates the shared memory 321 - * @size: Requested size of shared memory 322 - * 323 - * Allocates shared memory buffer that is not associated with any client 324 - * context. Such buffers are owned by TEE driver and used for internal calls. 325 - * 326 - * @returns a pointer to 'struct tee_shm' 327 - */ 328 - struct tee_shm *tee_shm_priv_alloc(struct tee_device *teedev, size_t size); 329 - 330 - /** 331 319 * tee_shm_register() - Register shared memory buffer 332 320 * @ctx: Context that registers the shared memory 333 321 * @addr: Address is userspace of the shared buffer