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 AD6D7C25B08 for ; Wed, 17 Aug 2022 11:24:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CFE80849B8; Wed, 17 Aug 2022 13:24:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="jkvupnCG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7078D84807; Wed, 17 Aug 2022 13:24:16 +0200 (CEST) Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (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 EC36C84810 for ; Wed, 17 Aug 2022 13:24:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=aford173@gmail.com Received: by mail-io1-xd36.google.com with SMTP id b142so7454518iof.10 for ; Wed, 17 Aug 2022 04:24:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=25zJjqA58ioJ0RrwmnVzdsBnsZR66J+N5slZ0JzcfP0=; b=jkvupnCGlzU6qQxwzpM5xHmndm4lr3UvBqGJVMoMmmW2BApqtOQbq2O48XnWc6D+mi PNAvpiCKXGKNHIkKSW5dRWn+psvCoTDkeUXHMQxiV9HpY3+C95mj9QFJwKsS9pGxl6Dz lW0ET6CQRFCDiYn/6OnYNglCb7t33zT2gsqAJJhcUYAlKqTttUa02mtVjRfDzd9iooTa 7wK6BpxlRh09093fq+uCOldi1IlBhBfmQiWrCiT+yBeo25Iv7Z59YO7aEsI1HF3kMlek 2gYMoOLOfAH3kll1qO22/zfRDZfW+HTedhBS2D4a/qrTVt3DPduL25fZUoNz2U9aU82x fLfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=25zJjqA58ioJ0RrwmnVzdsBnsZR66J+N5slZ0JzcfP0=; b=bzJLKuEBcvJn6H3vLY7zIxeT+VMCBtrDwoayglGs7K5z5sxWf/yF3BUrBsMMfob3+F Y8kP4IZmO4MmQ7FoG9qoFqb3lTziCTh2o+o5T/WRhu9CMHfL6sNZY3EfpTzobI26wkXW rG3pieaTiAise9PoPeAr2SZD80+qAra8SGPBtaLeVBPSfHCmvtJFpcr/rVxSG6DcrDt7 Nt12KQT43aguPIppKuqOHbsT3hqQ/VE/Z8Gw5/MRdxZoujwN+FkfybSrZ8P8aIW9T236 asYhUT9+9e/fG1+0nitxEUdFAG0ctmKDSyovSNV9swnjf0sYxcSVLgjSJNMgELStLxCh KqIQ== X-Gm-Message-State: ACgBeo2sjLD6o+HHh7xKXf1ZBCWIi2GdPYjKGoVeFMvTF771TO0vtdfM UoSNunRfepNfkAJ5jTG+geIheBujCTQ= X-Google-Smtp-Source: AA6agR64SkmV+gs1lQn6KsUOH9ORmqI9vXgTL3JMUivxqgMotkKd7ToLKWPFiJjxEfqNMqfJ8vR9vA== X-Received: by 2002:a05:6638:1494:b0:33f:7724:20db with SMTP id j20-20020a056638149400b0033f772420dbmr11690003jak.30.1660735447944; Wed, 17 Aug 2022 04:24:07 -0700 (PDT) Received: from AIO.lan ([2601:448:8400:9e8:9d79:948f:6e0e:794b]) by smtp.gmail.com with ESMTPSA id y13-20020a056602048d00b006849ee78e1bsm7505269iov.34.2022.08.17.04.24.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Aug 2022 04:24:07 -0700 (PDT) From: Adam Ford To: u-boot@lists.denx.de Cc: jh80.chung@samsung.com, sbabic@denx.de, festevam@gmail.com, uboot-imx@nxp.com, Adam Ford Subject: [PATCH 2/4] regulator: bd718x7: Only bind children when PMIC_CHILDREN is enabled Date: Wed, 17 Aug 2022 06:24:01 -0500 Message-Id: <20220817112403.68144-2-aford173@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220817112403.68144-1-aford173@gmail.com> References: <20220817112403.68144-1-aford173@gmail.com> 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.6 at phobos.denx.de X-Virus-Status: Clean If the bd718x7 is required, but PMIC_CHILDREN is disabled, this driver throws a compile error. Fix this by putting the function to bind children into an if-statement checking for PMIC_CHILDREN. Allowing PMIC_CHILDREN to be disabled in SPL saves some space and still permits some read/write functions to access the PMIC in early startup. Signed-off-by: Adam Ford diff --git a/drivers/power/pmic/bd71837.c b/drivers/power/pmic/bd71837.c index cb9238972f..fdbbd6f559 100644 --- a/drivers/power/pmic/bd71837.c +++ b/drivers/power/pmic/bd71837.c @@ -63,10 +63,11 @@ static int bd71837_bind(struct udevice *dev) debug("%s: '%s' - found regulators subnode\n", __func__, dev->name); - children = pmic_bind_children(dev, regulators_node, pmic_children_info); - if (!children) - debug("%s: %s - no child found\n", __func__, dev->name); - + if (CONFIG_IS_ENABLED(PMIC_CHILDREN)) { + children = pmic_bind_children(dev, regulators_node, pmic_children_info); + if (!children) + debug("%s: %s - no child found\n", __func__, dev->name); + } /* Always return success for this device */ return 0; } -- 2.34.1