Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3703208pxp; Tue, 15 Mar 2022 04:44:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXhNhJGQcq+Ff+Zo/IELpomD5DlyIf+5uIZ/HexzhyLh1GOPTNkfxejGB1WAGb047ZsSfJ X-Received: by 2002:a65:5a8e:0:b0:365:3b6:47fb with SMTP id c14-20020a655a8e000000b0036503b647fbmr24095888pgt.147.1647344682693; Tue, 15 Mar 2022 04:44:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647344682; cv=none; d=google.com; s=arc-20160816; b=KLbAGXVxYsSXZ7RxX1I//t9Y7RN0N+vgiw/p7kF2RPYqK4by99JtlwKJZDIO7IbAhu aqvJ0oXHWIH4gJLSVsn7RUNy4Uv0nv6NVhG01TunuIhb8qxzBTjIRkK1cQ09V6s/B3Vw /kh8/+nFQ7NcHc+7StgURhFGptKCACl8gnKe7aRFZBIL7H3dBUtoXoKuKUxNkKN7i6+c +y5UQQrm9EhWw9wc18Y8AGck/U/5N1VjuITkU1UtkkFDc5T5BpYeDy6rcZQA9EWvto8b y2kwu9GynuxhqO0tM8mTM1DoPdvifqZWsYgReKSkmN/CbzoEERWs9xkAKdvLzhpnjiox pfyw== 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=AW5UbfK08KRZjuBDyn30WUx8RLzdpoi0qKYShrVTxyo=; b=FxsAWTmNMQ/T6v8qqbRiiF1yLV6kinr/eExUQZM0sevGp6yuLvxpGbnznZrcssjAsP +ETeexz3wdzqPe049o7+FtCci0BRt9emsunzxKr03y4dw0+5EkdkGX/rPowvojdnxkKv ofQTYxIR4Ew6NyhdHvPSpU0a0nAXBIIO3OB3TP/5mtLhVnGEOl1PTiOzMdz/IPwA/YzX HA87Cv18P4guEPn1TEevabG6Nm/7RECb3zsYjH3clozkwZr60LOHk7peSOmiObjIRgyH alimqHSxWt0S3NZwH1V6YDsIUPAdudMfFFdAtxp7WzDN66FDQ8tMyew6wP2TmY/iUR0f 7TuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kSQGt870; 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 bt3-20020a17090af00300b001bfc2beb4c4si1614473pjb.64.2022.03.15.04.44.29; Tue, 15 Mar 2022 04:44:42 -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=kSQGt870; 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 S242223AbiCNM3V (ORCPT + 99 others); Mon, 14 Mar 2022 08:29:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243848AbiCNMVT (ORCPT ); Mon, 14 Mar 2022 08:21:19 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01DB71B6; Mon, 14 Mar 2022 05:17:17 -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 A55C7B80DC0; Mon, 14 Mar 2022 12:17:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D890FC340E9; Mon, 14 Mar 2022 12:17:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647260234; bh=VuQiuhjqnRPF2PUIDPbSzKC6E5XqH+TQgrvnuZSt+Ko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kSQGt870F+BGQ4w76RabcAqyWYfmhWfeUZkqjDrTxmAIw4YU1bjVlIp562Syyq8bR Y3qhD8UQuPbsmBIBg5l+rzWSGsEagC7MbyB4zEL/cacv6acuTeBWSyyM5ZNTF71cs3 gyfp4Lx0E/Ijjk9sZLKFEt1OceslYGtYSUEeGN3o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jon Lin , Mark Brown , Sasha Levin Subject: [PATCH 5.16 066/121] spi: rockchip: Fix error in getting num-cs property Date: Mon, 14 Mar 2022 12:54:09 +0100 Message-Id: <20220314112745.966708059@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112744.120491875@linuxfoundation.org> References: <20220314112744.120491875@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.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,T_SCC_BODY_TEXT_LINE 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: Jon Lin [ Upstream commit 9382df0a98aad5bbcd4d634790305a1d786ad224 ] Get num-cs u32 from dts of_node property rather than u16. Signed-off-by: Jon Lin Link: https://lore.kernel.org/r/20220216014028.8123-2-jon.lin@rock-chips.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-rockchip.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index 553b6b9d0222..4f65ba3dd19c 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -654,7 +654,7 @@ static int rockchip_spi_probe(struct platform_device *pdev) struct spi_controller *ctlr; struct resource *mem; struct device_node *np = pdev->dev.of_node; - u32 rsd_nsecs; + u32 rsd_nsecs, num_cs; bool slave_mode; slave_mode = of_property_read_bool(np, "spi-slave"); @@ -764,8 +764,9 @@ static int rockchip_spi_probe(struct platform_device *pdev) * rk spi0 has two native cs, spi1..5 one cs only * if num-cs is missing in the dts, default to 1 */ - if (of_property_read_u16(np, "num-cs", &ctlr->num_chipselect)) - ctlr->num_chipselect = 1; + if (of_property_read_u32(np, "num-cs", &num_cs)) + num_cs = 1; + ctlr->num_chipselect = num_cs; ctlr->use_gpio_descriptors = true; } ctlr->dev.of_node = pdev->dev.of_node; -- 2.34.1