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=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 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 A209AC4707F for ; Wed, 26 May 2021 00:26:06 +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 68C286140F for ; Wed, 26 May 2021 00:26:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 68C286140F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nic.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4CE7282CAC; Wed, 26 May 2021 02:26:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nic.cz 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; secure) header.d=nic.cz header.i=@nic.cz header.b="hRz7MXD0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E9E5682D2D; Wed, 26 May 2021 02:25:59 +0200 (CEST) Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) (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 D765082B7E for ; Wed, 26 May 2021 02:25:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.behun@nic.cz Received: from thinkpad (unknown [172.20.6.87]) by mail.nic.cz (Postfix) with ESMTPSA id 5E08F1409BA; Wed, 26 May 2021 02:25:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1621988756; bh=XFD9vZ+evZe4I5GMScVn8KzcB0NWuI+TyFQuYvYXEFY=; h=Date:From:To; b=hRz7MXD0IQlnxAehp8NB6MQEHKrCOT/ghQtlLPhTf3tMZhhUom3BHwSROX6MFnhof fQOVe3UDAsPHM7SlEwYO7CjX26+p+JVDLyKjv2b8fLJ7LVUy49x6nBYgT6IF9KglpR vgd4vouGkQ0dkhEvlc3/p90tloYitdAYmF23Wpt0= Date: Wed, 26 May 2021 02:25:54 +0200 From: Marek Behun To: Tom Rini , Simon Glass Cc: u-boot@lists.denx.de Subject: Re: problems with boards with CONFIG_DM disabled Message-ID: <20210526022554.1104c350@thinkpad> In-Reply-To: <20210526012756.31c98fa2@thinkpad> References: <20210526012756.31c98fa2@thinkpad> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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.102.4 at phobos.denx.de X-Virus-Status: Clean On Wed, 26 May 2021 01:27:56 +0200 Marek Behun wrote: > Tom, Simon, > > now that LTO is merged I am working on > Support SPI NORs and OF partitions in `mtd list` > > but CI fails for some boards, see > https://github.com/u-boot/u-boot/pull/55 > > The reason is that there are still several boards which do not use > CONFIG_DM. > > On the previous version Simon commented that I should use > if (IS_ENABLED(...)) > instead of > #if > but this does not currently work for those boards with CONFIG_DM > disabled (struct udevice's members are not visible at all, and > functions from dm/device.h do not exist). > > There are multiple possible workarounds: > - use #if (until all boards are at CONFIG_DM) > - create static inline versions of functions from dm/device.h returning > failures when CONFIG_DM is not set (this would be rather big :( ) > - wait till all those boards with CONFIG_DM disabled are removed > - ... Since there is rather a large number of defconfigs with CONFIG_DM disabled, and since the relevant code was rather complex if (!is_part && dev && mtd->dev == dev) || !strcmp(name, mtd->name) || (is_part && mtd->dev && !strcmp(name, mtd->dev->name)) I moved the code into a separate name matching function and for now created a non-DM version. Hopefully this will be acceptable and pass CI. Marek