From patchwork Mon Oct 24 11:30:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9444 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp479435wru; Mon, 24 Oct 2022 07:19:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Npym6AbBCtJn1+q/ncjyaIcj/ItzO503sQIBZLRR2tGZlTRNtivMx2830YuXruXHsLp5W X-Received: by 2002:a05:6402:190e:b0:45c:d10a:4c1a with SMTP id e14-20020a056402190e00b0045cd10a4c1amr31199663edz.345.1666621147818; Mon, 24 Oct 2022 07:19:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666621147; cv=none; d=google.com; s=arc-20160816; b=Atx9hFjyoxAkxkfX7n7Lhdd/f5eNEZFEF1oBHNSFvg18VvshhhHDUH81mNway8lgaK bK4h8GJN0js331ldeZd/zd44IfBg3JDvGxSCePja4jV2Pxm9FL5EpPZHw8k/UZzxjgmL 486tUpYAr60PXeQXfBXi5ZzL9J0Fq5UE1Yp8Ssrdp75e6YJ7XbIPAE64M2l+7z++EFtU y16nqRj0Cc2++8Xg4FINkvIwCRIJXDh6OThhHyzjjKVKM3RDpI6Ah5519teuPxb4g9I0 3HCOrZ+czvHfBOXL5VQ+7BUPTvb5l6lxGQkjSGFMGwJ15xm92zNKwWThNCvKuNrfhVy4 xrhw== 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=h7yq2lQxlDroGh81ml0pa91XXTYh6jzS2ri5E50YzdWwX37rTrP0LulCHf2iJeZ5jM BEK6xRj0NEStjiMllSvwWhGiJrbHUPR3Nynq8Gdwzwm1XhbemnZAGNJX2Y5wfcFRFq/1 14Ii/DGj7italwI32GVgSMY+al6IqWTY6JqIxho2R+GnEEpsXCyr4S5SPmD1mLTGC2y4 H+uc81jWKLfFUqDh4sr9xdULRvZWHMphzn7LTAncu2Cw5NMliiEt2OESyipKorBc8b/o QeAGgr7uwLDVyANle75vjfd6e/c4fr5IklnhpsnGqaWaVEWeXaW8v/Xtu6sMVpn2edjN 8hpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zZKWwxJk; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg5-20020a1709072cc500b00780636a4a58si27393326ejc.626.2022.10.24.07.18.43; Mon, 24 Oct 2022 07:19:07 -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=zZKWwxJk; 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 S235510AbiJXODR (ORCPT + 99 others); Mon, 24 Oct 2022 10:03:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236894AbiJXOCE (ORCPT ); Mon, 24 Oct 2022 10:02:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E92F1BECFD; Mon, 24 Oct 2022 05:47:59 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 4BA8461335; Mon, 24 Oct 2022 12:46:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DBD9C433C1; Mon, 24 Oct 2022 12:46:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615578; bh=9BePWnK8/VkHjNuHRA8V9IPoLddrvuN0dJOkG015dOo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zZKWwxJkaWFEIlwbGEwWoSjcAkIwfa8+qaV/Esp3kxmWckOhdJ3gjMZ71G4ewmYqD 6bfUQ+hWr4n2JPD0B8LKJl7g8skiMhLQ/7kg9ZL5GdOcV4VRCqSAhkq2nNy/2weSr5 EaA48ab+Q+bzunc59AEFrmAIpWPAszmSCssXuGW0= 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.15 305/530] mtd: rawnand: intel: Read the chip-select line from the correct OF node Date: Mon, 24 Oct 2022 13:30:49 +0200 Message-Id: <20221024113058.876066655@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747578937013022768?= X-GMAIL-MSGID: =?utf-8?q?1747578937013022768?= 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) {