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 B5561C04A95 for ; Sat, 22 Oct 2022 13:44:17 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C109784F11; Sat, 22 Oct 2022 15:44:10 +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="oW8H2aUI"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4235884F5E; Sat, 22 Oct 2022 15:44:06 +0200 (CEST) Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) (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 D9DBA84F72 for ; Sat, 22 Oct 2022 15:44:02 +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-il1-x130.google.com with SMTP id i9so3053424ilv.9 for ; Sat, 22 Oct 2022 06:44:02 -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:subject:date :message-id:reply-to; bh=qSXRvvDBlk6ZpKfLrHnFyJrnql0l7zLZmfuxRoAa7zw=; b=oW8H2aUIWERh0nlEy1J1FooVVtHFeSxFAKSJ0QmJeInnYeK3oJ/2unWU+T50yyoKDl XozWxuLF3MEA2Vt+ny5qjlnZOlY0oZIpcHHQS2lrUdF2zXpaTm/mJAm4tGElRUv8s8Va XR6RqWSKiWFC6faZ4Pe4UdNHp5RqQWA4YQPa2rZQRKRysgyjGKPxqsaF3rlb7UauIBDp lnAI2fYVXuMbRUthDt4DSYruf+tGuXVe3DKI5jMRNPM8tKnuOYechVfWBzTOzWBbo1IJ i6Lpx2WMmN36tkpnDAxp1W17z7aHRCAPkP8/ZYnmnq3ilSbUZaVJQCH8gXbwAQNXsf6V X/OQ== 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 :subject:date:message-id:reply-to; bh=qSXRvvDBlk6ZpKfLrHnFyJrnql0l7zLZmfuxRoAa7zw=; b=S2H/iYlntYpXmk+gMOMxpIJNW5tbI6n/hbjMXCji4wN7a0ESXeF2BJYnJMujLpVJKf CXgS+8F+njRZlftl/0fcLHFXOVo8h1yDSIQagxZV1TVEiEKv3biBwCjCYVmgOLosUWGz +HbcHEmVGAKcyoX61nfEFcenz1AZzmYcxEGIFfar9z+dSpHfZR/KogYFBjpulnKcX/c2 6nruZGMcDOke851j4KbExcQ9UpJj+XTjn5MZ5C86eKacvZeL5TFQDpxTliquuJdofMGB K7zs9hz/JCNOfrLG8QUOKdeleNHyRsjVzH6IVciw8K7f8FbIhoobgllBuXjou4U0U4a8 DnDw== X-Gm-Message-State: ACrzQf2QHcYM9jerV62cRHRaQmcPaOlKwhoe/4qBtTCQP5hC2JjdoQYf dmVng/l0dusgae7p7Pizy+HSj9/A0ak= X-Google-Smtp-Source: AMsMyM5HugIHCNnwzJqWsH7e6SVyhnXLtPzmgDy4XGAi/SuOkqdV96EphnGVfKgIT75PXot8Y5T+2g== X-Received: by 2002:a05:6e02:2205:b0:2fb:149e:4e7 with SMTP id j5-20020a056e02220500b002fb149e04e7mr15742445ilf.192.1666446240584; Sat, 22 Oct 2022 06:44:00 -0700 (PDT) Received: from aford-IdeaCentre-A730.lan ([2601:447:d081:b229:bd3d:2f55:b616:5c0c]) by smtp.gmail.com with ESMTPSA id k6-20020a026606000000b00363b8ef4bc5sm5117978jac.71.2022.10.22.06.43.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Oct 2022 06:44:00 -0700 (PDT) From: Adam Ford To: u-boot@lists.denx.de Cc: sbabic@denx.de, Adam Ford , Simon Glass , Jaehoon Chung , Fabio Estevam , Peng Fan Subject: [PATCH V2 2/4] regulator: bd718x7: Only bind children when PMIC_CHILDREN is enabled Date: Sat, 22 Oct 2022 08:43:42 -0500 Message-Id: <20221022134345.7613-2-aford173@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221022134345.7613-1-aford173@gmail.com> References: <20221022134345.7613-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 Reviewed-by: Simon Glass 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