From patchwork Mon Mar 11 15:23:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Dahl X-Patchwork-Id: 1910496 X-Patchwork-Delegate: eugen.hristev@microchip.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=thorsis.com header.i=@thorsis.com header.a=rsa-sha256 header.s=default header.b=rgc7WRP2; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) 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 ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TtgXD5tYgz1yWm for ; Tue, 12 Mar 2024 02:23:24 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3F72687ECC; Mon, 11 Mar 2024 16:23:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=thorsis.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=thorsis.com header.i=@thorsis.com header.b="rgc7WRP2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 49ED98573F; Mon, 11 Mar 2024 16:23:10 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail.thorsis.com (mail.thorsis.com [92.198.35.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4CF8C87150 for ; Mon, 11 Mar 2024 16:23:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=thorsis.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ada@thorsis.com From: Alexander Dahl DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=default; t=1710170587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BJDIxcNBMdQ0WPHWWrVHqprCglReCqYiBoN8QysIaiM=; b=rgc7WRP2u48GDwr0Js7Mznz01XGqpAqiaNwyYfnRs+XRNdxpiuJzssBaR1IEczR7CMQcTz dRFZAtzoHKboW1vwFw8elkvliazFe1U0kVkaM8EwYPCF0+YFZMExepczRxo5QGQlwapM5a pnuCP5hMHgyHG77/nGTFI8r8rl2zxbEofepX4YB2tiJaANY6XbLzfCTThNqT0aBSpCLbIi QeV/Xq68Zm8pGvvZHepv7tL9tkR2DOLELJiJJ5MoOq+QxvVrTVnbN0iW92gA6rkT/Pui6e Re9+Akr0bKByipMHVanohqS9fmSZ25YZNfB5dLpn/HYyyr962MjebjTpimQ0TA== To: u-boot@lists.denx.de Cc: Eugen Hristev , Dario Binacchi , Michael Trimarchi , Balamanikandan Gunasundar , Mihai Sain Subject: [RFC PATCH 3/3] mtd: nand: raw: atmel: Remove redundant PMECC probe Date: Mon, 11 Mar 2024 16:23:06 +0100 Message-Id: <20240311152306.2358845-4-ada@thorsis.com> In-Reply-To: <20240311152306.2358845-1-ada@thorsis.com> References: <20240311152306.2358845-1-ada@thorsis.com> 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.8 at phobos.denx.de X-Virus-Status: Clean Always probing pmecc in the generic nand controller probe function and bailing out if pmecc is missing, prevents the driver to be usable for SoCs which do not have a pmecc hardware ecc engine like older sam9 SoCs, for example at91sam9g20. Tested on sam9x60 that the call, which the comment was moved to, is sufficient to probe the pmecc. Signed-off-by: Alexander Dahl --- drivers/mtd/nand/raw/atmel/nand-controller.c | 7 ------- drivers/mtd/nand/raw/atmel/pmecc.c | 1 + 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c index 0e0441472b8..b36f3a3ccac 100644 --- a/drivers/mtd/nand/raw/atmel/nand-controller.c +++ b/drivers/mtd/nand/raw/atmel/nand-controller.c @@ -2203,7 +2203,6 @@ static const struct udevice_id atmel_nand_controller_of_ids[] = { static int atmel_nand_controller_probe(struct udevice *dev) { const struct atmel_nand_controller_caps *caps; - struct udevice *pmecc_dev; caps = (struct atmel_nand_controller_caps *)dev_get_driver_data(dev); if (!caps) { @@ -2211,12 +2210,6 @@ static int atmel_nand_controller_probe(struct udevice *dev) return -EINVAL; } - /* Probe pmecc driver */ - if (uclass_get_device(UCLASS_MTD, 1, &pmecc_dev)) { - printf("%s: get device fail\n", __func__); - return -EINVAL; - } - return caps->ops->probe(dev, caps); } diff --git a/drivers/mtd/nand/raw/atmel/pmecc.c b/drivers/mtd/nand/raw/atmel/pmecc.c index 51f6bd2e65b..e500a0fe3f8 100644 --- a/drivers/mtd/nand/raw/atmel/pmecc.c +++ b/drivers/mtd/nand/raw/atmel/pmecc.c @@ -913,6 +913,7 @@ struct atmel_pmecc *devm_atmel_pmecc_get(struct udevice *userdev) ret = ofnode_parse_phandle_with_args(userdev->node_, "ecc-engine", NULL, 0, 0, &args); + /* Probe pmecc driver */ ret = uclass_get_device_by_ofnode(UCLASS_MTD, args.node, &pdev); if (ret) return NULL;