From patchwork Mon Feb 12 20:11:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 10214385 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DE24C60236 for ; Mon, 12 Feb 2018 20:17:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C78A828CC8 for ; Mon, 12 Feb 2018 20:17:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC05F28D24; Mon, 12 Feb 2018 20:17:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DAE4728CC8 for ; Mon, 12 Feb 2018 20:17:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=bS/wSYltAhbxcdYJD0+HQuMe8WAXZyB4/Zl5pBWnYyQ=; b=YzZuXTZLTowaOzx4vKJ4V9CX1K yfE2xc/94knAcH5wcexpUiLlaWU/aVrFZu8SZy2EdsuvlzPQXoj3HqerKidtufxkd/+rh3N9HllW5 DgFptG637JrVFWPTzniDHPqFEx+ZejmQGCNbv/7Sy0FYfBf8Zh1zdBO3ueOM1KRnMhEX1a8BbSp6Y MQs+IGlIfgYd4u/di/747LoezPZd51nxXQlUirMVbOnBK4fLwu1F+cb05ayTMGMJFAWIbqwddubg4 pJ/77o83cV+Wb1wL/NvhzR18GyF+77xSUTe1Ct2ikqIOwrwEjZuXRq2GT/WTd+yhI7nUk+LhKonli nr5yAMvA==; Received: from [198.137.202.133] (helo=bombadil.infradead.org) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1elKXE-0003iG-J8 for patchwork-linux-arm@patchwork.kernel.org; Mon, 12 Feb 2018 20:17:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=bS/wSYltAhbxcdYJD0+HQuMe8WAXZyB4/Zl5pBWnYyQ=; b=Kui ZN3QJBnDbpPD9lQoQJA8AZazZqB5Y90cdfWO7lcULoSaIQ07jkZUiOxN5Ev0loZdYBzfXbOnP2PyO IOcfGavZ2zUSLAHHKa03PBBnFnKSyqCtUWn5NtqHIXAZlVE0Dg6LKg6kkIWOQQBbC0vZE5XdWzgeP vW/dhUXnq15gzfZmtk4Gw+gJ/388qwvK5bkEgTgcaNgxCBt19wVDnHW89gtcDNZeXzXfITn//N4MM /g7RMsFippveFmZ/BprL72IjZ9H4kQpwR0UJVsX1KXDWXhy9EvzYx2yLYY+9rugYFSMV+JnrYwcgZ CAUJ5vQQ5y8Nlv26BaFirsMmsb18YbA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1elKSk-0006Lr-J4; Mon, 12 Feb 2018 20:12:30 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1elKSh-00061W-FD for linux-arm-kernel@lists.infradead.org; Mon, 12 Feb 2018 20:12:29 +0000 Received: from localhost.localdomain ([95.90.209.156]) by mrelayeu.kundenserver.de (mreue105 [212.227.15.183]) with ESMTPSA (Nemesis) id 0LdEVV-1eKU1z2Zk1-00iSFD; Mon, 12 Feb 2018 21:12:02 +0100 From: Stefan Wahren To: Herbert Xu , Matt Mackall Subject: [PATCH] hwrng: bcm2835: Handle deferred clock properly Date: Mon, 12 Feb 2018 21:11:36 +0100 Message-Id: <1518466296-30161-1-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.7.4 X-Provags-ID: V03:K0:vnp9onN8u+aGGwH4Y/ZrQf+kzyVU4wxcBnaJSPZhIlNyksdsEf1 +JhW+lcN6FtCeBTe6ho/HAuwyLcdaxKVMf3FsNUrYSocy77/4W6iEBVaMIcn8oEdZdJ8XXp cFO4EDVmtn8YTD+DBhPd3K56shd/xcewFwmEExpgcgUvHHJ1aI9g2+FS6pdUL9wXAQUxAgW G5A0cDH6ZqQOPzaUOMIag== X-UI-Out-Filterresults: notjunk:1; V01:K0:WsilQ07Ghf0=:nuSTz5Gns/uQLF7r/2QIwr XdKmGnJhC68cGSksh0yy7sr3q41TIwsKFdnlSYNA6UEF+Rl7B3S02YtNa3xpxHSPI7vehbOpN uUcuGQAjS0zgVMvJ2X64jTNi2pbqohmuFOOeuvT6k4ywWjf7MaGCdeZN502vqHG2bvI/i05to kQPJWF/KjFJXvO1+g7aInCCaiTzC6wzZp11FCGZh4hWUk7JB7F25rU1OxwtK/BTdlDCvJ8fMG 9EOCGjbsK5y5YNQOtrU+uibcuzR/PZVgI6M4LHrVfLWrixVDxsPEqlUNwcuwuTzRik9lH62ru MVC/mev9/DDQ3Uw1VSIxlaO6Gfr4UFCYjU+CjZ2KhlkDWsrMuyXhSx3Xxka//fXnxYwG2ICPH AEw9HhtUz1Vry5mGTog7Zbdr0TWvolfLtr4jYLrMQ9FyAY/0fc6VnK5qh1YZZIwA8Em2wtDQb jwCNdXtKjTcYNJpz5LKPNF+ARWdSH/XQDP68GCXxZ1haWt4OYSKWgCQrD7mWh15evbPxaAgAp TediePRNZOe7MWDq96GqW+bm+hr5zPTtFB4oct9lvHxv7GBY0UkxBaAQKIHLxzvMgIBIa1qo4 XxdbhZy8TLGlPX1ErxWcgKdq3OWXRUxXoL6AoTGBBl4xpsKjfxBpq8NSQewRMUYQ8Q8KpGPXp oCst0LUEGSRjI/9hK91vRcTB4afeX/0WJlcn1WWr9i0tmqcyMONRGjmrTQ6Pf/BwCpxTARkhd D8dqi6Wn9hUj14AwmDPQZXVbUYabob5ixjvYjRpXh5RXonxiWmUGuJ9eQUk= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Wahren , Florian Fainelli , Arnd Bergmann , Scott Branden , Jon Mason , Greg Kroah-Hartman , Eric Anholt , bcm-kernel-feedback-list@broadcom.com, linux-crypto@vger.kernel.org, Ray Jui , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP In case the probe of the clock is deferred, we would assume it is optional. This is wrong, so defer the probe of this driver until the clock is available. Fixes: 791af4f4907a ("hwrng: bcm2835 - Manage an optional clock") Signed-off-by: Stefan Wahren Acked-by: Florian Fainelli --- drivers/char/hw_random/bcm2835-rng.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/char/hw_random/bcm2835-rng.c b/drivers/char/hw_random/bcm2835-rng.c index 7a84cec..6767d96 100644 --- a/drivers/char/hw_random/bcm2835-rng.c +++ b/drivers/char/hw_random/bcm2835-rng.c @@ -163,6 +163,8 @@ static int bcm2835_rng_probe(struct platform_device *pdev) /* Clock is optional on most platforms */ priv->clk = devm_clk_get(dev, NULL); + if (IS_ERR(priv->clk) && PTR_ERR(priv->clk) == -EPROBE_DEFER) + return -EPROBE_DEFER; priv->rng.name = pdev->name; priv->rng.init = bcm2835_rng_init;