Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3499944pxb; Mon, 24 Jan 2022 10:51:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJwAw6k4yzcaCEgvqIdfyusFlp1P3MsQzqC2TKVtS9jkVcjwNTh4LMvCEz65LE6bgOr0hrtI X-Received: by 2002:a63:368f:: with SMTP id d137mr12946319pga.0.1643050278740; Mon, 24 Jan 2022 10:51:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643050278; cv=none; d=google.com; s=arc-20160816; b=gRYFggFg6Dy2a8lbjPiiCYsXeQyXDJbPJlq89ONsQt/lDA0JDbjFWxQ/jTsOjYRonB NPitkyxFv0vBSQwANA4h17EM+9XNJ+Ybi9OCqmbp3cZpDbJriKmU1rjX/XUsayh7kG+d J9a4SPb/ZQ7ch/EAIEgLhhiEEYAZHr2KofZlFzEGSc4+W9hKCJsptSmeqc8esRCyAiWE IkGAkZpqmV3kpdid9NttKPBYZ+/sskTZrkxjm0NTBkR4iKdmwdp9zla6tnGdkRwlABj+ tZ9sfa/V+kPm1g/S3Apup1zwgkbq+DMcdI75oknEu6cFpeKBBLH5bFf8ookY9LYLXuxz 51gA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bto/xpfUsOVGNmCnHot8/BAzxWmx4lezX3yYM6aPOPk=; b=TqHAvFzvUptxtpiPVajRKcrBOAA09y7LjL+NOXoOCh5zowT49teVWoCqNsOToBRhi0 i74t90Ioge5CJTUjlBV8s7FupMPxguSAjfkmp0ouugtJNJckrj+30SJo8iHduYNVohQO SAqhoI+Kh4OycJKET9CqHkJ/0Inx6xBtflyukXKyB/s0IKaTuC/1KKpyPNwRYFPNvo+V 7cqoTA4/8MixlsuqAoTbTj0BEPTy4N/m13i6f/N6dMotxHuHhtj2of0JAFbT+Csgj7Kq duBHOOfgUu+3FycccoiBllCl55tPQsb8DTzoO8EQezhVAcGrJyskJCsbfyp7BHFeiMAr e6cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=JSWnxyc6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p18si16040938plf.430.2022.01.24.10.51.06; Mon, 24 Jan 2022 10:51:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=JSWnxyc6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242194AbiAXIYG (ORCPT + 99 others); Mon, 24 Jan 2022 03:24:06 -0500 Received: from smtp-relay-internal-0.canonical.com ([185.125.188.122]:58640 "EHLO smtp-relay-internal-0.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242158AbiAXIYA (ORCPT ); Mon, 24 Jan 2022 03:24:00 -0500 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 9910940051 for ; Mon, 24 Jan 2022 08:23:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1643012638; bh=bto/xpfUsOVGNmCnHot8/BAzxWmx4lezX3yYM6aPOPk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JSWnxyc6Ynxb4pzX0DEiloksdMGeHVH6a9RN36NM0CxF6rmsONQ+hL2l9dBHMFvjB z6JSuTDgV5/BKMd1xaTWFZK1rPg2NhY4OhzxdCqTYvI3Og0fVfnzpwcon8qI397GjX iK9t4+pMFlgIwuYpspxZ7nUKciXf11UZYK67XL5sEZLgiPP02j+BBixUbYnjA8aJUs z0j7L8lKXGFADXh6fAMbEZDzJWe6YxFdP+I5LFJKRCK7BywQfIGhKAXdicexuhs7tA sNekQUWlnhnJeA24NqgDOwaXGtYXHEGwasAA8yeT93d5s87JDZRCGt4QZfMWAE6uyy aVoeygH+Oaumg== Received: by mail-wm1-f70.google.com with SMTP id m127-20020a1ca385000000b0034e992a94a8so1708211wme.5 for ; Mon, 24 Jan 2022 00:23:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bto/xpfUsOVGNmCnHot8/BAzxWmx4lezX3yYM6aPOPk=; b=j2RpaJx7qwo7wL8VjVDirBqVCwbo+XeP86GcJUkfpBVFbdCNX7iuuCNvg+WQ1tjKL7 Xl/3MYQWj12UYIUAe0He+juX2hTJgtnVOA9guXMORXj1rFTUeEWpeo9DOvc8KHLPNY+L Bh5SYaYkvm+vLdS0iwmzNk4NKM0Nzz/fkuJDy36KETmg6Ij7inpPt1OHYNSiLGE2SlxZ l5eQ5Q2NfzAik/x7Sl1NF2ghpE7Vg/ccYJT+Y7XQ8H6duZcKvfiTGtaGqxvTlSIWcDEU tliAhPm3pJj6lTV99jLBFK4xW2g/Zxdmup+NyvuzYNzOaU7iAUFCetHw//gc58C5LIt4 PeLg== X-Gm-Message-State: AOAM533cdZZ1wy3wOoX+R5FZh6NfXdf1oB5N0f53wSH10wqUD2KPNuZJ VNJcLduZa0Yw7abT9fnuIWRpGcKcp5nlizTmEn6HE/IdmEUxp4W8c7LSFQWnI/bhCWr/k/RRLvS n/HMOrQuwZ6eBG4U/dBsXLE2rSxoFAN4NFSgWtt4UFw== X-Received: by 2002:a5d:64c1:: with SMTP id f1mr13620184wri.214.1643012637896; Mon, 24 Jan 2022 00:23:57 -0800 (PST) X-Received: by 2002:a5d:64c1:: with SMTP id f1mr13620166wri.214.1643012637710; Mon, 24 Jan 2022 00:23:57 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-168-84.adslplus.ch. [188.155.168.84]) by smtp.gmail.com with ESMTPSA id m64sm7148550wmm.31.2022.01.24.00.23.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 00:23:57 -0800 (PST) From: Krzysztof Kozlowski To: Lee Jones , Rob Herring , Benson Leung , Guenter Roeck , Krzysztof Kozlowski , Alim Akhtar , Andi Shyti , Mark Brown , Sam Protsenko , Pratyush Yadav , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-spi@vger.kernel.org Cc: Rob Herring Subject: [PATCH v6 4/4] spi: s3c64xx: allow controller-data to be optional Date: Mon, 24 Jan 2022 09:23:47 +0100 Message-Id: <20220124082347.32747-5-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220124082347.32747-1-krzysztof.kozlowski@canonical.com> References: <20220124082347.32747-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Samsung SoC SPI driver requires to provide controller-data node for each of SPI peripheral device nodes. Make this controller-data node optional, so DTS could be simpler. Suggested-by: Rob Herring Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Reviewed-by: Andi Shyti --- drivers/spi/spi-s3c64xx.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 8755cd85e83c..386550fca81c 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -796,16 +796,14 @@ static struct s3c64xx_spi_csinfo *s3c64xx_get_slave_ctrldata( return ERR_PTR(-EINVAL); } - data_np = of_get_child_by_name(slave_np, "controller-data"); - if (!data_np) { - dev_err(&spi->dev, "child node 'controller-data' not found\n"); - return ERR_PTR(-EINVAL); - } - cs = kzalloc(sizeof(*cs), GFP_KERNEL); - if (!cs) { - of_node_put(data_np); + if (!cs) return ERR_PTR(-ENOMEM); + + data_np = of_get_child_by_name(slave_np, "controller-data"); + if (!data_np) { + dev_info(&spi->dev, "feedback delay set to default (0)\n"); + return cs; } of_property_read_u32(data_np, "samsung,spi-feedback-delay", &fb_delay); -- 2.32.0