Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 47CF3C433FE for ; Sat, 22 Jan 2022 01:17:20 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 11E40832E6; Sat, 22 Jan 2022 02:17:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="efQNBc1F"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0700B81B53; Sat, 22 Jan 2022 02:17:05 +0100 (CET) Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) (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 E44918302D for ; Sat, 22 Jan 2022 02:17:01 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x135.google.com with SMTP id r16so9032957ile.8 for ; Fri, 21 Jan 2022 17:17:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4zk2+uXg3lq447ZfFw+R6TEKyDLh8pcxcFM6wja0lL8=; b=efQNBc1FccT1E4+fQfXS4bRQ7kXr3414D1QCs0Ro3ReMN5YIcMRO8VtZhuDRsqdrQ5 Oq+ECTrEwNZ1tgCLRznjIoOqy2HWmi5YA60Y61TULFiwBM6jWEfXc1QYc/n2x6s5589H kBgSW6wBVfHZwoPiFN/bhBmSuoqR3cwv4vVmw= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=4zk2+uXg3lq447ZfFw+R6TEKyDLh8pcxcFM6wja0lL8=; b=1bCB8cj0cnU5G0h+eMh68csiGNXyKzER/hBKvARPx3mAGKp/DRXCoPebluFGklnYu5 R+ghPy/LpLmcgfj+K6uPCUHp+VQ8iZdT0zgIrKEVlDGPjIGEXyE1A6KVwe0ure/7TbkU ioJe4o9qEO5oOXgy9OuDUPSNDvzFgez6DqfwuHlU1FZmikNHQu0swJOUXwvfCTiSb/gT UC9bSqsWxnAPUwlzfZIfLEDcyp6oHSe2JgjMaDMs4xLSJYrPETRn89CWiJmISTwrd71r BpNt2cGn8GUszVg0ORihuROpzsnLoI02B1pARsXqWCr0PSLxcQNn6T/pDVIpFwuUcwrH /h7A== X-Gm-Message-State: AOAM530VIexeLHFPysws39xymj4rJ+AtRgxLjcpKSduk5aqxnYZ664QY ZcfYAptu+B3HSXFQXRQvkwN5TsyCzTEQ2A== X-Google-Smtp-Source: ABdhPJyL8fOm90g7J43rn9wtI7Bn0zjY416akBIEdMNA2VU/rbGxCFPk0ircldyBJVuzuDr6ebjnnw== X-Received: by 2002:a05:6e02:148a:: with SMTP id n10mr3670789ilk.228.1642814220489; Fri, 21 Jan 2022 17:17:00 -0800 (PST) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id p4sm2424551iod.37.2022.01.21.17.16.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jan 2022 17:17:00 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Simon Glass , Alexander Graf Subject: [PATCH 2/3] efi: Use device_get_uclass_id() where appropriate Date: Fri, 21 Jan 2022 18:16:55 -0700 Message-Id: <20220122011656.2724166-2-sjg@chromium.org> X-Mailer: git-send-email 2.35.0.rc0.227.g00780c9af4-goog In-Reply-To: <20220122011656.2724166-1-sjg@chromium.org> References: <20220122011656.2724166-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean Use this function rather than following the pointers, since it is there for this purpose. Add the uclass name to the debug call at the end of dp_fill() since it is quite useful. Signed-off-by: Simon Glass --- lib/efi_loader/efi_device_path.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index c61f4859330..a838a32b810 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -494,7 +494,7 @@ __maybe_unused static unsigned int dp_size(struct udevice *dev) if (!dev || !dev->driver) return sizeof(ROOT); - switch (dev->driver->id) { + switch (device_get_uclass_id(dev)) { case UCLASS_ROOT: case UCLASS_SIMPLE_BUS: /* stop traversing parents at this point: */ @@ -579,7 +579,7 @@ __maybe_unused static void *dp_fill(void *buf, struct udevice *dev) if (!dev || !dev->driver) return buf; - switch (dev->driver->id) { + switch (device_get_uclass_id(dev)) { case UCLASS_ROOT: case UCLASS_SIMPLE_BUS: { /* stop traversing parents at this point: */ @@ -759,9 +759,8 @@ __maybe_unused static void *dp_fill(void *buf, struct udevice *dev) return &udp[1]; } default: - debug("%s(%u) %s: unhandled device class: %s (%u)\n", - __FILE__, __LINE__, __func__, - dev->name, dev->driver->id); + log_debug("unhandled device class: %s (%u:%s)\n", dev->name, + device_get_uclass_id(dev), dev_get_uclass_name(dev)); return dp_fill(buf, dev->parent); } } -- 2.35.0.rc0.227.g00780c9af4-goog