From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] clk: shmobile: clk-mstp: add backwards comapt for indices field
Date: Fri, 07 Mar 2014 17:26:40 +0000 [thread overview]
Message-ID: <1661691.IhsTOhxgvF@avalon> (raw)
In-Reply-To: <1394196400-17112-3-git-send-email-ben.dooks@codethink.co.uk>
Hi Ben,
Thank you for the patch.
On Friday 07 March 2014 12:46:40 Ben Dooks wrote:
> Add comaptibiltiy for older device trees by checking to see if
> the clock-indices property is there and falling back to the
> older renesas,clock-indices field.
>
> This can be removed once all device-trees are converted.
>
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
> drivers/clk/shmobile/clk-mstp.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/shmobile/clk-mstp.c
> b/drivers/clk/shmobile/clk-mstp.c index 95a2aa7..fe63d40 100644
> --- a/drivers/clk/shmobile/clk-mstp.c
> +++ b/drivers/clk/shmobile/clk-mstp.c
> @@ -156,6 +156,7 @@ cpg_mstp_clock_register(const char *name, const char
> *parent_name, static void __init cpg_mstp_clocks_init(struct device_node
> *np)
> {
> struct mstp_clock_group *group;
> + const char *idxname;
> struct clk **clks;
> unsigned int i;
>
> @@ -184,6 +185,11 @@ static void __init cpg_mstp_clocks_init(struct
> device_node *np) for (i = 0; i < MSTP_MAX_CLOCKS; ++i)
> clks[i] = ERR_PTR(-ENOENT);
>
> + if (of_find_property(np, "clock-indices", &i))
You can leave the last argument NULL.
> + idxname = "clock-indices";
> + else
> + idxname = "renesas,clock-indices";
> +
> for (i = 0; i < MSTP_MAX_CLOCKS; ++i) {
> const char *parent_name;
> const char *name;
> @@ -197,8 +203,7 @@ static void __init cpg_mstp_clocks_init(struct
> device_node *np) continue;
>
> parent_name = of_clk_get_parent_name(np, i);
> - ret = of_property_read_u32_index(np, "clock-indices", i,
> - &clkidx);
> + ret = of_property_read_u32_index(np, idxname, i, &clkidx);
> if (parent_name = NULL || ret < 0)
> break;
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2014-03-07 17:26 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-07 12:46 Renesas clock clk-mstp updates for clock-indices Ben Dooks
2014-03-07 12:46 ` [PATCH 1/2] clk: shmobile: clk-mstp: change to using clock-indices Ben Dooks
2014-03-11 5:16 ` Simon Horman
2014-03-11 11:07 ` Ben Dooks
2014-03-11 22:39 ` Simon Horman
2014-03-07 12:46 ` [PATCH 2/2] clk: shmobile: clk-mstp: add backwards comapt for indices field Ben Dooks
2014-03-07 17:26 ` Laurent Pinchart [this message]
2014-03-10 10:51 ` Mark Rutland
2014-03-10 11:10 ` Ben Dooks
2014-04-15 9:10 ` Geert Uytterhoeven
2014-04-10 2:39 ` Renesas clock clk-mstp updates for clock-indices Kuninori Morimoto
2014-04-15 9:26 ` Geert Uytterhoeven
2014-04-15 11:43 ` Ben Dooks
2014-04-15 11:46 ` Geert Uytterhoeven
2014-04-15 11:52 ` Ben Dooks
2014-04-15 12:24 ` Geert Uytterhoeven
2014-04-15 23:59 ` Simon Horman
2014-04-15 23:58 ` Simon Horman
2014-04-16 7:12 ` Geert Uytterhoeven
2014-04-16 7:52 ` Simon Horman
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=1661691.IhsTOhxgvF@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).