Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1258736 > unrolled thread
| Started by | Geert Uytterhoeven <geert+renesas@glider.be> |
|---|---|
| First post | 2015-10-29 12:30 +0100 |
| Last post | 2015-10-30 15:00 +0100 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v5 2/5] clk: shmobile: div6: Make clock-output-names optional Geert Uytterhoeven <geert+renesas@glider.be> - 2015-10-29 12:30 +0100
Re: [PATCH v5 2/5] clk: shmobile: div6: Make clock-output-names optional Laurent Pinchart <laurent.pinchart@ideasonboard.com> - 2015-10-30 14:50 +0100
Re: [PATCH v5 2/5] clk: shmobile: div6: Make clock-output-names optional Geert Uytterhoeven <geert@linux-m68k.org> - 2015-10-30 15:00 +0100
| From | Geert Uytterhoeven <geert+renesas@glider.be> |
|---|---|
| Date | 2015-10-29 12:30 +0100 |
| Subject | [PATCH v5 2/5] clk: shmobile: div6: Make clock-output-names optional |
| Message-ID | <qoTz4-7Zb-19@gated-at.bofh.it> |
Renesas DIV6 clocks provide a single clock output. Hence make the
"clock-output-names" DT property optional instead of mandatory. In case
the DT property is omitted the DT node name will be used.
Rename the variable "name" to "clk_name" to make the code more similar
with fixed-factor-clock.c, and to avoid a conflict with a nested local
variable while we're at it.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v5:
- Integrated in this series as a dependency.
---
.../devicetree/bindings/clock/renesas,cpg-div6-clocks.txt | 4 ++++
drivers/clk/shmobile/clk-div6.c | 13 +++----------
2 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/Documentation/devicetree/bindings/clock/renesas,cpg-div6-clocks.txt b/Documentation/devicetree/bindings/clock/renesas,cpg-div6-clocks.txt
index 5ddb68418655d569..86008ad354cf4bbd 100644
--- a/Documentation/devicetree/bindings/clock/renesas,cpg-div6-clocks.txt
+++ b/Documentation/devicetree/bindings/clock/renesas,cpg-div6-clocks.txt
@@ -20,6 +20,10 @@ Required Properties:
clocks must be specified. For clocks with multiple parents, invalid
settings must be specified as "<0>".
- #clock-cells: Must be 0
+
+
+Optional Properties:
+
- clock-output-names: The name of the clock as a free-form string
diff --git a/drivers/clk/shmobile/clk-div6.c b/drivers/clk/shmobile/clk-div6.c
index 036a692c72195db9..c89566a918290246 100644
--- a/drivers/clk/shmobile/clk-div6.c
+++ b/drivers/clk/shmobile/clk-div6.c
@@ -178,10 +178,9 @@ static void __init cpg_div6_clock_init(struct device_node *np)
const char **parent_names;
struct clk_init_data init;
struct div6_clock *clock;
- const char *name;
+ const char *clk_name = np->name;
struct clk *clk;
unsigned int i;
- int ret;
clock = kzalloc(sizeof(*clock), GFP_KERNEL);
if (!clock)
@@ -215,13 +214,7 @@ static void __init cpg_div6_clock_init(struct device_node *np)
clock->div = (clk_readl(clock->reg) & CPG_DIV6_DIV_MASK) + 1;
/* Parse the DT properties. */
- ret = of_property_read_string(np, "clock-output-names", &name);
- if (ret < 0) {
- pr_err("%s: failed to get %s DIV6 clock output name\n",
- __func__, np->name);
- goto error;
- }
-
+ of_property_read_string(np, "clock-output-names", &clk_name);
for (i = 0, valid_parents = 0; i < num_parents; i++) {
const char *name = of_clk_get_parent_name(np, i);
@@ -255,7 +248,7 @@ static void __init cpg_div6_clock_init(struct device_node *np)
}
/* Register the clock. */
- init.name = name;
+ init.name = clk_name;
init.ops = &cpg_div6_clock_ops;
init.flags = CLK_IS_BASIC;
init.parent_names = parent_names;
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
|---|---|
| Date | 2015-10-30 14:50 +0100 |
| Message-ID | <qpie5-6qe-15@gated-at.bofh.it> |
| In reply to | #1258736 |
Hi Geert,
Thank you for the patch.
On Thursday 29 October 2015 12:21:01 Geert Uytterhoeven wrote:
> Renesas DIV6 clocks provide a single clock output. Hence make the
> "clock-output-names" DT property optional instead of mandatory. In case
> the DT property is omitted the DT node name will be used.
>
> Rename the variable "name" to "clk_name" to make the code more similar
> with fixed-factor-clock.c, and to avoid a conflict with a nested local
> variable while we're at it.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> v5:
> - Integrated in this series as a dependency.
The patch looks sane, by why is it a dependency ?
> ---
> .../devicetree/bindings/clock/renesas,cpg-div6-clocks.txt | 4 ++++
> drivers/clk/shmobile/clk-div6.c | 13
> +++----------
> 2 files changed, 7 insertions(+), 10 deletions(-)
>
> diff --git
> a/Documentation/devicetree/bindings/clock/renesas,cpg-div6-clocks.txt
> b/Documentation/devicetree/bindings/clock/renesas,cpg-div6-clocks.txt index
> 5ddb68418655d569..86008ad354cf4bbd 100644
> --- a/Documentation/devicetree/bindings/clock/renesas,cpg-div6-clocks.txt
> +++ b/Documentation/devicetree/bindings/clock/renesas,cpg-div6-clocks.txt
> @@ -20,6 +20,10 @@ Required Properties:
> clocks must be specified. For clocks with multiple parents, invalid
> settings must be specified as "<0>".
> - #clock-cells: Must be 0
> +
> +
> +Optional Properties:
> +
> - clock-output-names: The name of the clock as a free-form string
>
>
> diff --git a/drivers/clk/shmobile/clk-div6.c
> b/drivers/clk/shmobile/clk-div6.c index 036a692c72195db9..c89566a918290246
> 100644
> --- a/drivers/clk/shmobile/clk-div6.c
> +++ b/drivers/clk/shmobile/clk-div6.c
> @@ -178,10 +178,9 @@ static void __init cpg_div6_clock_init(struct
> device_node *np) const char **parent_names;
> struct clk_init_data init;
> struct div6_clock *clock;
> - const char *name;
> + const char *clk_name = np->name;
> struct clk *clk;
> unsigned int i;
> - int ret;
>
> clock = kzalloc(sizeof(*clock), GFP_KERNEL);
> if (!clock)
> @@ -215,13 +214,7 @@ static void __init cpg_div6_clock_init(struct
> device_node *np) clock->div = (clk_readl(clock->reg) & CPG_DIV6_DIV_MASK) +
> 1;
>
> /* Parse the DT properties. */
> - ret = of_property_read_string(np, "clock-output-names", &name);
> - if (ret < 0) {
> - pr_err("%s: failed to get %s DIV6 clock output name\n",
> - __func__, np->name);
> - goto error;
> - }
> -
> + of_property_read_string(np, "clock-output-names", &clk_name);
>
> for (i = 0, valid_parents = 0; i < num_parents; i++) {
> const char *name = of_clk_get_parent_name(np, i);
> @@ -255,7 +248,7 @@ static void __init cpg_div6_clock_init(struct
> device_node *np) }
>
> /* Register the clock. */
> - init.name = name;
> + init.name = clk_name;
> init.ops = &cpg_div6_clock_ops;
> init.flags = CLK_IS_BASIC;
> init.parent_names = parent_names;
--
Regards,
Laurent Pinchart
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Geert Uytterhoeven <geert@linux-m68k.org> |
|---|---|
| Date | 2015-10-30 15:00 +0100 |
| Message-ID | <qpinN-6tx-23@gated-at.bofh.it> |
| In reply to | #1259498 |
On Fri, Oct 30, 2015 at 2:47 PM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> On Thursday 29 October 2015 12:21:01 Geert Uytterhoeven wrote:
>> Renesas DIV6 clocks provide a single clock output. Hence make the
>> "clock-output-names" DT property optional instead of mandatory. In case
>> the DT property is omitted the DT node name will be used.
>>
>> Rename the variable "name" to "clk_name" to make the code more similar
>> with fixed-factor-clock.c, and to avoid a conflict with a nested local
>> variable while we're at it.
>>
>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>> ---
>> v5:
>> - Integrated in this series as a dependency.
>
> The patch looks sane, by why is it a dependency ?
Sorry, the cover letter is clearer about this: "contextual dependency".
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web