From: Gregory CLEMENT <gregory.clement@bootlin.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Nadav Haklai <nadavh@marvell.com>,
Antoine Tenart <antoine.tenart@bootlin.com>,
Maxime Chevallier <maxime.chevallier@bootlin.com>,
linux-clk@vger.kernel.org
Subject: Re: [PATCH v2 1/2] clk: mvebu: armada-37xx-periph: save the IP base address in the driver data
Date: Tue, 26 Jun 2018 16:39:44 +0200 [thread overview]
Message-ID: <87fu19a9xr.fsf@bootlin.com> (raw)
In-Reply-To: <20180626092926.26361-1-miquel.raynal@bootlin.com> (Miquel Raynal's message of "Tue, 26 Jun 2018 11:29:25 +0200")
Hi Miquel,
On mar., juin 26 2018, Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> Prepare the introduction of suspend/resume hooks by having an easy way
> to access all the registers in one go just from a device: add the IP
> base address in the driver data.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Thanks,
Gregory
> ---
>
> Changes since v1:
> =================
> * None
>
> drivers/clk/mvebu/armada-37xx-periph.c | 15 +++++++--------
> 1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/clk/mvebu/armada-37xx-periph.c b/drivers/clk/mvebu/armada-37xx-periph.c
> index 6860bd5a37c5..a9e3dcc50a7b 100644
> --- a/drivers/clk/mvebu/armada-37xx-periph.c
> +++ b/drivers/clk/mvebu/armada-37xx-periph.c
> @@ -58,6 +58,7 @@
> struct clk_periph_driver_data {
> struct clk_hw_onecell_data *hw_data;
> spinlock_t lock;
> + void __iomem *reg;
> };
>
> struct clk_double_div {
> @@ -649,7 +650,6 @@ static int armada_3700_periph_clock_probe(struct platform_device *pdev)
> struct device *dev = &pdev->dev;
> int num_periph = 0, i, ret;
> struct resource *res;
> - void __iomem *reg;
>
> data = of_device_get_match_data(dev);
> if (!data)
> @@ -658,11 +658,6 @@ static int armada_3700_periph_clock_probe(struct platform_device *pdev)
> while (data[num_periph].name)
> num_periph++;
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - reg = devm_ioremap_resource(dev, res);
> - if (IS_ERR(reg))
> - return PTR_ERR(reg);
> -
> driver_data = devm_kzalloc(dev, sizeof(*driver_data), GFP_KERNEL);
> if (!driver_data)
> return -ENOMEM;
> @@ -675,12 +670,16 @@ static int armada_3700_periph_clock_probe(struct platform_device *pdev)
> return -ENOMEM;
> driver_data->hw_data->num = num_periph;
>
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + driver_data->reg = devm_ioremap_resource(dev, res);
> + if (IS_ERR(driver_data->reg))
> + return PTR_ERR(driver_data->reg);
> +
> spin_lock_init(&driver_data->lock);
>
> for (i = 0; i < num_periph; i++) {
> struct clk_hw **hw = &driver_data->hw_data->hws[i];
> -
> - if (armada_3700_add_composite_clk(&data[i], reg,
> + if (armada_3700_add_composite_clk(&data[i], driver_data->reg,
> &driver_data->lock, dev, hw))
> dev_err(dev, "Can't register periph clock %s\n",
> data[i].name);
> --
> 2.14.1
>
--
Gregory Clement, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
prev parent reply other threads:[~2018-06-26 14:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-26 9:29 [PATCH v2 1/2] clk: mvebu: armada-37xx-periph: save the IP base address in the driver data Miquel Raynal
2018-06-26 9:29 ` [PATCH v2 2/2] clk: mvebu: armada-37xx-periph: add suspend/resume support Miquel Raynal
2018-06-26 14:41 ` Gregory CLEMENT
2018-06-26 14:39 ` Gregory CLEMENT [this message]
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=87fu19a9xr.fsf@bootlin.com \
--to=gregory.clement@bootlin.com \
--cc=antoine.tenart@bootlin.com \
--cc=linux-clk@vger.kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=miquel.raynal@bootlin.com \
--cc=mturquette@baylibre.com \
--cc=nadavh@marvell.com \
--cc=sboyd@kernel.org \
--cc=thomas.petazzoni@bootlin.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).