Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3006173pxp; Mon, 14 Mar 2022 09:02:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZ3VYEjSIqqWczTU841NBLPw8vZyFsXb5GUNBqvjDaLRpvjRD7nnkkRDh5qk2kGnzQa2z3 X-Received: by 2002:a63:515:0:b0:379:460f:7bda with SMTP id 21-20020a630515000000b00379460f7bdamr20912777pgf.534.1647273737423; Mon, 14 Mar 2022 09:02:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647273737; cv=none; d=google.com; s=arc-20160816; b=yH72p2Po/wTGNu+DOQH6R1YgCfqbRdnCsQxJhtCUGW9HA5pUMg93VlfD8UWOzcy49d w8uv1zpc+DrcqMVqr2M1Aelo2Wk788hM8iZ+skY7AwVoHHWWh9RBMupvWfR2S5QQddUV o37nwBfj0hXu12tajAwrJy/t3yBFvFMHVFoo/J38ULb+wBi2BYcXTaTzHhsLa2XVxxqt 8jExWC03ggrN3B3xBlst69v6vBKmj0DCEba6j2J9B6LK+2LLTjV5f9kReag63XeQCU4Z sHtqcpJgbNkN1WEFwPL5R+LwHzTwkJVDunH3D3Umv2CjPksdPUCnVE0uSW/d8hFR/ncT 2bRQ== 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=bUUrZNpcTtfbhCkhmg82RlO/t1oDLKjSAkGVA1AjLW7J2BLhA5UMHnGk7PZs1JIiNl /fSlG5GG0rmCjruJHI83sSk1fy6B3hWr+AWzj1+q/AXrQK2StNEywQgejIZob5zp16cC yr63cP6I4mc1ucoiCA+1wpOKLVaj35+I3lMKg3LHQnULGWETfJc6/FwnJhe45096vExu NVZVmlOai/rla5IMIW6lBIM9mn+v7bUTErKrUmeB4yGoDYm/rZs4mcu8dTZGMfTvx6iT EjQ6NKGU5i4XiRQxMZMB0QGB3G8xkphSq/wIIQ2CJbdkqai4Zem/NdpWSH50225RuN9X 6CsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=k8vpeLby; 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 d68-20020a636847000000b003803fbd052fsi15462853pgc.659.2022.03.14.09.01.53; Mon, 14 Mar 2022 09:02:17 -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=k8vpeLby; 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 S242013AbiCNMSm (ORCPT + 99 others); Mon, 14 Mar 2022 08:18:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242369AbiCNMJy (ORCPT ); Mon, 14 Mar 2022 08:09:54 -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 6FC071E3C7; Mon, 14 Mar 2022 05:07:31 -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 0818261343; Mon, 14 Mar 2022 12:07:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D666CC340E9; Mon, 14 Mar 2022 12:07:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647259650; bh=VuQiuhjqnRPF2PUIDPbSzKC6E5XqH+TQgrvnuZSt+Ko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k8vpeLbytLUkDB/+ydEPLfl/75asjfRisc7tHlLxmIOuX0sjPSnV+vQkVZZsgPgGX McVieawyfIwlSbpYVgvrMLKglDgO2nVwthTE6GtTVAOv8GK4s6SpvSdFjl6qdpd2Wv 1/shBFhZu9l0RPtnSrrb7SUEx9+4lLOA7kPwVgI4= 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.15 058/110] spi: rockchip: Fix error in getting num-cs property Date: Mon, 14 Mar 2022 12:54:00 +0100 Message-Id: <20220314112744.655203719@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112743.029192918@linuxfoundation.org> References: <20220314112743.029192918@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