From patchwork Tue Nov 3 12:33:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 1393014 X-Patchwork-Delegate: eugen.hristev@microchip.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.a=rsa-sha256 header.s=mchp header.b=giJ8XpXW; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CQTkQ3W5Pz9sTL for ; Tue, 3 Nov 2020 23:34:37 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 713498266D; Tue, 3 Nov 2020 13:34:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.b="giJ8XpXW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DC2DD8266C; Tue, 3 Nov 2020 13:34:15 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,T_SPF_HELO_TEMPERROR autolearn=ham autolearn_force=no version=3.4.2 Received: from esa3.microchip.iphmx.com (esa3.microchip.iphmx.com [68.232.153.233]) (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 791828264A for ; Tue, 3 Nov 2020 13:33:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=Eugen.Hristev@microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1604406824; x=1635942824; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=GPSdf+nHGXout16NXan66f6HKTr4nLsEGbyX/AB1wQI=; b=giJ8XpXW05FNhnObSZL649OqJGNbd+/Ztl0pZCFa+2iEzpRXzgoIIPY5 OXkYMzOmma7Oarp63Pl/J/zCjX/Aj2wsUy9WJsqJ6ZGpq3myokR5Fh4pv gNHS4vs1fkXd8yCuQBRsD2W5XuZ6/yEqUkLFUnN1VjlwD93B9ga7pMDHl sCpnfqRyundSkToNAj3RaAptNVUQXm8e6Fg4E4goEVJYLqNdKTt2H0QOv 12330lQ5e6WQaxIuckZlDuBVjUMDOB34zJrIOTAhrs7vumLiVmM5GdtOp QAtohDZMa6ccHQazeLsyExQsAkmMml+9U/OyEbHLXMN7+stWBoLmKE33o A==; IronPort-SDR: v7w2yvzZmjGeIVuSB0XccpPFQowOAa/whUSWPOyA+OhafMPAhs+n7/XL7FDFiNT8Z0t8uzDWWo qpms3zvVBBewuDjKtvZ0BWKXDuNJuZxcDQKnYyNaH86EBZjwNt537XllDrhmEkRA5RWq/d/GMF mA26XnNN9BFlJ2b3eg91GOmtuXXTyIVWHEg482P+fSf0rbAeL/ZNiddQYz9vffgNSD1isrQR5W 3l3eQjnqxoUc1t+qjWYuYNQC12VavItaTbjE6QySlIjSWxIGzxjz7D8KJwSxyPhl2DnnLhFLJL Iuc= X-IronPort-AV: E=Sophos;i="5.77,447,1596524400"; d="scan'208";a="97584099" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Nov 2020 05:33:38 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Tue, 3 Nov 2020 05:33:37 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Tue, 3 Nov 2020 05:33:35 -0700 From: Eugen Hristev To: , CC: , Eugen Hristev Subject: [PATCH] mmc: atmel-sdhci: fix the clk_enable call in case of no ops Date: Tue, 3 Nov 2020 14:33:24 +0200 Message-ID: <20201103123324.79741-1-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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.3 at phobos.denx.de X-Virus-Status: Clean If the clock driver does not offer a clk_enable ops, then the system will return -ENOSYS. The clk_enable works with CCF (common clock framework). Some clocks in some cases (like the generic clock for some products: sama5d2) do not have the clk_enable primitive, and in this case probing of the driver will fail. This patch changes the behavior to return an error in case there is really an error, and not a missing primitive. If the clock driver does not have an enable primitive, most likely clocks are always enabled or enabled in the set_rate primitives. Fixes: 81f16438d4 ("mmc: atmel-sdhci: enable the required generic clock") Signed-off-by: Eugen Hristev Reviewed-by: Jaehoon Chung --- drivers/mmc/atmel_sdhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/atmel_sdhci.c b/drivers/mmc/atmel_sdhci.c index f56ae63bc2..82dfc345c0 100644 --- a/drivers/mmc/atmel_sdhci.c +++ b/drivers/mmc/atmel_sdhci.c @@ -86,7 +86,8 @@ static int atmel_sdhci_probe(struct udevice *dev) return -EINVAL; ret = clk_enable(&clk); - if (ret) + /* return error only if the clock really has a clock enable func */ + if (ret != -ENOSYS) return ret; ret = mmc_of_parse(dev, &plat->cfg);