From: Jiancheng Xue <xuejiancheng@hisilicon.com>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: <mturquette@baylibre.com>, <p.zabel@pengutronix.de>,
<robh+dt@kernel.org>, <linux@arm.linux.org.uk>,
<khilman@linaro.org>, <arnd@arndb.de>, <olof@lixom.net>,
<xuwei5@hisilicon.com>, <linux-kernel@vger.kernel.org>,
<linux-clk@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<yanhaifeng@hisilicon.com>, <yanghongwei@hisilicon.com>,
<suwenping@hisilicon.com>, <raojun@hisilicon.com>,
<ml.yang@hisilicon.com>, <gaofei@hisilicon.com>,
<zhangzhenxing@hisilicon.com>,
Jiancheng Xue <xuejiancheng@huawei.com>
Subject: Re: [RESEND PATCH v10 2/6] clk: hisilicon: add CRG driver for hi3519 soc
Date: Tue, 19 Apr 2016 15:11:55 +0800 [thread overview]
Message-ID: <5715DA3B.1070605@hisilicon.com> (raw)
In-Reply-To: <20160416004055.GN26353@codeaurora.org>
Hi Stephen,
On 2016/4/16 8:40, Stephen Boyd wrote:
> On 03/31, Jiancheng Xue wrote:
>> diff --git a/drivers/clk/hisilicon/clk-hi3519.c b/drivers/clk/hisilicon/clk-hi3519.c
>> new file mode 100644
>> index 0000000..ee9df82
>> --- /dev/null
>> +++ b/drivers/clk/hisilicon/clk-hi3519.c
>> @@ -0,0 +1,129 @@
>> +/*
>> + * Hi3519 Clock Driver
>> + *
>> + * Copyright (c) 2015-2016 HiSilicon Technologies Co., Ltd.
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License as published by
>> + * the Free Software Foundation; either version 2 of the License, or
>> + * (at your option) any later version.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>> + * GNU General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU General Public License
>> + * along with this program. If not, see <http://www.gnu.org/licenses/>.
>> + */
>> +
[...]
>> +static int hi3519_clk_probe(struct platform_device *pdev)
>> +{
>> + struct device_node *np = pdev->dev.of_node;
>> + struct hisi_clock_data *clk_data;
>> +
>> + clk_data = hisi_clk_init(np, HI3519_NR_CLKS);
>> + if (!clk_data)
>> + return -ENODEV;
>> +
>> + hisi_clk_register_fixed_rate(hi3519_fixed_rate_clks,
>> + ARRAY_SIZE(hi3519_fixed_rate_clks),
>> + clk_data);
>> + hisi_clk_register_mux(hi3519_mux_clks, ARRAY_SIZE(hi3519_mux_clks),
>> + clk_data);
>> + hisi_clk_register_gate(hi3519_gate_clks,
>> + ARRAY_SIZE(hi3519_gate_clks), clk_data);
>> +
>> + return hisi_reset_init(np);
>
> Now that this is a platform driver we need to do lots of cleanup
> in error cases. I mean we need to unregister clks, OF clk
> providers, and reset controllers. Please add all that code too.
>
Practically, clock driver is always needed during the whole system running.
It must be probed and never be removed. Is it a must for clock driver being
a platform driver? If it's not, I'd prefer to use CLK_OF_DECLARE instead.
Could you help me to understand the advantage of platform driver here? If
it's really a must, I will continue to fix these bugs as you pointed. It indeed
needs to be changed a lot including drivers/clk/hisilicon/clk.c.
Thank you!
Regards,
Jiancheng
next prev parent reply other threads:[~2016-04-19 7:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-31 8:10 [RESEND PATCH v10 0/6] ARM: hisi: Add initial support including clock driver for Hi3519 soc Jiancheng Xue
2016-03-31 8:10 ` [RESEND PATCH v10 1/6] clk: hisilicon: export some hisilicon APIs to modules Jiancheng Xue
2016-03-31 8:10 ` [RESEND PATCH v10 2/6] clk: hisilicon: add CRG driver for hi3519 soc Jiancheng Xue
2016-04-15 1:30 ` Jiancheng Xue
2016-04-16 0:41 ` Stephen Boyd
2016-04-18 2:59 ` Jiancheng Xue
2016-04-16 0:40 ` Stephen Boyd
2016-04-19 7:11 ` Jiancheng Xue [this message]
2016-03-31 8:10 ` [RESEND PATCH v10 3/6] ARM: hisi: add compatible string for Hi3519 soc Jiancheng Xue
2016-03-31 8:10 ` [RESEND PATCH v10 4/6] ARM: debug: add hi3519 debug uart Jiancheng Xue
2016-03-31 8:10 ` [RESEND PATCH v10 5/6] ARM: dt-bindings: add device tree bindings for Hi3519 sysctrl Jiancheng Xue
2016-03-31 8:10 ` [RESEND PATCH v10 6/6] ARM: dts: add dts files for Hi3519 Jiancheng Xue
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5715DA3B.1070605@hisilicon.com \
--to=xuejiancheng@hisilicon.com \
--cc=arnd@arndb.de \
--cc=devicetree@vger.kernel.org \
--cc=gaofei@hisilicon.com \
--cc=khilman@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=ml.yang@hisilicon.com \
--cc=mturquette@baylibre.com \
--cc=olof@lixom.net \
--cc=p.zabel@pengutronix.de \
--cc=raojun@hisilicon.com \
--cc=robh+dt@kernel.org \
--cc=sboyd@codeaurora.org \
--cc=suwenping@hisilicon.com \
--cc=xuejiancheng@huawei.com \
--cc=xuwei5@hisilicon.com \
--cc=yanghongwei@hisilicon.com \
--cc=yanhaifeng@hisilicon.com \
--cc=zhangzhenxing@hisilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).