Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1550117
| From | Bjorn Andersson <bjorn.andersson@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v3 4/4] phy: qcom-qmp: new qmp phy driver for qcom-chipsets |
| Date | 2017-01-03 20:30 +0100 |
| Message-ID | <sVCWt-2r6-13@gated-at.bofh.it> (permalink) |
| References | <sQw5k-8nS-25@gated-at.bofh.it> <sQw5k-8nS-23@gated-at.bofh.it> <sTvFL-6Tj-1@gated-at.bofh.it> <sTDDj-3Hg-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed 28 Dec 23:39 PST 2016, Vivek Gautam wrote:
> >> + *
> >> + */
> >> +static int phy_pipe_clk_register(struct qcom_qmp_phy *qphy, int id)
> >> +{
> >> + char clk_name[MAX_PROP_NAME];
> >
> > I'm not sure MAX_PROP_NAME is the same as some max clk name but
> > ok. We should be able to calculate that the maximum is length of
> > usb3_phy_pipe_clk_src for now though?
>
> Yea, i thought of using the same macro, considering that it provides
> 32 characters :-)
> Will rather use the length of usb3_phy_pipe_clk_src for now. May be
> #define MAX_CLK_NAME 24
>
Using a macro indicates that the size have some global meaning, but as
far as I can see it doesn't. Just write 24 and you will have enough
space for 100k pcie pipe clocks. And then use sizeof(clk_name) below.
> >
> >> + struct clk *clk;
> >> +
> >> + memset(&clk_name, 0, sizeof(clk_name));
There's no point in clearing clk_name, as it will be overwritten
and nul-terminated below.
> >> + switch (qphy->cfg->type) {
> >> + case PHY_TYPE_USB3:
> >> + snprintf(clk_name, MAX_PROP_NAME, "usb3_phy_pipe_clk_src");
> >> + break;
> >> + case PHY_TYPE_PCIE:
> >> + snprintf(clk_name, MAX_PROP_NAME, "pcie_%d_pipe_clk_src", id);
> >> + break;
> >> + default:
> >> + return -EINVAL;
> >> + }
> >> +
> >> + /* controllers using QMP phys use 125MHz pipe clock interface */
> >> + clk = clk_register_fixed_rate(qphy->dev, clk_name, NULL, 0, 125000000);
Regards,
Bjorn
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v3 0/4] phy: USB and PCIe phy drivers for Qcom chipsets Vivek Gautam <vivek.gautam@codeaurora.org> - 2016-12-20 18:20 +0100
[PATCH v3 2/4] phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips Vivek Gautam <vivek.gautam@codeaurora.org> - 2016-12-20 18:20 +0100
Re: [PATCH v3 2/4] phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips Stephen Boyd <sboyd@codeaurora.org> - 2016-12-29 00:10 +0100
Re: [PATCH v3 2/4] phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips Vivek Gautam <vivek.gautam@codeaurora.org> - 2016-12-29 08:00 +0100
Re: [PATCH v3 2/4] phy: qcom-qusb2: New driver for QUSB2 PHY on Qcom chips Vivek Gautam <vivek.gautam@codeaurora.org> - 2016-12-29 08:10 +0100
[PATCH v3 1/4] dt-bindings: phy: Add support for QUSB2 phy Vivek Gautam <vivek.gautam@codeaurora.org> - 2016-12-20 18:20 +0100
Re: [PATCH v3 1/4] dt-bindings: phy: Add support for QUSB2 phy Rob Herring <robh@kernel.org> - 2016-12-22 22:20 +0100
Re: [PATCH v3 1/4] dt-bindings: phy: Add support for QUSB2 phy Vivek Gautam <vivek.gautam@codeaurora.org> - 2016-12-23 06:00 +0100
Re: [PATCH v3 1/4] dt-bindings: phy: Add support for QUSB2 phy Stephen Boyd <sboyd@codeaurora.org> - 2016-12-28 02:20 +0100
Re: [PATCH v3 1/4] dt-bindings: phy: Add support for QUSB2 phy Vivek Gautam <vivek.gautam@codeaurora.org> - 2016-12-28 06:50 +0100
Re: [PATCH v3 4/4] phy: qcom-qmp: new qmp phy driver for qcom-chipsets Stephen Boyd <sboyd@codeaurora.org> - 2016-12-29 00:20 +0100
Re: [PATCH v3 4/4] phy: qcom-qmp: new qmp phy driver for qcom-chipsets Vivek Gautam <vivek.gautam@codeaurora.org> - 2016-12-29 08:50 +0100
Re: [PATCH v3 4/4] phy: qcom-qmp: new qmp phy driver for qcom-chipsets Bjorn Andersson <bjorn.andersson@linaro.org> - 2017-01-03 20:30 +0100
Re: [PATCH v3 4/4] phy: qcom-qmp: new qmp phy driver for qcom-chipsets Vivek Gautam <vivek.gautam@codeaurora.org> - 2017-01-05 10:20 +0100
Re: [PATCH v3 4/4] phy: qcom-qmp: new qmp phy driver for qcom-chipsets Bjorn Andersson <bjorn.andersson@linaro.org> - 2017-01-06 08:20 +0100
Re: [PATCH v3 4/4] phy: qcom-qmp: new qmp phy driver for qcom-chipsets Vivek Gautam <vivek.gautam@codeaurora.org> - 2017-01-06 10:50 +0100
Re: [PATCH v3 4/4] phy: qcom-qmp: new qmp phy driver for qcom-chipsets Bjorn Andersson <bjorn.andersson@linaro.org> - 2017-01-06 22:20 +0100
Re: [PATCH v3 4/4] phy: qcom-qmp: new qmp phy driver for qcom-chipsets vivek.gautam@codeaurora.org - 2017-01-07 19:50 +0100
csiph-web