From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6529AC433EF for ; Mon, 13 Sep 2021 06:02:19 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A30D260F46 for ; Mon, 13 Sep 2021 06:02:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A30D260F46 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de 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) 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-Google-Smtp-Source: ABdhPJyk31Gp6s5aYVOelEvv6qqcYXN/p9dU9crQuBjvs9L0i3EQs5sNl60D1spSmLEwvK9R8/EfZw== 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 Content-Transfer-Encoding: 8bit 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(-) 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; -- 2.33.0