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 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 CE910C433EF for ; Thu, 19 May 2022 09:13:04 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 992F183C5A; Thu, 19 May 2022 11:13:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.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=kernel.org header.i=@kernel.org header.b="gow+0m6r"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A89FA83D0C; Thu, 19 May 2022 11:13:00 +0200 (CEST) Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 808DA83C01 for ; Thu, 19 May 2022 11:12:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 3BCEBCE2284; Thu, 19 May 2022 09:12:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60190C34100; Thu, 19 May 2022 09:12:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652951572; bh=I3mLIaicp8XyfJvoIwh863mymzRds4C4N+k++vmNjE0=; h=From:To:Cc:Subject:Date:From; b=gow+0m6r9bpVZ8zEjLmK6bb59hImbWQYe4X6JDLArdJkTuvcMm30upMQNNZqqYwLa ON0accniHn5LW2zqO9fRH6adjR5mGq9Vst5Rk2DA5Ioms3RU4O23gl/BxNkm2XIc9z OLb8T8ehtUcHn1xdWQEBbJEgEanAAqq5fX0CVlWqmJwopfwWj7aIutYt1B5nc4ie1O bKXjzTadFSWQOkGP8U4z4wxdO7cRFcXZbhVMwX5NDbyDgkAslieVKVOuYQKbO+9oRU IIuiproI86Di7deURWEEsTO4VoS6EBINhbzSmNzSEitFmvXlOLIAPUwPhXsDHu+mZW lfRLhfVkMcCFg== Received: by pali.im (Postfix) id 453F1810; Thu, 19 May 2022 11:12:49 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Marek Behun , Stefan Roese Cc: u-boot@lists.denx.de Subject: [PATCH] board: turris: Find atsha device by atsha driver Date: Thu, 19 May 2022 11:11:52 +0200 Message-Id: <20220519091152.23539-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 It does not matter what is DT node name of atsha device. So find it via atsha driver and not by DT node name. Signed-off-by: Pali Rohár --- board/CZ.NIC/turris_atsha_otp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/board/CZ.NIC/turris_atsha_otp.c b/board/CZ.NIC/turris_atsha_otp.c index 8c39f5e52414..e62b7ee2a49a 100644 --- a/board/CZ.NIC/turris_atsha_otp.c +++ b/board/CZ.NIC/turris_atsha_otp.c @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -16,12 +17,14 @@ #define TURRIS_ATSHA_OTP_MAC0 3 #define TURRIS_ATSHA_OTP_MAC1 4 +extern U_BOOT_DRIVER(atsha204); + static struct udevice *get_atsha204a_dev(void) { /* Cannot be static because BSS does not have to be ready at this early stage */ struct udevice *dev; - if (uclass_get_device_by_name(UCLASS_MISC, "crypto@64", &dev)) { + if (uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(atsha204), &dev)) { puts("Cannot find ATSHA204A on I2C bus!\n"); dev = NULL; } -- 2.20.1