Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp1274187ybs; Mon, 25 May 2020 11:29:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwadX4vgxdyV6E3N4r3Ap+hcSnaCkjaa8ZwHSQhbeD6Z7F1hWcUJrt22svTQ/QDJGLTzQMq X-Received: by 2002:aa7:c98a:: with SMTP id c10mr17125599edt.185.1590431371064; Mon, 25 May 2020 11:29:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590431371; cv=none; d=google.com; s=arc-20160816; b=GmOm1f2iidiulYpn1Bdjt49xX1keeD01ODyUKA02IVaKg9lmoZM+icESRDcUGlO5lx TwhUWaIjB1OUPjvWEkcqGyc/nT9+SziXdoc7F0qhwn/mAIFuTsZs0lhIpXUrCulPNIoe KyZ+CGAnH2bomPYrndBcSZs1vgfwi+/Cp0ZoQ9Heoh1JWTPCk+RBdYXAWhx587E6q3Pd 6eSp0OgC5Ec7Kgpkrw07SjOqMg8dhYdpbpcpUp635XZ6qXkVAg4H0fVbRCEqtJthgU0z iDuqawURwAyRsnmJmEgxZnKF6xCDYbhAjseExj5kMQx2fzG54NnGB/HKX3MsyKARXgZ9 AcoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=GGtb/VoRoWTmlojJAyBVCcYgsbrBsVJ+27ovJzUUe4Q=; b=jWIjf1Ph9pLpCZCcrnbwDB3oRrkzwNz2fH8t0YXz04i4YHCaQ7iTo1wyQRXd8OWt3f +N/6vfajb1g6oCYaeyL+lHl0q/CBX8aJL4erg6vZPqNRv9zWxt5EcievFaYNXlxE4/HS c2yvDV/IXoxEPiQPKIPyjLTeEYCe0rQcL26RLVrtCcVLMfjj2xbcqQLrEBASgvZ7wax0 A+lY/AiRtWaFX5N4ta37z/gTHyZR/ETIUsceZSEU13he4PaL3Hsjh9RhV1UAF/+49Gni 3FPkCDAJLe9cVwwlr4TPzZVNDMM9FmrW5o2iST00JC/0R5tH0Ox8p7LZD0oFBn/etZCf anpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fytoxuUY; 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 lu2si182033ejb.451.2020.05.25.11.29.08; Mon, 25 May 2020 11:29:31 -0700 (PDT) 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=fytoxuUY; 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 S2390433AbgEYLwt (ORCPT + 99 others); Mon, 25 May 2020 07:52:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390294AbgEYLwr (ORCPT ); Mon, 25 May 2020 07:52:47 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B478FC05BD43 for ; Mon, 25 May 2020 04:52:45 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id q2so20406271ljm.10 for ; Mon, 25 May 2020 04:52:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GGtb/VoRoWTmlojJAyBVCcYgsbrBsVJ+27ovJzUUe4Q=; b=fytoxuUYZUmziOocYOXa6Ua4TXMwv5acadaI6E+7PiGdl/arLQGPQaPfMmRUWo4Jnr ytKMK4XS3klP+uUdG9mtW+8fVxTUC7kzjkfy2oRh+WYetY6htW/KH2hvMU+/t4lQqsVo 6RE0bXTJYhjsbPQluDB8ZVCaHsCX6KsSxqUdIwkANIpUxlLSPYQ+ZEBWIoUDA/VD+vF/ s8nw46T/keKlv30EHWhasZop8jqmjcGVskS896QPH4RVbbK2OL8lMUW0grAOSllICALj 08n7VTqdhShz1HDV4HuWYl5fH6YqvG7X1Kh/b5FflPhD+LaTXqjdjC2Xdh5guUNSLBWD DNog== 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=GGtb/VoRoWTmlojJAyBVCcYgsbrBsVJ+27ovJzUUe4Q=; b=INdMqw4cvWWmQSl09iEPqx3gj3AZ+ftIgwiN+UCS4nWQDmEHML3pHs7js6m+Wgl/2o ctzEJMdOShueTPauxsyINr8Yb3iXD7wa+mAZeWgQqMC/ycJFjVGLLhYMSJOQ22TEv574 UeaCTGaOn53ELM7GWr6OU4phNBgV1Cy6Bkjb61mEOe6bLYsB5yujKEd5s+SWMod8PqRv ybKWVgw8K9ffLcoKTnYzG1+A3e1lX8vF0wEEc5F+cXSlI4ouAvvhb67VBkNVjfWlcUO6 jPna6Ur4whd1vPYHqMgintQFlp2oI++ApBCPt/jt15ODTQmRVFTLZ7Swr0/ckQe9EubG /ycQ== X-Gm-Message-State: AOAM533/OERwj3zTDB1PPSgxWh7sy0pLWABJxzS0FT4dBIJPU8AMbabk v26Z8FGjhkweBT4iv3SxxhhR6bHFAcw= X-Received: by 2002:a2e:150f:: with SMTP id s15mr13209778ljd.102.1590407563923; Mon, 25 May 2020 04:52:43 -0700 (PDT) Received: from localhost.localdomain ([176.59.41.83]) by smtp.gmail.com with ESMTPSA id y130sm4847756lfc.22.2020.05.25.04.52.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 May 2020 04:52:43 -0700 (PDT) From: Maxim Uvarov To: linux-kernel@vger.kernel.org, tee-dev@lists.linaro.org Cc: peterhuewe@gmx.de, jarkko.sakkinen@linux.intel.com, jgg@ziepe.ca, gregkh@linuxfoundation.org, jens.wiklander@linaro.org, linux-integrity@vger.kernel.org, arnd@linaro.org, sumit.garg@linaro.org, Maxim Uvarov Subject: [PATCHv3 2/3] optee: use uuid for sysfs driver entry Date: Mon, 25 May 2020 14:52:34 +0300 Message-Id: <20200525115235.5405-3-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200525115235.5405-1-maxim.uvarov@linaro.org> References: <20200525115235.5405-1-maxim.uvarov@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Optee device names for sysfs needed to be unique and it's better if they will mean something. UUID for name looks like good solution: /sys/bus/tee/devices/optee-clnt- Signed-off-by: Maxim Uvarov --- drivers/tee/optee/device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tee/optee/device.c b/drivers/tee/optee/device.c index d4931dad07aa..aab917605e74 100644 --- a/drivers/tee/optee/device.c +++ b/drivers/tee/optee/device.c @@ -65,7 +65,7 @@ static int get_devices(struct tee_context *ctx, u32 session, return 0; } -static int optee_register_device(const uuid_t *device_uuid, u32 device_id) +static int optee_register_device(const uuid_t *device_uuid) { struct tee_client_device *optee_device = NULL; int rc; @@ -75,7 +75,7 @@ static int optee_register_device(const uuid_t *device_uuid, u32 device_id) return -ENOMEM; optee_device->dev.bus = &tee_bus_type; - dev_set_name(&optee_device->dev, "optee-clnt%u", device_id); + dev_set_name(&optee_device->dev, "optee-clnt-%pUl", device_uuid); uuid_copy(&optee_device->id.uuid, device_uuid); rc = device_register(&optee_device->dev); @@ -144,7 +144,7 @@ static int __optee_enumerate_devices(u32 func) num_devices = shm_size / sizeof(uuid_t); for (idx = 0; idx < num_devices; idx++) { - rc = optee_register_device(&device_uuid[idx], idx); + rc = optee_register_device(&device_uuid[idx]); if (rc) goto out_shm; } -- 2.17.1