Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp891514imm; Fri, 27 Jul 2018 07:54:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpciyw8qYNS81JAJyjLrr7Ovn3DOgocuBv9TpugMDQiyH+EZzscbqmTrJnRE8V9SppnYdY/Q X-Received: by 2002:a62:9dcc:: with SMTP id a73-v6mr6776993pfk.249.1532703252165; Fri, 27 Jul 2018 07:54:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532703252; cv=none; d=google.com; s=arc-20160816; b=VqboQp3EQTt7eRB8HRmBmg4jBNSCm8y7OcykzNnw7bH7C46011aujpTHP4ghh7RYyr 8mnkOAuFbhLORi5mzi6N/4c8Xt3eRiP6b/ZQYrpH9/GMWdZKYsKXczHkuq7zOKivghno 5HTjbWnHxlG4kfDFxuCNCMIG8wTLId3/05v18lWwpd7UIIK2jFLSCENOwuUhg6gWGPhM l4+WOWcm3tDkK8zL2FIuG+U1uxSlVJnajkQ2pf9oo91oALsz8g+oBe23v7f17gcAbBqZ Wircd6U1X9LidcDai+PKKKciItuT8lT+S65kq3Qt2VwH+/PeXO+255FjV0Fap/G/Md2Z e2+g== 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:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=Tswmzlb0DO7VKDUhD5UeyTmncs2Z1DkEn/C1lkFIaOE=; b=JjzkIWGQ19nJReyUG9sk+WBePcn8JTHUSHe7gc5w+zxDGkS+UvdKgUyT6CeOsgmYTW MJIhTjt4Tt8Egf7XWKWeg5X9WO9OQcbH+Te1Cqs2qBUxbKigXtukPdWd5Wt9Urrg7Fwa BvAdbsJoUpKTG79CNQkNSVXPpwkXSgo0R+qfV+cgYdaz9KbMkE1OKSKfRpjZmBL2azKj 38CAZj3b/S/9SIUjCo1f7Gpi0wIM6Xzk38txqKn+OzT+U73JMiqrFUtM8wnFzmFC+U68 45yU8TMDHFCogwnH1YjXcEOTxNZBg8gmZoh3b0fhCktpyhU1lSVMIyWOrHu0nf3d/Th7 hL/w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t8-v6si4089130pgl.620.2018.07.27.07.53.57; Fri, 27 Jul 2018 07:54:12 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388554AbeG0QOl (ORCPT + 99 others); Fri, 27 Jul 2018 12:14:41 -0400 Received: from mail-sh2.amlogic.com ([58.32.228.45]:19397 "EHLO mail-sh2.amlogic.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730771AbeG0QOl (ORCPT ); Fri, 27 Jul 2018 12:14:41 -0400 Received: from [192.168.90.67] (61.170.236.39) by mail-sh2.amlogic.com (10.18.11.6) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Fri, 27 Jul 2018 22:52:31 +0800 Subject: Re: [PATCH v3 2/2] clk: meson: add sub MMC clock controller driver To: Stephen Boyd , Jerome Brunet , Neil Armstrong References: <20180712211244.11428-1-yixun.lan@amlogic.com> <20180712211244.11428-3-yixun.lan@amlogic.com> <153261840298.48062.2497103873681297587@swboyd.mtv.corp.google.com> CC: , Kevin Hilman , Carlo Caione , Michael Turquette , Rob Herring , Miquel Raynal , Boris Brezillon , Martin Blumenstingl , Liang Yang , Qiufang Dai , Jian Hu , , , , From: Yixun Lan Message-ID: Date: Fri, 27 Jul 2018 22:52:23 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <153261840298.48062.2497103873681297587@swboyd.mtv.corp.google.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [61.170.236.39] X-ClientProxiedBy: mail-sh2.amlogic.com (10.18.11.6) To mail-sh2.amlogic.com (10.18.11.6) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org HI Stephen: On 07/26/2018 11:20 PM, Stephen Boyd wrote: > Quoting Yixun Lan (2018-07-12 14:12:44) >> diff --git a/drivers/clk/meson/mmc-clkc.c b/drivers/clk/meson/mmc-clkc.c >> new file mode 100644 >> index 000000000000..36c4c7cd69a6 >> --- /dev/null >> +++ b/drivers/clk/meson/mmc-clkc.c >> @@ -0,0 +1,367 @@ >> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) >> +/* >> + * Amlogic Meson MMC Sub Clock Controller Driver >> + * >> + * Copyright (c) 2017 Baylibre SAS. >> + * Author: Jerome Brunet >> + * >> + * Copyright (c) 2018 Amlogic, inc. >> + * Author: Yixun Lan >> + */ >> + >> +#include > > Is this include used? > this is needed by clk_get_rate() see drivers/clk/meson/mmc-clkc.c:204 >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include "clkc.h" >> + >> + >> +static struct clk_regmap * >> +mmc_clkc_register_other_clk(struct device *dev, struct regmap *map, >> + char *suffix, char *parent_suffix, >> + unsigned long flags, >> + const struct clk_ops *ops, void *data) >> +{ >> + struct clk_init_data init; >> + struct clk_regmap *clk; >> + char *parent; >> + >> + parent = kasprintf(GFP_KERNEL, "%s#%s", dev_name(dev), parent_suffix); >> + if (!parent) >> + return ERR_PTR(-ENOMEM); >> + >> + init.ops = ops; >> + init.flags = flags; >> + init.parent_names = (const char* const []){ parent, }; > > Can't this just be &parent? sure, I can fix this > >> + init.num_parents = 1; >> + >> + clk = mmc_clkc_register_clk(dev, map, &init, suffix, data); >> + if (IS_ERR(clk)) >> + dev_err(dev, "Core %s clock registration failed\n", suffix); >> + >> + kfree(parent); >> + return clk; >> +} >> + >> +static int mmc_clkc_probe(struct platform_device *pdev) >> +{ >> + struct clk_hw_onecell_data *onecell_data; >> + struct device *dev = &pdev->dev; >> + struct mmc_clkc_data *data; >> + struct regmap *map; >> + struct clk_regmap *mux, *div, *core, *rx, *tx; >> + >> + data = (struct mmc_clkc_data *)of_device_get_match_data(dev); > > This cast is unnecessary. Pleas remove. > Ok, I will try to fix in next version this was trying to silence the ’const‘ cast warning [1] I could make a 'const struct mmc_clkc_data *data' declare, but need to fix further cast warning issue.. [1] drivers/clk/meson/mmc-clkc.c: In function ‘mmc_clkc_probe’: drivers/clk/meson/mmc-clkc.c:302:7: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] data = of_device_get_match_data(dev); ^