Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6364993ybi; Wed, 31 Jul 2019 13:03:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCCs1n1Z4kRK/h1SzrieG55Yz0hdX8hKopcsGFi5TqqRxXzpPwskW4daEGXrMVT9U3qvEj X-Received: by 2002:a17:90a:1904:: with SMTP id 4mr4729076pjg.116.1564603380602; Wed, 31 Jul 2019 13:03:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564603380; cv=none; d=google.com; s=arc-20160816; b=nk0yJm/2ZBJlR1lEpr9/jtox6L4nb0YcnREfAVDDbZgl4qxqEgV+eb3YgGfz+87bbU hS/D+uCW7rTbgTU9nllF6ZIEbsB1z7PGfzjzoC+71oteUHZKsbFtMgw/HzUvoaivR4Sk uIJG1lDUmYwCAvW8ycNEmf2wF+KOTornGdJ9MSFeKHqzi5Xq2mE8IKHTVj6QXFVEBrsl dzU7NTqOi+KKD2LZlOjpwsOqRJWhFUSVG2r78NP+UE9re2dfp+zWlZdWWzDTaZazy8T2 ETNVkgtTDkK4T22mGxv+Z1gl8ssaagRAHj1xBAGsaEVeTWOEpmzmi35AkWfPODxESKQe 8jnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZVenT1gHP2R94WBk0kpMRzr89oe7rSkG+umYVrTZR40=; b=XYY0ZFvUqciYTsYe6gu2PS+ZO5wx2DSBGfchbpJnA+ObMSDrz3Xhj8E/+hx/R+KcAw d9O+mfsmelSkJjUQdQzNnDqwrMBfi1N49XLF+NI2LDxL5anKQT9U+j//5hyj4HzyXvFM JbtZiSI7sNLcY8oq8T3Lej58wsfugWFhxKar8duPmhE7TcbwrjoKh14UDHgSMouvY2Dq Ak8dn/JPG6TAGNhPMGs5HC+XAV1bK+TLzyGLdKjhKAy5AzJ8DEQw/0mM4uMIKiGc1yFp 41XAvrtvkZT5Weudfs9EQ0tq/ms1UxXTMCzLedo1WQg9MAg3WSAZYYfDEcnA2DoYk5Kv Ublw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="L7Yrh/vX"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g4si2256759pjt.70.2019.07.31.13.02.45; Wed, 31 Jul 2019 13:03:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="L7Yrh/vX"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730576AbfGaTfs (ORCPT + 99 others); Wed, 31 Jul 2019 15:35:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:34876 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729737AbfGaTfV (ORCPT ); Wed, 31 Jul 2019 15:35:21 -0400 Received: from mail.kernel.org (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B23B4217D7; Wed, 31 Jul 2019 19:35:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564601720; bh=HfN2MQysfM/pLD5DmbpZ0LVsnJDMstZJe8ye/rK0+DQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L7Yrh/vXryB3bAXc1CeV3+7xXmKVJOrb7RdSzBnKcrQk3zCAqWM8DXukbpi6MUXR6 GN8I9zssC2xz55HDCiKSuJIzeqj6pcvQ0d6itfiRCk48OUY/Ln+eiuitXntGp95Ul7 6gmNP47EnDr4iCHM935am3Xh3zQvhS70M9RqqKf4= From: Stephen Boyd To: Michael Turquette , Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Chunyan Zhang , Baolin Wang Subject: [PATCH 7/9] clk: sprd: Don't reference clk_init_data after registration Date: Wed, 31 Jul 2019 12:35:15 -0700 Message-Id: <20190731193517.237136-8-sboyd@kernel.org> X-Mailer: git-send-email 2.22.0.709.g102302147b-goog In-Reply-To: <20190731193517.237136-1-sboyd@kernel.org> References: <20190731193517.237136-1-sboyd@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A future patch is going to change semantics of clk_register() so that clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid referencing this member here so that we don't run into NULL pointer exceptions. Cc: Chunyan Zhang Cc: Baolin Wang Signed-off-by: Stephen Boyd --- Please ack so I can take this through clk tree drivers/clk/sprd/common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/clk/sprd/common.c b/drivers/clk/sprd/common.c index a5bdca1de5d0..9d56eac43832 100644 --- a/drivers/clk/sprd/common.c +++ b/drivers/clk/sprd/common.c @@ -76,16 +76,17 @@ int sprd_clk_probe(struct device *dev, struct clk_hw_onecell_data *clkhw) struct clk_hw *hw; for (i = 0; i < clkhw->num; i++) { + const char *name; hw = clkhw->hws[i]; - if (!hw) continue; + name = hw->init->name; ret = devm_clk_hw_register(dev, hw); if (ret) { dev_err(dev, "Couldn't register clock %d - %s\n", - i, hw->init->name); + i, name); return ret; } } -- Sent by a computer through tubes