Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp3659987rwb; Mon, 7 Aug 2023 18:13:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGAyry2TAuQT2Ma/F6VHR/FtV+6vuz61NB+UH4jO6UbWbzAwvi+uMt7aRk7a4D4yRs47dmt X-Received: by 2002:a17:906:30c4:b0:993:d5bd:a757 with SMTP id b4-20020a17090630c400b00993d5bda757mr8534900ejb.19.1691457236035; Mon, 07 Aug 2023 18:13:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691457236; cv=none; d=google.com; s=arc-20160816; b=KID7Q37PN5xTWSA9VaWPxAWNEdGXuK6VgpvJSZ4ms8CH8g2Xwo3hP2MealRC34stRi YoLeM2QCp9llDYL0soWpgjc2jYFU9j0VcIP0/s4PeXb9gmhfkFdUVOKv9wxA93nvcbVh enr0wPlbCEMrEw9Mul/gwBTOOqmhJO1Zr9ffY78PlanZgl9/NUN/U8x1TyEsPNcLQECV a+qmEWS8CsGWrluQW6kLPXj9RXHSfGP9TuNWElykmUT3/p6he4vptRl4/F5CPagmeQ/S m9BXzYTa59wxCr/hXjD9AvZpXmhku6Qvb3R4ITZHU8CkxDNoaCTmA+iVKqq/z2W2LXl2 V3Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=BaDvMhsdDWBlo8Pb4fICkd2xt9fwXZfCFSx16g/BlKs=; fh=kk2XYUqsGqTORo/GT0oRvoWkDBAGB0m/ewo0VBVkkqY=; b=SgM6cuve80klyzFnHE7S5/a7CBHNG1/V1XRrCXx9J6RalFhAJXH1Uh0eYUE7Ma32Ci +h1HaUGzQmIFFSf8tkl3xwrRCi6tOdhj3x8nbFjIIGxcIB640FcZ41SAsI0QL4tAAZKD fZxo/nETZrVVHGlqwdKyNgoGo2AyyHmTGEJA1eh4MfdTU+P3GL9chdIsOkJ/7AOQJbZP eJVUaw/5x07W4kRzXLnKLO/nRVqD7pSPydLj3E2dHcYVBHioohgXCofF5XX10CxaTRVd xc5vGST4HklJbrbbLNa1ijub5fGVuvuz8lMxNZVxK4DCVi13TW1wxtw4ab+CqyflJH3q V+Wg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i22-20020a170906851600b00993686e193csi6686087ejx.53.2023.08.07.18.13.31; Mon, 07 Aug 2023 18:13:56 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230061AbjHHAAX (ORCPT + 99 others); Mon, 7 Aug 2023 20:00:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbjHHAAW (ORCPT ); Mon, 7 Aug 2023 20:00:22 -0400 Received: from mx.socionext.com (mx.socionext.com [202.248.49.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AD04EDE; Mon, 7 Aug 2023 17:00:20 -0700 (PDT) Received: from unknown (HELO iyokan2-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 08 Aug 2023 09:00:20 +0900 Received: from mail.mfilter.local (mail-arc01.css.socionext.com [10.213.46.36]) by iyokan2-ex.css.socionext.com (Postfix) with ESMTP id EA17F2058453; Tue, 8 Aug 2023 09:00:19 +0900 (JST) Received: from kinkan2.css.socionext.com ([172.31.9.51]) by m-FILTER with ESMTP; Tue, 8 Aug 2023 09:00:19 +0900 Received: from [10.212.159.175] (unknown [10.212.159.175]) by kinkan2.css.socionext.com (Postfix) with ESMTP id 436EA1CF7; Tue, 8 Aug 2023 09:00:19 +0900 (JST) Message-ID: <213763b3-5a8b-3a88-54f1-024325f7fe80@socionext.com> Date: Tue, 8 Aug 2023 09:00:18 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH] spi: dw: Set default value if reg-io-width isn't specified To: Serge Semin Cc: Mark Brown , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230807001621.196776-1-hayashi.kunihiko@socionext.com> Content-Language: en-US From: Kunihiko Hayashi In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 Hi Serge, On 2023/08/08 7:57, Serge Semin wrote: > On Mon, Aug 07, 2023 at 09:16:21AM +0900, Kunihiko Hayashi wrote: >> According to the dt-bindings, the default value of reg-io-width is 4. >> However, the value becomes zero when reg-io-width isn't specified. > > This semantic is implied by the dw_read_io_reg() and dw_write_io_reg() > methods. It doesn't seem like that much necessary duplicating it in the > property parse procedure, if not to say - redundant. I see. Currently since the variable reg_io_width has no other references other than dw_{read, write}_io_reg(), it means the default value is taken if this is zero. So, I think we should be careful when actually using the value of this variable. Thank you, > > -Serge(y) > >> >> Should set the actual value to dws->reg_io_width, considering it >> referenced. >> >> Signed-off-by: Kunihiko Hayashi >> --- >> drivers/spi/spi-dw-mmio.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c >> index a963bc96c223..7eafc07ef7aa 100644 >> --- a/drivers/spi/spi-dw-mmio.c >> +++ b/drivers/spi/spi-dw-mmio.c >> @@ -369,7 +369,9 @@ static int dw_spi_mmio_probe(struct platform_device > *pdev) >> >> dws->max_freq = clk_get_rate(dwsmmio->clk); >> >> - device_property_read_u32(&pdev->dev, "reg-io-width", > &dws->reg_io_width); >> + if (device_property_read_u32(&pdev->dev, "reg-io-width", >> + &dws->reg_io_width)) >> + dws->reg_io_width = 4; >> >> num_cs = 4; >> >> -- >> 2.25.1 >> --- Best Regards Kunihiko Hayashi