From patchwork Tue Jan 11 10:13:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12709677 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 DA073C433F5 for ; Tue, 11 Jan 2022 10:15:34 +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=XRJsyp8OhYco2BLG/fpa28HHa5uCB/VDgSkYUGOUf8Q=; b=G4AksQt5WqOaN/ zrCSaA4TMCIUuHy468HChufW3iENzK7FQqi68AcG442u9tCw8uw+NA98Sb3H+0IV2CAmxGB7VNjZo 2nzbidzYpvZw5WuNhWddN/mceETiXOvVVfo+TxHJsL8SgIqjg78+m5sdqKX1RjjL/Myc3FvG6ebvU ikMIx3wgXvW/nFJv8L489oiP4I3VZQAbBUNKQIFy4yfrEK/ylHjIkGsKwX9xClYqTx/BZPTbTIVki GWr+DP02PLr78KLL249+yVLF6ZxnJM6UF1U8RDVhowIBnxFymDNgplrSvb5CaHU3nwCxYh00KLNiH ClF8+JoJpVe70BPFrv8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7EAc-00Fj2v-5t; Tue, 11 Jan 2022 10:14:26 +0000 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7EA4-00FisJ-7o for linux-arm-kernel@lists.infradead.org; Tue, 11 Jan 2022 10:13:55 +0000 Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (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 094C64004C for ; Tue, 11 Jan 2022 10:13:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1641896027; bh=vkZ3shAsrts82aZQTD9Odzm7oGr7rqF0WKQDjTKTwd8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=AsSy6TnxbEX9P9XkYo75tUEdzUi/QNUnxZtzQQaEXG6LEu4gKkiGy4eVjmoLUcapY 6WhAAT6NaSssf2deKGqTP5U5jZYXk7hhw+U/cJS+iv0P+ORut60tC8iyd9b5uapSPx kVWatiiAuxpf2eDOocJu1vVSgr6/QMbI4b9BkHbdOTPdWLB9QdvQR4T2ljnq+hHq9T y5UOgs9lYQmmXx/3HWNlKNS6WOSjr84AFsVabhwUoHQS1AkBkX1MDXWF83j6I+e+fW ocYfMXcQcrWTUjQb/Dn1WtERIg3u2lBlYQTU/ZmKWTLIy90/yagUddaoF1XJH3iLbE Lt5i00s/sOUXQ== Received: by mail-ed1-f72.google.com with SMTP id b8-20020a056402350800b003f8f42a883dso12849042edd.16 for ; Tue, 11 Jan 2022 02:13:47 -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=vkZ3shAsrts82aZQTD9Odzm7oGr7rqF0WKQDjTKTwd8=; b=7KGPm4P3AlHfsC5YHsiHDNqzGScaxPQjXtmg+4lr4cT7WZA3jYj2aUlxrN2CUogYhO wCgtDxxbQnxnksJNjkkkYKUPmpuu++AuLQVktI/gRlLSG10CaFdtLfr+Kc2sZEBI19I8 cOv9pi1NqvQWAkJ5VoiHgL5OqQkedIy+IOCehQ0obmPkl2dF9qS781EGf06tYsL+3NkC Di+Hwvr1XZN2cDsy6YtiOfUk5tRzcXufIZTKHgORQ/GA7Mq1+/CR5wOUMWZRDrBQpdKY ECBbYhWm9W7N2/SzTbDsAAuPmB2AYK7T2Y3oK8XY+Sz7P3vDtV76cd21gMX+xSc/x417 Z+Ng== X-Gm-Message-State: AOAM5339b4WjforRjFlp+VFiB6ERdoXZ34ezOrnV8q8mi9rJeypX1j8H P87pfu+dszS2U8os+FX30xvVbcs+mpyqWTDNr70RRvRAJGtAPFBoS8Qc2r9s/AaWTMdGDC/sH2g 9QZhmz35d8XpPfbbGeBu9dlsZ6SEM0RbtxjmHr4fj0IpU47cQlmyn X-Received: by 2002:a50:da48:: with SMTP id a8mr3517610edk.155.1641896026737; Tue, 11 Jan 2022 02:13:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyrMWwC4F5CYCPwNtrsTc93H/KSEUuKQ3dZ2KWyqGsikQRFJIiGNhQmyHnezI5HUpc6kJMojw== X-Received: by 2002:a50:da48:: with SMTP id a8mr3517597edk.155.1641896026571; Tue, 11 Jan 2022 02:13:46 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-168-84.adslplus.ch. [188.155.168.84]) by smtp.gmail.com with ESMTPSA id 26sm3431268ejk.138.2022.01.11.02.13.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jan 2022 02:13:46 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Andi Shyti , Mark Brown , Rob Herring , Pratyush Yadav , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Sam Protsenko , Rob Herring Subject: [PATCH v2 4/4] spi: s3c64xx: allow controller-data to be optional Date: Tue, 11 Jan 2022 11:13:38 +0100 Message-Id: <20220111101338.58630-5-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220111101338.58630-1-krzysztof.kozlowski@canonical.com> References: <20220111101338.58630-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-20220111_021352_442793_39CA3FC3 X-CRM114-Status: GOOD ( 14.28 ) 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 --- 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..769d958a2f86 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, "child node 'controller-data' not found, using defaults\n"); + return cs; } of_property_read_u32(data_np, "samsung,spi-feedback-delay", &fb_delay);