From patchwork Wed Jan 12 10:00:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12711183 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 39549C433F5 for ; Wed, 12 Jan 2022 10:15:22 +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=gmjAAFqinyAa50 Fz794zJxcAEstnZ3SQeT8nQ4GciMufLjIdagA8+9rjUBUV1sHMDdLYotwYySVAU4T2CI4e1uNPkB/ R1tzeS1SPsD5UpvPWYMj2E2rAUs8R1p5Vfw3E4/JNYCRJ3hjZnLHrT4F3bTxqVPrH0j7n0b91ufav w7EEWz3YlL8E09llepq+MFnbw2sIfDOAb3QOzoWq/SqEIu1pmrLZYHDpEmzXFQVTR7FQysrQULYAC GBkcOIe+sfeyLRi6kXzzQZ496sEQ7SsuuF/92DxiKrFhrRewwoAGeV5WReV8/1q4+rAfc7mLSUKvv v5tWTnbkE45WS4JswLpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n7ade-0020o6-IY; Wed, 12 Jan 2022 10:13:56 +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 1n7aR6-001vS6-LU for linux-arm-kernel@lists.infradead.org; Wed, 12 Jan 2022 10:00:59 +0000 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.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-1.canonical.com (Postfix) with ESMTPS id 5076B4031D for ; Wed, 12 Jan 2022 10:00:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1641981655; bh=vkZ3shAsrts82aZQTD9Odzm7oGr7rqF0WKQDjTKTwd8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=S7HG6Oi3Xdgd9IQ6IB9xO4/FlOuXdwlL8p1wzr9IojJNAoPTeYo67CeiQ4Mm/5j0d msHHEZ4yo7CPwhZd5krDR22Iw0HHyfhXOiqZvcEQoEJWkxQzKTcFci4W94vJy+H51p eoxvOHwkhT74ZwkxvVVoS+W6bPbrzwkiU4Dnwak0G7EJhoUZw36e7W6i91NpR4vcCD 8E5bfO1LETYSLd2qNVh7GM9ye3rrzf+JfQYguNy5W8gr2o3SK2o4nlhxYQuPjd/YVI y2vjmevgk2iPzNt3rm2YzD/Y/sWoMdNvgHKDni/q0BqdlQOehu/wKWqsCIhyQBfspA 4dCcUxe13IWkg== Received: by mail-ed1-f71.google.com with SMTP id r8-20020a05640251c800b003f9a52daa3fso1765376edd.22 for ; Wed, 12 Jan 2022 02:00:55 -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=os21A4lMkyDg4RK2d6ln+3Qw8KwVuWSIC528njy8R919fKjdknAXtD7RpAAzfx08zH Uklcdib4NBTonCB8NK54ZuueZOm6XAD4CFEPkk87JNmD+6+iE1p6DoE3Ryh64NBgvr2k 0ojjX2FvG6jQHtIJ9LJ/sBfNQVlopHFIFNWozlgYbskPkBR8bTKPO9UmqFYX69O0TTs2 cULjRAFwM18CljSH525YrTuBrOEbO7BqOmzzhn8t0qh3DNssb4WTuRL1PH1B3RHI70+i vUsDPr4zh3+RoKJUKMOURYvzGGJ/b1P0mXPG703G3z1J9rKSuqEooWR0t+J3EasA10c2 vLUg== X-Gm-Message-State: AOAM533CeaKGJ/6KK86SwIzZxMGsTsbruUIctkGZ7l52RYc1Mo3l1VbG 20Mzmat9GysDl3tX9gOeEFtGwP50ZduwK14bTlKuzZdFQ3xQT+nHVxlttNTAt5TTfIBhDnfobfM M6VnkrF/tx/tSSOs5bmzuJVtMOO7X0O1a4RoNUojZUOxFpcsBwPps X-Received: by 2002:a17:907:7295:: with SMTP id dt21mr6749930ejc.453.1641981654825; Wed, 12 Jan 2022 02:00:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJxr7AHmnhL8e6o/jXCWgESvLqrOYDTSQTTXkoaFmOMriyvAZ3QFfDrNia5S1pL4Lx8Q/Cv4WQ== X-Received: by 2002:a17:907:7295:: with SMTP id dt21mr6749917ejc.453.1641981654645; Wed, 12 Jan 2022 02:00:54 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-168-84.adslplus.ch. [188.155.168.84]) by smtp.gmail.com with ESMTPSA id hb11sm4311083ejc.33.2022.01.12.02.00.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jan 2022 02:00:53 -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 v3 4/4] spi: s3c64xx: allow controller-data to be optional Date: Wed, 12 Jan 2022 11:00:46 +0100 Message-Id: <20220112100046.68068-5-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220112100046.68068-1-krzysztof.kozlowski@canonical.com> References: <20220112100046.68068-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-20220112_020056_934776_B47C1A09 X-CRM114-Status: GOOD ( 14.36 ) 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: Chanho Park Reviewed-by: Sam Protsenko --- 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);