Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2913141ybz; Sun, 19 Apr 2020 12:47:13 -0700 (PDT) X-Google-Smtp-Source: APiQypJ7iWc1PR/kO7Zdo4oflTLMYRZQfNvwbjk7Y/kz7k5/qrez/+g6ll5WQ3/cm0fMFmE346rU X-Received: by 2002:a05:6402:391:: with SMTP id o17mr5578063edv.71.1587325633495; Sun, 19 Apr 2020 12:47:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587325633; cv=none; d=google.com; s=arc-20160816; b=rcY27ZuQQrYyMRInYK+ahaBt8/iAZv8Ug+8QAyjHvy4ViQGGSdLBkOlHBUSKWAl0EK 7q/GCJCBZJuc/l64tVpRYYWZpwvkHFAh/E/lvDBygJUB47P89SncU76s71ljwC2ehVtm L9XqwagiQicgtBbPG9Q6UwVxpRPcGbYsyDBxRn8fHLUIhHdwT2y8dWxm2Sv9VjwXbO2Z 0Y5HXoHKrkh4BCUVtkV8/QqJOrcfORQSoSzRzdlXYRJZ/vC/veMhuR/AkYnj/kEL69a6 mTj/LRij12menXRlwINp7kdvp04C6T8YbhfzX0ojjGoHZulAvBawa9MGBH/rHUiy35ki o4FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=MryED8uai1n3gclYsGl5qk+GTHUCazZ5O/sEZ7i7aTw=; b=gtqS6GfFvcgtKlv7205Z8y9+XL0hjviRJfb2wUQHXnTD9838dL3321sXPFGxm1mkyK F8JQxvoa0/GemKoX1MpvfMHm+kzKwaY0Sw5XvjiEahQKx/HlPhgBigiBkTNVpd5ALywV 1A/9U5QvNnpA1DnXNmfK2+1IEkFB1fCrtg8JE1R0R2+Zxnk4B51E+3Z4k9BZ7R5jWMD/ xESgKlyXCUMV3KWhuJvVG+RcQh5A1CJsxKxLiMhwjCxP3NeiModMuxUEaW/KON86ltFC VJkPcxmW9aKwrwbYj++HKsxU23zR0dc7gu1JV+SKTbPL/uT9S6DrnMNZZbgzOed4Quvq 57zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KHrhNz9e; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g15si18528639eje.418.2020.04.19.12.46.51; Sun, 19 Apr 2020 12:47:13 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=KHrhNz9e; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726296AbgDST0O (ORCPT + 99 others); Sun, 19 Apr 2020 15:26:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726022AbgDST0N (ORCPT ); Sun, 19 Apr 2020 15:26:13 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4822C061A0C; Sun, 19 Apr 2020 12:26:13 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id x26so3945351pgc.10; Sun, 19 Apr 2020 12:26:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=MryED8uai1n3gclYsGl5qk+GTHUCazZ5O/sEZ7i7aTw=; b=KHrhNz9eW2SEE10dN9YUDkj+Ug7Reo0bS49H4hagifMITN32wf7w38RTWZh8FgBLzp Ze8EXPb7NdEYMbBLJlMO+wc+CfhSvGJ0NM3kdOa7K1ttzItHClDETecWsi/eQ2UGGA4P eQpxI+w+bRUKdGBkKMTOGPU/r6sVcZJZ3mZ11jpIQZzXmFBQim0yemDodqOGOz3+n49J u1oDBQYQHRunfftqt/321rwt4f2d9RabY8OdJe+KpqEanDUlv2WBq64eIRiIRHYgixgd abjoJwce/1rVuIxVG0w0Jo3WwM5AwgMNPKsqdwCFfMlDIqMbvY2gYx6etyhTvfdgo5C5 lvyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MryED8uai1n3gclYsGl5qk+GTHUCazZ5O/sEZ7i7aTw=; b=RpEFTTdj9108n/uvKfEOnzXKRPH4qdkvWwJ6B2YDYWZ4lBJzSSIF+JqrBYDJQUOjCR tirZ22SPszYEK3CCDufTZZesZ/Ye7M3euFT6krby9mC4bVLbqRJvq4nMU65Pk0bogTRi hs1pCNCdd3eht1rWiws1B6B84IXMHggsafYkOmLL0zg4BiyDxIfTswTFwoRdpgnmw91L 1IElPgFShe/GQcOxDK7Sbzlg9TDub2VFr9JRqH2wthTzUmAfoINmJA1WqCjgu1TcCGKs YfHXat38d06M38RD3R5S2N0ZW9IOSazRHVbZyKkMAe/JuYb01pEcyfQcNi8sRVPIy9NF 5BBQ== X-Gm-Message-State: AGi0PuYdjhAbStRIdYC0BpFqS1nPIfVphc2lBCPJ7lunYaxWvHFLZ8WD frcIYYD1WAgYQibEOyqKXE4= X-Received: by 2002:a62:5b02:: with SMTP id p2mr14019001pfb.14.1587324373535; Sun, 19 Apr 2020 12:26:13 -0700 (PDT) Received: from mail.broadcom.com ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id x16sm22724383pfm.146.2020.04.19.12.26.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2020 12:26:13 -0700 (PDT) From: Kamal Dasu To: Kamal Dasu , bcm-kernel-feedback-list@broadcom.com, Mark Brown Cc: Florian Fainelli , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [Patch v2 1/9] spi: bcm-qspi: Handle clock probe deferral Date: Sun, 19 Apr 2020 15:23:30 -0400 Message-Id: <20200419192339.32023-2-kdasu.kdev@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200419192339.32023-1-kdasu.kdev@gmail.com> References: <20200419192339.32023-1-kdasu.kdev@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Florian Fainelli The clock provider may not be ready by the time spi-bcm-qspi gets probed, handle probe deferral using devm_clk_get_optional(). Signed-off-by: Florian Fainelli Signed-off-by: Kamal Dasu --- drivers/spi/spi-bcm-qspi.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c index 23d295f36c80..74f4579c3f6a 100644 --- a/drivers/spi/spi-bcm-qspi.c +++ b/drivers/spi/spi-bcm-qspi.c @@ -1222,6 +1222,11 @@ int bcm_qspi_probe(struct platform_device *pdev, } qspi = spi_master_get_devdata(master); + + qspi->clk = devm_clk_get_optional(&pdev->dev, NULL); + if (IS_ERR(qspi->clk)) + return PTR_ERR(qspi->clk); + qspi->pdev = pdev; qspi->trans_pos.trans = NULL; qspi->trans_pos.byte = 0; @@ -1335,13 +1340,6 @@ int bcm_qspi_probe(struct platform_device *pdev, qspi->soc_intc = NULL; } - qspi->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(qspi->clk)) { - dev_warn(dev, "unable to get clock\n"); - ret = PTR_ERR(qspi->clk); - goto qspi_probe_err; - } - ret = clk_prepare_enable(qspi->clk); if (ret) { dev_err(dev, "failed to prepare clock\n"); -- 2.17.1