From patchwork Thu Jan 10 21:21:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 1023230 X-Patchwork-Delegate: van.freenix@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qFBDQVLR"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43bJpr75pXz9sCh for ; Fri, 11 Jan 2019 08:21:52 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 32F22C2217D; Thu, 10 Jan 2019 21:21:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 652CFC220F3; Thu, 10 Jan 2019 21:21:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 168CDC220F3; Thu, 10 Jan 2019 21:21:44 +0000 (UTC) Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) by lists.denx.de (Postfix) with ESMTPS id 84811C220C7 for ; Thu, 10 Jan 2019 21:21:43 +0000 (UTC) Received: by mail-io1-f66.google.com with SMTP id f4so10155174ion.2 for ; Thu, 10 Jan 2019 13:21:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=DeNx4W+igYnbfyBPRSBKVuOXtKWbb2qlb49+lvQrn6w=; b=qFBDQVLRhm6dGEuIBNCM/bsvlUyOmRFFMKLkEKa7LSWnDGMfkMvdCkQmgIlmRqRNx3 eqliXSt6XLpRbYSsiyKpGv8IlUnfj5amfoapuriad6eaQjSEFr9DW8TGhjRg5UOiWCwE 0J5iogwofJUfWzWn2JN8l1Yt17ybT+NcO/ZhKXcov1TOhSTuKNKDnJ0NvnYN8wnm4kA7 NxeWc0ma+A3VqVrETJr9Xmg9H2Af0TR7p1lJahlXju0ob9RKbo5aeT5HCEB4U0UzwmfI nPkFvAfrCS6Zg0RkwQx80nsIsIIKdfiqf8vPHYXx7RQl+BZ17h8l1HH5T0t1uFxMdkrI G2iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=DeNx4W+igYnbfyBPRSBKVuOXtKWbb2qlb49+lvQrn6w=; b=V4EgK7IQ96V5fPROOk6GlnmvZ9JEMGCxUFUSVgIxDGir5Xf6fXMzGOhkgOQL02Kzq7 iDq1mmLI2Ir0voNIlpopSxIQyPOyY1DI5tlh6GwSaHuvCcfaHnwLyqd8cC9dYLgqTaf3 Rh7lzH764ihldjUfOr3fkfPQAVbI2p62b75uA0/vg98/AcQPUheE44tDSU0+kQOM52tj /uas2OpQ0dnpXrEHHEuCbsvqPQc+WgKZdBM2c6dfnizFAktuE4WdwtS/xSTi0RO4bhMw 5qOrCvZKXDNJlofEAsEBmwi53zn2gKRYngMvdZHbaYx6uuP00hO3B3bEY32lARdI44us jEww== X-Gm-Message-State: AJcUukeKil/YpS/SY329Cosl8tmLnGN8kehZrJnuII6WfTWOs+u7cRih 11qDSvxcLaUR5vq+DZ9N2LkIOuMk X-Google-Smtp-Source: ALg8bN7Uqa4wddUnlhDKD1VSKUZRZNMcgvN0LQcHNqFO76XV1j/RhCoQzvDCJmZIjFuqJ6STz5VdTQ== X-Received: by 2002:a5d:9157:: with SMTP id y23mr7582276ioq.115.1547155301786; Thu, 10 Jan 2019 13:21:41 -0800 (PST) Received: from aford-OptiPlex-7050.logicpd.com ([174.46.170.158]) by smtp.gmail.com with ESMTPSA id w186sm9703934itb.15.2019.01.10.13.21.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Jan 2019 13:21:41 -0800 (PST) From: Adam Ford To: u-boot@lists.denx.de Date: Thu, 10 Jan 2019 15:21:35 -0600 Message-Id: <20190110212135.28869-1-aford173@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [U-Boot] [PATCH] mmc: fsl_esdhc: Move ifdef to CONFIG_IS_ENABLED X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" For some boards, DM_REGULATOR and DM_GPIO may not be enabled in SPL but enabled in U-Boot. So switching to CONFIG_IS_ENABLED from ifdef allows the esdhc driver to function with some limited functionality in SPL. Signed-off-by: Adam Ford Reviewed-by: Lukasz Majewski diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index 74007e2ad4..1faae1987a 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -1395,7 +1395,7 @@ static int fsl_esdhc_probe(struct udevice *dev) int node = dev_of_offset(dev); struct esdhc_soc_data *data = (struct esdhc_soc_data *)dev_get_driver_data(dev); -#ifdef CONFIG_DM_REGULATOR +#if CONFIG_IS_ENABLED(DM_REGULATOR) struct udevice *vqmmc_dev; #endif fdt_addr_t addr; @@ -1436,7 +1436,7 @@ static int fsl_esdhc_probe(struct udevice *dev) priv->non_removable = 1; } else { priv->non_removable = 0; -#ifdef CONFIG_DM_GPIO +#if CONFIG_IS_ENABLED(DM_GPIO) gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio, GPIOD_IS_IN); #endif @@ -1453,7 +1453,7 @@ static int fsl_esdhc_probe(struct udevice *dev) priv->vs18_enable = 0; -#ifdef CONFIG_DM_REGULATOR +#if CONFIG_IS_ENABLED(DM_REGULATOR) /* * If emmc I/O has a fixed voltage at 1.8V, this must be provided, * otherwise, emmc will work abnormally.