devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Zhangfei Gao <zhangfei.gao@linaro.org>
Cc: Kishon Vijay Abraham I <kishon@ti.com>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"haifeng.yan@linaro.org" <haifeng.yan@linaro.org>,
	"jchxue@gmail.com" <jchxue@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Jiancheng Xue <xuejiancheng@huawei.com>
Subject: Re: [PATCH 2/2] phy: add hix5hd2-sata-phy driver
Date: Tue, 17 Jun 2014 18:23:02 +0100	[thread overview]
Message-ID: <20140617172302.GI8930@leverpostej> (raw)
In-Reply-To: <1402991881-27676-3-git-send-email-zhangfei.gao@linaro.org>

On Tue, Jun 17, 2014 at 08:58:01AM +0100, Zhangfei Gao wrote:
> From: Jiancheng Xue <xuejiancheng@huawei.com>
> 
> Add hix5hd2-sata-phy driver on Hisilicon hix5hd2 soc.
> 
> Signed-off-by: Jiancheng Xue <xuejiancheng@huawei.com>
> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
> ---
>  drivers/phy/Kconfig            |    8 ++
>  drivers/phy/Makefile           |    1 +
>  drivers/phy/phy-hix5hd2-sata.c |  192 ++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 201 insertions(+)
>  create mode 100644 drivers/phy/phy-hix5hd2-sata.c
 
[...]

> +	paddr = of_get_property(phy->dev.of_node, "hisilicon,reg-init", &lenp);
> +	if (!paddr || lenp < 4 * sizeof(*paddr))
> +		return 0;
> +
> +	lenp /= sizeof(*paddr);
> +	for (i = 0; i < lenp - 3; i += 4) {
> +		offset = be32_to_cpup(paddr + i);
> +		shift = be32_to_cpup(paddr + i + 1);
> +		width = be32_to_cpup(paddr + i + 2);
> +		value = be32_to_cpup(paddr + i + 3);
> +		hix5hd2_sata_phy_write(priv->base + offset,
> +				       shift, width, value);
> +	}

There is absolutely no reason to use of_get_property and be32 values
here, we have of_property_count_u32_elems and
of_property_read_u32_index.

That said I would like to see a compelling reason for why we need to
have this at all; I'm not a fan of DT becoming a shoddy bytecode format.

Cheers,
Mark.

      reply	other threads:[~2014-06-17 17:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-17  7:57 [PATCH 0/2] phy: add hix5hd2-sata-phy driver Zhangfei Gao
2014-06-17  7:58 ` [PATCH 1/2] Documentation: Document Hisilicon hix5hd2 sata PHY Zhangfei Gao
2014-06-17 17:13   ` Mark Rutland
2014-06-20  5:45     ` zhangfei
2014-06-17  7:58 ` [PATCH 2/2] phy: add hix5hd2-sata-phy driver Zhangfei Gao
2014-06-17 17:23   ` Mark Rutland [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=20140617172302.GI8930@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=haifeng.yan@linaro.org \
    --cc=jchxue@gmail.com \
    --cc=kishon@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xuejiancheng@huawei.com \
    --cc=zhangfei.gao@linaro.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).