From patchwork Thu Jan 20 17:57:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12718940 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 454F2C433EF for ; Thu, 20 Jan 2022 18:00:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=F9icU3ebQjBEKGo7CyoA8uhWd14eqkqtqx8wPaEdUxc=; b=PcECluLaJkIbCZ u6ecGky1nJ8iXeUBKHNOM51E7106UhJVn0IUPznGOj/veEc9pd7MiSb0GKOVZv8Xx3kXbvO+jMGdh bAcQa+kF/jR3iz/FiiBHhB0rEeKVdDiufAdtnGYlt85LNiVw6aRFiQ2AD8JpM2TgqIJ/hfyvRCiNS 9ZHTo/yu4AM05LwDRGyFiq1HfgOs1cb4v8zHC7bfALMcPwKgDLfnUeRZkUl9lSLuImHqB2PPLVi60 +gfAPZHU5Ci2/x9ZSQ0at75ywk70klHfC/gSKty618LvC3HPwz1Wi5nAd/B1QMEl4Z+A2rmfH0EKa q1LG0p5dWDwRpJbmQljQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAbhl-00CgEO-Rw; Thu, 20 Jan 2022 17:58:38 +0000 Received: from smtp-relay-internal-0.canonical.com ([185.125.188.122]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAbhC-00Cg3c-VI for linux-arm-kernel@lists.infradead.org; Thu, 20 Jan 2022 17:58:04 +0000 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (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 0A6B53F1E9 for ; Thu, 20 Jan 2022 17:58:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1642701481; bh=bto/xpfUsOVGNmCnHot8/BAzxWmx4lezX3yYM6aPOPk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=vhcDZZRFEmkY22c6I7rDHDL1V+VoQMk+AkUsg7tRkTtgS7i5bTgxltllAirbqj0aB onvYTPf7zzdO1IUmOX778SJ/I5c4fEoefhVdkt6DtjwMFin5NM/W75vACwUJT60JVF dfAZ+xddDrgcuKNn5MVP4rNGW58wrH14yi6SbRq5Lj6gFpI623GBdipUp1w+lLRzV9 LIu+oiFDhdo7ievbKBKwayvSDvEl4+1Gf2qkm0+yNs7JLkTFQa3mrO0IYLT0DyugJ5 P/B9eMHnZQtjnDH+XH4iklSCvP82IFUAVt7CGSj6N34KmiqKDoG4bOVhNqb7KDxIdh Kf2MBL/ycgarA== Received: by mail-wm1-f71.google.com with SMTP id b134-20020a1c1b8c000000b0034e0874e828so1461342wmb.4 for ; Thu, 20 Jan 2022 09:58:01 -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=O7/9XS/9ikOpSe9I7wwI3QhLoLUJYGlPq/DLCNsgkq18A5IMrnaUqf0+v9MpfOqpIc nYKO6R2nJWrvukOg2wFlnJZwtKHkV9xQpQmd4DwucDXrevCjMqzytISJ53Bc1U5Ej30I E42z1Q8Tqb9T5TZQD+N/8g6H1AYaZjmlxodq6kJWs4jr4I68Ehg0EY/DUcHrAWmbSGxJ oCOmN3dTmibitRwRN0CvC4b61dgE/NtYxNexu9tsqUhzndrBVgheADRLQd5tgJsNpnan XXW1DODEUatjlR+HcsS5uPUXV+NYJIHyD0si/1brS4pmmlPskldIfsG817DofsNgUB+z tbCg== X-Gm-Message-State: AOAM533gL5VaHnI6qDIYQt0hqIcf4AxrUb8GveRQFf08iusWtM0xhNK6 Wu2FZV68Vmy6TVLCgF1vHzArgJXdxKJ0bzPauM9uu81fZr1Gbd76Xhyt1HAWgIxKjAOqVGIxl4w G1HdF7mSJvUogdSCHFFEdt0EUe5ZMAY591VAO4GHe62nkTy6sfN9+ X-Received: by 2002:a1c:f012:: with SMTP id a18mr9989438wmb.73.1642701479319; Thu, 20 Jan 2022 09:57:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJyqTIBDSwhzIJAAvThOjafSh4STpzbcmwUKvBnw8h3aAFohpEEpbyymlmGUkzLSw2lwFS1cZQ== 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220120_095803_177483_A372C337 X-CRM114-Status: GOOD ( 14.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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);