public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: b.zolnierkie@samsung.com (Bartlomiej Zolnierkiewicz)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC 4/5] clk: samsung: Add clock driver for s5pc110/s5pv210
Date: Mon, 26 Aug 2013 19:12:35 +0200	[thread overview]
Message-ID: <1433697.46kixytlq2@amdc1032> (raw)
In-Reply-To: <1377517114-20222-5-git-send-email-m.krawczuk@partner.samsung.com>

On Monday, August 26, 2013 01:38:33 PM Mateusz Krawczuk wrote:
> This patch adds new, Common Clock Framework-based clock driver for Samsung
> S5PV210 SoCs. The driver is just added, without enabling it yet.
> 
> Signed-off-by: Mateusz Krawczuk <m.krawczuk@partner.samsung.com>
> ---
>  .../bindings/clock/samsung,s5pv210-clock.txt       |  72 ++
>  drivers/clk/samsung/Makefile                       |   3 +-
>  drivers/clk/samsung/clk-s5pv210.c                  | 732 +++++++++++++++++++++
>  include/dt-bindings/clock/samsung,s5pv210-clock.h  | 221 +++++++
>  4 files changed, 1027 insertions(+), 1 deletion(-)
>  create mode 100644 Documentation/devicetree/bindings/clock/samsung,s5pv210-clock.txt
>  create mode 100644 drivers/clk/samsung/clk-s5pv210.c
>  create mode 100644 include/dt-bindings/clock/samsung,s5pv210-clock.h

[...]

> diff --git a/drivers/clk/samsung/clk-s5pv210.c b/drivers/clk/samsung/clk-s5pv210.c
> new file mode 100644
> index 0000000..861d37d
> --- /dev/null
> +++ b/drivers/clk/samsung/clk-s5pv210.c

[...]

> +static unsigned long s5pv210_get_xom(void)

This function can be marked with __init.

> +{
> +	unsigned long xom = 1;
> +	void __iomem *chipid_base;
> +	struct device_node *np;
> +
> +	np = of_find_compatible_node(NULL, NULL, "samsung,s5pv210-chipid");
> +	if (np) {
> +		chipid_base = of_iomap(np, 0);

How's about printing an error if !chipid_base?

Also the code can be made a bit shorter:

if (np) {
	void __iomem *chipid_base = of_iomap(np, 0);
...
}

> +		if (chipid_base)
> +			xom = readl(chipid_base + 8);
> +
> +		iounmap(chipid_base);

It seems that at least generic iounmap() accepts NULL argument but it 
will be better not to call it if of_iomap() failed.

> +	}
> +
> +	return xom;
> +}

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

  reply	other threads:[~2013-08-26 17:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-26 11:38 [PATCH RFC 0/5] ARM: s5pv210: move to common clk framework Mateusz Krawczuk
2013-08-26 11:38 ` [PATCH RFC 1/5] media: s5p-tv: Fix sdo driver to work with CCF Mateusz Krawczuk
2013-08-26 15:32   ` Bartlomiej Zolnierkiewicz
2013-08-26 11:38 ` [PATCH RFC 2/5] media: s5p-tv: Fix mixer " Mateusz Krawczuk
2013-08-26 16:03   ` Bartlomiej Zolnierkiewicz
2013-08-26 11:38 ` [PATCH RFC 3/5] ARM: samsung: add clock setup for FIMC and FIMD Mateusz Krawczuk
2013-08-26 16:19   ` Bartlomiej Zolnierkiewicz
2013-08-26 18:37     ` Sylwester Nawrocki
2013-08-27  3:07       ` Jingoo Han
2013-08-26 11:38 ` [PATCH RFC 4/5] clk: samsung: Add clock driver for s5pc110/s5pv210 Mateusz Krawczuk
2013-08-26 17:12   ` Bartlomiej Zolnierkiewicz [this message]
2013-08-26 11:38 ` [PATCH RFC 5/5] ARM: s5pv210: Migrate clock handling to Common Clock Framework Mateusz Krawczuk
2013-08-26 16:38   ` Bartlomiej Zolnierkiewicz

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=1433697.46kixytlq2@amdc1032 \
    --to=b.zolnierkie@samsung.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