Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5587200img; Wed, 27 Mar 2019 11:12:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqygdLapzgGuyAbFx2oxNajEsBSt7AvhYR1W9XUlBUqRFfc03ZAVHUYOrJSVgK5SHEBi+BtY X-Received: by 2002:a63:3f8b:: with SMTP id m133mr35138419pga.91.1553710336056; Wed, 27 Mar 2019 11:12:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553710336; cv=none; d=google.com; s=arc-20160816; b=N7dy84uewWLUo+rtyCtsK8lU/wzvMaZ651KLo3dYxtY2BHRi8Uf2smMwbc5zXxgcP0 +/0R1LHqdlHzwmLc1kw1FC+i0rKzYoec9Q+Np8aY7VmAWdC+yx1krSbbHwwrLzlknNKm lfWNUkU5+9YMByCPDJvm6e8FwLtbxs0nilbRdkSyJBFRuraN0A2NKTlYI7yqA7E7Mp7i qh3M8NCkQNpiMAe4XgSiuv8LEe1eYeaFrBSYCW3KSvHKwZJc74sUOIXZu9nwLHjwdfQB TBW4jG70QKHqPP+QmGsl1fhBhNmYHHAj2cBy7mbkab4eehCxamV219EF22+sBlrHyln+ tH5A== 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=aKnQjQCmZfpLOJfeA5y//BuKSc5i8ytLGxv5OEUcqWk=; b=bHjaIDn3DPRbr41h6N0sVomONyz6HEE582EKM7HnxqwDQ4FP48DZoLgKgKpX4UcvqD VbsqqpVbbk60cUD44e2RHtcLfotrqt6Ta84Yxr3xX2noAXjHDGQBfKojJ6fV8dSXqIXC Xg73OHrpB+D1Q1xBO3kEgnbDIfHV8ExzKsqQc9mwHQIWLAA90vMaTtrgkAbhYjdzy18+ IxuzrWJNSq9/vcMxz+8QUrvKvXbkKArIHijgNprnxj2blEF6Desq4POIuEUIAwL8j5tv 0KqVNId0TEjHBkpNa0e2009Y7pzthvOHKbKksQE3a2rGUmVQt7aeqC7gTI7AeJLOGv/Z IWKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=z7szw4K1; 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 d6si20003154plr.246.2019.03.27.11.12.00; Wed, 27 Mar 2019 11:12:16 -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=z7szw4K1; 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 S2388733AbfC0SKG (ORCPT + 99 others); Wed, 27 Mar 2019 14:10:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:52052 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388719AbfC0SKF (ORCPT ); Wed, 27 Mar 2019 14:10:05 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (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 975622183E; Wed, 27 Mar 2019 18:10:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710204; bh=0qLHF3LgfFbvHLtMyDGO59z6r4GEQMr2fBPiTFD6aKE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z7szw4K1HlPrFyzhLKWr7YaLNk9wEtzwifobN06PJzjuefnnmybUSX6LFkJOCpCKH CAKA4qjqe+Pu/gWvzGzWwO06VIPluk5ApwgLuOLjYD9MJw3mYaXNONFZWOIg916DjU vuhuEOiFsEV+V2DvYK2epcsznsM9wT/Za3v+HLnI= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jerome Brunet , Neil Armstrong , Sasha Levin , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org Subject: [PATCH AUTOSEL 5.0 249/262] clk: meson: clean-up clock registration Date: Wed, 27 Mar 2019 14:01:44 -0400 Message-Id: <20190327180158.10245-249-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jerome Brunet [ Upstream commit 8d9981efbcab066d17af4d3c85c169200f6f78df ] Order, ids and size between the table of regmap clocks and the onecell data table could be different. Set regmap pointer in all the regmap clocks before starting the registration using the onecell data, to make sure we don't get into an incoherent situation. Signed-off-by: Jerome Brunet Acked-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lkml.kernel.org/r/20181221160239.26265-3-jbrunet@baylibre.com Signed-off-by: Sasha Levin --- drivers/clk/meson/meson-aoclk.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/clk/meson/meson-aoclk.c b/drivers/clk/meson/meson-aoclk.c index f965845917e3..258c8d259ea1 100644 --- a/drivers/clk/meson/meson-aoclk.c +++ b/drivers/clk/meson/meson-aoclk.c @@ -65,15 +65,20 @@ int meson_aoclkc_probe(struct platform_device *pdev) return ret; } - /* - * Populate regmap and register all clks - */ - for (clkid = 0; clkid < data->num_clks; clkid++) { + /* Populate regmap */ + for (clkid = 0; clkid < data->num_clks; clkid++) data->clks[clkid]->map = regmap; + /* Register all clks */ + for (clkid = 0; clkid < data->hw_data->num; clkid++) { + if (!data->hw_data->hws[clkid]) + continue; + ret = devm_clk_hw_register(dev, data->hw_data->hws[clkid]); - if (ret) + if (ret) { + dev_err(dev, "Clock registration failed\n"); return ret; + } } return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, -- 2.19.1