public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Simon <horms@verge.net.au>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, Magnus <magnus.damm@gmail.com>,
	linux-sh@vger.kernel.org
Subject: Re: [PATCH] misc: add CS2000 Fractional-N driver
Date: Thu, 10 Sep 2015 08:52:41 +0200	[thread overview]
Message-ID: <1702135.nL3RG8RPso@wuerfel> (raw)
In-Reply-To: <87mvwuokd3.wl%kuninori.morimoto.gx@renesas.com>

On Thursday 10 September 2015 06:36:14 Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> This patch adds CS2000 Fractional-N driver as clock provider.
> It is useful if it supports runtime clock setting, but it supports
> fixed clock rate at this point.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  .../devicetree/bindings/misc/cs2000-cp.txt         |  20 ++
>  drivers/misc/Kconfig                               |   6 +
>  drivers/misc/Makefile                              |   1 +
>  drivers/misc/cs2000-cp.c                           | 341 +++++++++++++++++++++
>  4 files changed, 368 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/misc/cs2000-cp.txt
>  create mode 100644 drivers/misc/cs2000-cp.c

I think the driver should be in drivers/clk/ if it provides a clk to
other devices.

Please also split out the binding document into a separate patch and
Cc the devicetree mailing list.

> +
> +       ret = cs2000_get_clk(client, &rate_in, &rate_out);
> +       if (ret < 0)
> +               return ret;
> +
> +       ret = cs2000_enable_dev_config(client);
> +       if (ret < 0)
> +               return ret;
> +
> +       ret = cs2000_clk_in_bound_rate(client, rate_in);
> +       if (ret < 0)
> +               return ret;
> +
> +       ret = cs2000_ratio_set(client, ch, rate_in, rate_out);
> +       if (ret < 0)
> +               return ret;

The probe function lacks unwinding if anything goes wrong, so you end
up with clocks that are registered but the driver being absent.
For most things, you can use the devm_*() interfaces here.

	Arnd

  reply	other threads:[~2015-09-10  6:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-10  6:36 [PATCH] misc: add CS2000 Fractional-N driver Kuninori Morimoto
2015-09-10  6:52 ` Arnd Bergmann [this message]
2015-09-14  2:05   ` Kuninori Morimoto

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=1702135.nL3RG8RPso@wuerfel \
    --to=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=horms@verge.net.au \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.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