Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1289572pxb; Fri, 21 Jan 2022 14:29:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJzCNQ3bRPcFrVK7bmy/FiSSRe2OILJucaX6qJASN5m6N8dFE/Im90foZLseRSuTYDjT5NZa X-Received: by 2002:a17:90b:1d8b:: with SMTP id pf11mr2686311pjb.89.1642804152510; Fri, 21 Jan 2022 14:29:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642804152; cv=none; d=google.com; s=arc-20160816; b=YEh1q1WOKi8GGdLualK7xnsMjlZZxOqC1inKj0LgG+ZPrey9jlpF5duCplF4gsG1xa uIbKnNzAIWon7pPPPVJpSan8lBkYBHByQWoOiBkMMlwo1rwqHK5oPt06UDZdHDvLN4JF Qf2zqSzX2n1d7mZm1Pin4p2dNSlG96kMgNDyWfCidgg0zBYRj7R4kWUSMfXciiievjxt zYRQWDO3ck4R4bK/uqai2e3iIRN4Uv0Ejd5qPllvQcjYGBfbj/Nnbf6bbtJRjGFjj3OQ WkIT9e67S18JPKy+UCZm2dw628OYCIpXJM3PV7XKAnH8tRT0vt+WesqcscqHQHI1SPdC oQ+Q== 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=RbXNSEbVws5FL5Ni0pAcUmVq92JzaaJd0+u2EMqhPH7Xn7Brg7IS3/qu/webhzZBYN bebot7AFr3lNoOHcluVJtYyJJ4C1aqTrJ7Gv1ER170Qtzyw3P/jQSSfdlWotEtelT0EZ BbTzD3/3NHvrEtcv+zg0sD07PrdHHp6xMhxgyjF4Ki+KpG4hyNHEz7rhYEG4jERUEXwp Jy1/OdkNtttdyB//Swns5BjjWobB+SNPLPEZC4/VAhmpdKSampKcRRSVENuS/jKSL9s7 IfJ9KoUZkyNYSc6OW4Hy+usiSq4IkuesPkPhTIEXU1hw4o/1wPaZUNgeFeDJs7g9lsp5 7z+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=O9Liw66Q; 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 pi3si15603316pjb.156.2022.01.21.14.28.59; Fri, 21 Jan 2022 14:29:12 -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=O9Liw66Q; 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 S233364AbiATR6I (ORCPT + 99 others); Thu, 20 Jan 2022 12:58:08 -0500 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]:40738 "EHLO smtp-relay-internal-1.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233214AbiATR6E (ORCPT ); Thu, 20 Jan 2022 12:58:04 -0500 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (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-1.canonical.com (Postfix) with ESMTPS id 7EC4140051 for ; Thu, 20 Jan 2022 17:58:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1642701482; bh=bto/xpfUsOVGNmCnHot8/BAzxWmx4lezX3yYM6aPOPk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=O9Liw66QRr3+mkQAVdt2+stflkEYRvsSa4usKn2kA0H+YFnzXd8eOOWmtkQPQSLfW MfAZzRSo+ScEBtw5H/E3HnlgntkISXrqYHMbn5prZLaEqNZbUbdH3dJdCG9OaVqJa1 ugdKlm1oyjtKinPrAFw/dXsa2YtGl5QnNukjaWbcnqlaBhfPho4/RlXqWVBHBas4tV ZL6ilfTP16eMEQWyoF5gja+JoFZRmQTdxHCPqg68FoRcNdikcW683HHK4aVSfrnEvn 3kWLIUakJ5SuPVs7KaMbW+zp5ZiFbpBKBfrtVuT39if26w3Sy27Mg2h89r22YuejOp Zviz3KoraXUjA== Received: by mail-wm1-f69.google.com with SMTP id v190-20020a1cacc7000000b0034657bb6a66so3256904wme.6 for ; Thu, 20 Jan 2022 09:58:02 -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=ZVlHuKBL+AniGH8P5LTPDNjm/FooCTkKxQmUG4tJSi2OOPrFaZaos2Kffgu+SmxzPK 6MpvZvDzuIppFITftEvSjXWrRUcUZddN9LTpuMnSIO7TQBY04D+ZZS2K62YR0pTt4+uV BhNMWIASr3F89sbEsCwYBy9YacTL7HW6O6v1i/xg3FoQCEfafKNZPdp6GnYMbs6VsLXr jFzq3UE+nHqO5CS5UqOl4f5nJBsLJTqMTm6uleCu46mxQk6I70A6fOBbhOyW6DWt3P6H VF0aMtyZc0Prdk+poL2li+5CsAtOyC1eXteWN8w5575cGxaOXDeMkA8cuikjE3bg1U/Y FSuw== X-Gm-Message-State: AOAM532ztBHOn+x5bzap6+ybIOtwTEsB4Rbo2RlNE3T0V3DaV9h8sbGo 08LG4GIfCuODjwfzwQFinzUAfWVF1m37IsY1dpiQrPz4E6GE7tVksqSwlMrTLedQPkb45kKZ12d OTExyLkNrD26E5Pf5U5HwnnvY6GzI8i/36D8csngdjQ== X-Received: by 2002:a1c:f012:: with SMTP id a18mr9989437wmb.73.1642701479318; Thu, 20 Jan 2022 09:57:59 -0800 (PST) X-Received: by 2002:a1c:f012:: with SMTP id a18mr9989419wmb.73.1642701479169; Thu, 20 Jan 2022 09:57:59 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-168-84.adslplus.ch. [188.155.168.84]) by smtp.gmail.com with ESMTPSA id a15sm3345248wrp.41.2022.01.20.09.57.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jan 2022 09:57:58 -0800 (PST) From: Krzysztof Kozlowski To: Lee Jones , Rob Herring , Benson Leung , Guenter Roeck , Krzysztof Kozlowski , 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: Alim Akhtar , Rob Herring Subject: [PATCH v5 4/4] spi: s3c64xx: allow controller-data to be optional Date: Thu, 20 Jan 2022 18:57:47 +0100 Message-Id: <20220120175747.43403-5-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220120175747.43403-1-krzysztof.kozlowski@canonical.com> References: <20220120175747.43403-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