From patchwork Mon Sep 13 06:01:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 509703 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp265749jao; Sun, 12 Sep 2021 23:02:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMspK9QPqtl3PfWjQjyROs7Dmh1zWCPjL6+8Vmx8WrkKRmW1WSVNAbiwRBct/BaxjIvLEo X-Received: by 2002:a17:906:7847:: with SMTP id p7mr10569499ejm.335.1631512940001; Sun, 12 Sep 2021 23:02:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631512939; cv=none; d=google.com; s=arc-20160816; b=BAZ98uwj7bCbJKuZskRb3lOonTmy70L91zlHvn2l1gugDSlSSr16BuZw/rKLkseErk cCxu9irC7IM5QWABPS8kLN5EOwPuBEqLyfZ24N1xE0Qr3fAIWa/+7B27c7YhnfFviYjK CO0rgGkZdmNgVcGqBHrR/1UCnXEWzZtfkhCZnKKqgJe6V6zW/VhWLN6FofJJtFDqWCU4 rTsf+1fbReX2FWT8AHqTaa7K4rAzwwuC24o2bRydtE4jwpzVZogNCKNUxd636ENEGrpq FrUde04M7fCm2uvF0yzw7whuS4aPy+/fS4/11UPRg3j+9vtFoV+llIhbOCT+VFTxuuKo BBpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=9E+j46f/uSt5ElH79f59RubB342/FvXwmkDYChsr7Jg=; b=tqeBWUuc9YwHiF+E3HZ4Rn5ZfVfh7vZs6y6g8/+Tmfqq6pq+0972nfAJ0X5qs2GeP8 LcUM42N4kWcQxHq4VxnmRysmbVMKPndR8wHzMGO7B4kTknS+0Wc44G8LoWLJ2drVCVTy 9WxoKwcGYMFgqkfo26IDNWr+knAMSSnlkyJMon8lRxs0psJgJ1GlfOW6EHkLDULBT/Ul fGfTRaGHyS6fF/ffz6llc4eCpFxbkkui0KbT/5Ih/psDkAdhEePywmXLYu+oDRmMuWrY RIohdWlAbj3dxj3IwuQ5nmGzjW21/wQhzowna0+7HzIYZqJ1rzEOC8brTinvCI0P5D1y 8RZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nwZ8+BBA; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id o11si6586399ejy.49.2021.09.12.23.02.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Sep 2021 23:02:19 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nwZ8+BBA; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CCDCC839F9; Mon, 13 Sep 2021 08:02:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="nwZ8+BBA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A6CB3839F9; Mon, 13 Sep 2021 08:02:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 709AB8324A for ; Mon, 13 Sep 2021 08:02:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pj1-x102f.google.com with SMTP id v19so2824465pjh.2 for ; Sun, 12 Sep 2021 23:02:06 -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:mime-version :content-transfer-encoding; bh=9E+j46f/uSt5ElH79f59RubB342/FvXwmkDYChsr7Jg=; b=nwZ8+BBA92ZiuxmbdVxU5IYcuVD0/eUk/CVsnYBSMaeET/I65ywy6kMFeO9gbB10Xr +NveSmd4C9Bil4P5wC525xQTRvxKk6R/IIa6RU4gYvzn/jo+W30zGFShTPdlByK3shpT kIY+MutfHt3Fi4BqyegBOlkmw3B44J126DTX3BHshn1ad+y9ByvEyG0KPBOtf16yNn4D 1I9/vy/NQ8tGiWtIVen+15TZan+/s5rS31uy5giQDCZU3LAHGu6kZBEzAaIBqK5bSERs 6+4eyBR2nC+Or3o3orLTu44y65U37BUsnRWVONYhPkk6E9ViL/6Diii+S3vl6Mss+QYZ qKKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9E+j46f/uSt5ElH79f59RubB342/FvXwmkDYChsr7Jg=; b=e06v3p6mukC4hbcgvoi1MdsbhDInrH+bz5MH7uLYyPFIrE621rvgPXHNzxiwx1IYAK o1idpXLdeqjWg8lJ7RbmsrehM/SyAEDP499CSV376UIEgTkcmJtF6KsHn0+lReHKlimt fB/5qQE2H4bE42qt8njsqcDxmvwYsehYAj95CYyVGHlvUi6F1HqrOWXCkPLTzKjAWNjM krN05Vv3F1sRY2Cb8dloMYv+++KnSmVLgpoyahI9qjRigp5JNX45GvVty1vI28ACiN6r pNjpgcFGPD8wNFDF9XQtax2YDIegkoxHjSEwfcB9jmT8p/MpwfgTblbMYpmI2vsrkBpJ 2U7g== X-Gm-Message-State: AOAM531mF+0u1n41hErhpjwqczJemoeYLMSn7Pn9QR7AC3nUfiE5MZ5T NDpMHnlA7EzU5saU5/MaoBhPWw== X-Received: by 2002:a17:903:246:b0:13a:8c8:8a31 with SMTP id j6-20020a170903024600b0013a08c88a31mr8890364plh.87.1631512924578; Sun, 12 Sep 2021 23:02:04 -0700 (PDT) Received: from localhost.localdomain (p6e421539.tkyea130.ap.so-net.ne.jp. [110.66.21.57]) by smtp.gmail.com with ESMTPSA id t3sm6619598pgo.51.2021.09.12.23.02.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Sep 2021 23:02:04 -0700 (PDT) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de Cc: u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH] efi_driver: simplify efi_bl_bind() Date: Mon, 13 Sep 2021 15:01:47 +0900 Message-Id: <20210913060147.18761-1-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean blk_create_devicef() is what blk_create_device() + device_set_name_alloced() really does. The resultant name will be a bit changed. Signed-off-by: AKASHI Takahiro --- lib/efi_driver/efi_block_device.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) -- 2.33.0 Reviewed-by: Simon Glass diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c index 0937e3595a43..b81c75868eb4 100644 --- a/lib/efi_driver/efi_block_device.c +++ b/lib/efi_driver/efi_block_device.c @@ -159,15 +159,11 @@ static int efi_bl_bind(efi_handle_t handle, void *interface) sprintf(name, "efiblk#%d", devnum); /* Create driver model udevice for the EFI block io device */ - ret = blk_create_device(parent, "efi_blk", name, IF_TYPE_EFI, devnum, - io->media->block_size, - (lbaint_t)io->media->last_block, &bdev); + ret = blk_create_devicef(parent, "efi_blk", name, IF_TYPE_EFI, devnum, + io->media->block_size, + (lbaint_t)io->media->last_block, &bdev); if (ret) return ret; - if (!bdev) - return -ENOENT; - /* Set the DM_FLAG_NAME_ALLOCED flag to avoid a memory leak */ - device_set_name_alloced(bdev); plat = dev_get_plat(bdev); plat->handle = handle;