Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4051529rwi; Sat, 22 Oct 2022 04:29:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5GdTWeXdYX8jdufn+oI/FaD+ZrqKjJ8/E6OFMGU++8bYaB5Qnjt7TNXnpG56lBbKb5i2p1 X-Received: by 2002:a17:90b:4ac5:b0:20d:ae54:f08b with SMTP id mh5-20020a17090b4ac500b0020dae54f08bmr52930354pjb.174.1666438177907; Sat, 22 Oct 2022 04:29:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666438177; cv=none; d=google.com; s=arc-20160816; b=LwgsBn9UzqMth257jA9PF/wb7c4vSVCAo1kueyAydlzwdgsGl2W4LiBy3Ng+9eV+xT IB5AFPOpOQZWuydOYj6oVtv/WssGlrxOvjAUYt8+WXXAIjl2kEvMVJNUdJuXNI9gUJJb jlcqpkK7VJmG042ZrXittJGQ/eNiuFSOtCfQlYg7RhEZSjIMJyrceryPv3zF5as9QfSr /I4iv2Q2a8lzDHUz5N6Yz0IYW4CcU+UgewtxwswfNez7+whu2ZEzY9IqaPMMNHF+Tcv3 5inBlR/0tn1gOvL0FkJhQUve32/nr3n0/+f38HTKojCt0BOAUr38CzbSbkaXIkTWniyW GZcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cpMcjDTV9x8uURe/ZNs17adrE3pPe29XLOyQVuyJoNE=; b=gOlebzIzwG1QYSq+qQi3PzNHw9ZFUcpa6+PXQdhD5wnaBgz0pVI3R5blwKxXYwy/aK zydTki3SbNcBJSfWmuTyicM3zJedupz4CR8CWnot27le+iLs7q88rGvr3DSYx6e//PzH bYwSPviLkuFppG8j+EC2KbEA3Aeuc8e1lbqeN1Ft81Ed1w2DiT7XiYjOP0wUgKnXLXCJ RyPnr1CSZhBNSMe3Bdiyy9k68QJEISpeBsyAMw8SgSdjBTZ9wjF2kmzcgj3wCRIMhOIY xWh72zdeUfpRT/JYNf9HG42Q2jNrOufYzgwc9aWLWUCrZZ6wCNSvysUlLUyHzyMybKv1 Kj3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JTaNWvZs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 133-20020a63018b000000b0046ee85f1477si724169pgb.712.2022.10.22.04.29.26; Sat, 22 Oct 2022 04:29:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JTaNWvZs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230526AbiJVLDQ (ORCPT + 99 others); Sat, 22 Oct 2022 07:03:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229707AbiJVLCk (ORCPT ); Sat, 22 Oct 2022 07:02:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3F9D2FA5FA; Sat, 22 Oct 2022 03:21:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 88A69B82E0B; Sat, 22 Oct 2022 07:55:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D19C4C433C1; Sat, 22 Oct 2022 07:55:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425301; bh=9BePWnK8/VkHjNuHRA8V9IPoLddrvuN0dJOkG015dOo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JTaNWvZsEa3Gjz4Jq5Q0SqKR7JD/X8pS+SLitewNRRR+QSXSGXNlqPmmJLyOKhCLa SmLw7bb2fqxUEHJQZaNlQzZYN1FxINAW/f218Z/YfNk3wrEA1IgmNqe6gBwftD7UYx KvfgVGBDvvzsvV4Z08I34rnlGv5rcRODSbmIw3eY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Blumenstingl , Miquel Raynal , Sasha Levin Subject: [PATCH 5.19 426/717] mtd: rawnand: intel: Read the chip-select line from the correct OF node Date: Sat, 22 Oct 2022 09:25:05 +0200 Message-Id: <20221022072517.275649060@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martin Blumenstingl [ Upstream commit bfc618fcc3f167ad082053e81e9d664e724c6288 ] The chip select has to be read from the flash node which is a child node of the NAND controller. Fixes: 0b1039f016e8a3 ("mtd: rawnand: Add NAND controller support on Intel LGM SoC") Signed-off-by: Martin Blumenstingl Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220702231227.1579176-4-martin.blumenstingl@googlemail.com Signed-off-by: Sasha Levin --- drivers/mtd/nand/raw/intel-nand-controller.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/intel-nand-controller.c b/drivers/mtd/nand/raw/intel-nand-controller.c index e91b879b32bd..3df3f32423f9 100644 --- a/drivers/mtd/nand/raw/intel-nand-controller.c +++ b/drivers/mtd/nand/raw/intel-nand-controller.c @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -580,6 +581,7 @@ static int ebu_nand_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct ebu_nand_controller *ebu_host; + struct device_node *chip_np; struct nand_chip *nand; struct mtd_info *mtd; struct resource *res; @@ -604,7 +606,12 @@ static int ebu_nand_probe(struct platform_device *pdev) if (IS_ERR(ebu_host->hsnand)) return PTR_ERR(ebu_host->hsnand); - ret = device_property_read_u32(dev, "reg", &cs); + chip_np = of_get_next_child(dev->of_node, NULL); + if (!chip_np) + return dev_err_probe(dev, -EINVAL, + "Could not find child node for the NAND chip\n"); + + ret = of_property_read_u32(chip_np, "reg", &cs); if (ret) { dev_err(dev, "failed to get chip select: %d\n", ret); return ret; @@ -660,7 +667,7 @@ static int ebu_nand_probe(struct platform_device *pdev) writel(ebu_host->cs[cs].addr_sel | EBU_ADDR_MASK(5) | EBU_ADDR_SEL_REGEN, ebu_host->ebu + EBU_ADDR_SEL(cs)); - nand_set_flash_node(&ebu_host->chip, dev->of_node); + nand_set_flash_node(&ebu_host->chip, chip_np); mtd = nand_to_mtd(&ebu_host->chip); if (!mtd->name) { -- 2.35.1