From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6F95C47096 for ; Thu, 3 Jun 2021 06:34:37 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6AB2261263 for ; Thu, 3 Jun 2021 06:34:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6AB2261263 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B41B682FB8; Thu, 3 Jun 2021 08:33:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="tDaIwtZq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BD19782F8E; Thu, 3 Jun 2021 08:33:19 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CA51782F3D for ; Thu, 3 Jun 2021 08:33:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kristo@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id B8767613D8; Thu, 3 Jun 2021 06:33:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622701995; bh=G750EkbEzWQBZU09YUOP3Ngg3RvWoibJJiGlf01ijq4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tDaIwtZqLH4VT4YtnhlcVhR5vtaYLj3kdebtB6cB2WaihlS6I0YnrJXWqZ8kc/VJW 5gNJCdUMeMJUM46C04/4c7fFUxXTkYTJW54FglFcHTcCrl8dBa1CAJVwvH1+1DdXUw J8ybX43WiQWnqZAYz+WijXIajwU3wsH7AzCKN51Z2vy9uznwXqwDMh1cSd5uRVHHcq djfgNNyzupg2TdWz7mQDZ9Tj1S0y9bntsbNO/jh8p8a2t6qLFIHInlZW+Wv+dTSECo I+0S0pP4q91ttBB+GTp71zhffSxcV/5xGzFdTdhZzQpnph0qGSxx0JCUovp0hXueFg CBcXSvqLKwrGw== From: Tero Kristo To: u-boot@lists.denx.de, lokeshvutla@ti.com Cc: trini@konsulko.com Subject: [PATCHv5 07/26] clk: do not attempt to fetch clock pointer with null device Date: Thu, 3 Jun 2021 09:32:36 +0300 Message-Id: <20210603063255.5483-8-kristo@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210603063255.5483-1-kristo@kernel.org> References: <20210603063255.5483-1-kristo@kernel.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean From: Tero Kristo Bail out early if device returned for the parent clock is null. This avoids warning prints like this when doing clk dump: dev_get_uclass_priv: null device Signed-off-by: Tero Kristo Signed-off-by: Tero Kristo --- drivers/clk/clk-uclass.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index 53e7be764d..451d7da001 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -502,6 +502,8 @@ struct clk *clk_get_parent(struct clk *clk) return NULL; pdev = dev_get_parent(clk->dev); + if (!pdev) + return ERR_PTR(-ENODEV); pclk = dev_get_clk_ptr(pdev); if (!pclk) return ERR_PTR(-ENODEV); -- 2.17.1