Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp2392378rwb; Sun, 6 Aug 2023 17:34:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFec1XBAlUV2qWhNRza77LLlC18zBhz3NzswkZe3c0YO5x0yQX+LBot6RQwjE6Ta/0Xi4au X-Received: by 2002:aa7:d816:0:b0:51d:914a:9f43 with SMTP id v22-20020aa7d816000000b0051d914a9f43mr6703860edq.36.1691368481827; Sun, 06 Aug 2023 17:34:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691368481; cv=none; d=google.com; s=arc-20160816; b=u0UdTqBg1lbTle1yWrfOYJTNI723X21xlFb9W7Zh1bZ1w3rxetsj6kl8URN6simeIc CSr4pkWPlZSY+Yp7PwsFkBgehuzeTCMcKBSWXBUVigOkNE8PvCRIVSwZrl8aZNZNLa6z 15XTHkieIr5xwyIlVELxBAVp7KZnEmfFk8pXmW9HlF13EjZ2ZWtzA/9o554V3caiXmeK oWRgYCtUTM9hJe+kP29625sjSwGYzObHWyg0BYIYyCXlVjVWVJ5LmTOb/534NlVjJX1W rf1uD093z0IapCvVsN5K1dPAX8F5GmpjN3wcTkDhhImC/k9xzWeQ3AJuJH5/6/6+By+p 2cdg== 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 :message-id:date:subject:cc:to:from; bh=5a0YVBM1KXuf92XS0W2KrHhD2shTvu8rUr8/6aj9xak=; fh=mYfWdevyHAgX1fgmT9WsKOSK2gxRxRN24g1G821/dQk=; b=uPE3Di+bOD4h9FsNRTQ1iQHzEsi1UerlM7LSwA2O6KesCnHrII+EX81wliqc9FgKFp CmhFcaInwneRI+8zdb6MbKZp5m8pGJhZVR6G9AL/B7L0w2Qq0RiLkvzuZuscqhHW+94X 44xFC4WQJKJsbvrNzRqgrE4FWdKto4USJJhnnkT602GhB+VuL6AgMt5Esc/+J6pcO2B8 MhlMQQSslKcUFL2djd7qZ/buOvaFsNvfWYAQs1BllT+gBcVCcBScrD1WIr0S7+ED1BRY gsHjDx9X7oT9tuCf4aDf1STRfylFKCOGP/7Q+EfsGz0BB/9vTD6NAD8EGVi9xlBLufcX zYCg== 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 w18-20020a50fa92000000b005224c6046a6si4843908edr.508.2023.08.06.17.34.18; Sun, 06 Aug 2023 17:34:41 -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 S229571AbjHGAQi (ORCPT + 99 others); Sun, 6 Aug 2023 20:16:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjHGAQh (ORCPT ); Sun, 6 Aug 2023 20:16:37 -0400 Received: from mx.socionext.com (mx.socionext.com [202.248.49.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0376DFA; Sun, 6 Aug 2023 17:16:34 -0700 (PDT) Received: from unknown (HELO iyokan2-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 07 Aug 2023 09:16:33 +0900 Received: from mail.mfilter.local (mail-arc02.css.socionext.com [10.213.46.40]) by iyokan2-ex.css.socionext.com (Postfix) with ESMTP id 6016D231A0F8; Mon, 7 Aug 2023 09:16:33 +0900 (JST) Received: from kinkan2.css.socionext.com ([172.31.9.51]) by m-FILTER with ESMTP; Mon, 7 Aug 2023 09:16:33 +0900 Received: from plum.e01.socionext.com (unknown [10.212.243.119]) by kinkan2.css.socionext.com (Postfix) with ESMTP id B6E81126DC0; Mon, 7 Aug 2023 09:16:32 +0900 (JST) From: Kunihiko Hayashi To: Serge Semin , Mark Brown Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Kunihiko Hayashi Subject: [PATCH] spi: dw: Set default value if reg-io-width isn't specified Date: Mon, 7 Aug 2023 09:16:21 +0900 Message-Id: <20230807001621.196776-1-hayashi.kunihiko@socionext.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 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. 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