devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Heiko Stuebner <heiko@sntech.de>,
	Finlye Xiao <finley.xiao@rock-chips.com>,
	srinivas.kandagatla@linaro.org, maxime.ripard@free-electrons.com,
	robh+dt@kernel.org, frowand.list@gmail.com, sre@kernel.org,
	dbaryshkov@gmail.com, khilman@kernel.org, nm@ti.com,
	rjw@rjwysocki.net, viresh.kumar@linaro.org, sboyd@codeaurora.org,
	linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	wxt@rock-chips.com, jay.xu@rock-chips.com,
	rocky.hao@rock-chips.com, tim.chen@rock-chips.com,
	tony.xie@rock-chips.com, ulysses.huang@rock-chips.com,
	lin.huang@rock-chips.com
Subject: Re: [PATCH v1 2/3] of: Add support for reading a s32 from a multi-value property.
Date: Mon, 22 Aug 2016 15:51:57 +0100	[thread overview]
Message-ID: <20160822145157.GD30850@leverpostej> (raw)
In-Reply-To: <1471639654.4611.2.camel@infradead.org>

On Fri, Aug 19, 2016 at 09:47:34PM +0100, David Woodhouse wrote:
> On Fri, 2016-08-19 at 22:41 +0200, Heiko Stuebner wrote:
> > 
> > > So no, don't *add* any more of these functions. Only add the generic
> > > version. And if your driver isn't using the generic property
> > > functions... fix it.
> > 
> > As far as I can see, all the device_property_* functions are grounded on their
> > of_property_*, acpi_property_* etc counterparts and functions reading specific
> > elements (the _index variants) are currently not available at all.
> > 
> > drivers/base/property.c:
> > #define OF_DEV_PROP_READ_ARRAY(node, propname, type, val, nval)                         \
> >         (val) ? of_property_read_##type##_array((node), (propname), (val), (nval))      \
> >               : of_property_count_elems_of_size((node), (propname), sizeof(type))
> > 
> > So even if you're using the device_property_* functions you'd still need
> > a match in the underlying functions or am I missing something?
> 
> Yes, but the underlying function should never be used directly by
> drivers. 

There are properties which never make sense with ACPI, and there are
drivers which shouldn't exist in the case of ACPI (due to clashes with
core ACPI functionality). So using of_property_* for those, and not
matching any ACPI tables is perfectly fine.

IMO, an of_property_read_s32_index() function is perfectly fine (as is
an ACPI-specific variant, or a unified helper, if that's useful to some
driver).

There is no need to force drivers to superficially appear to support
ACPI when they have not been designed with ACPI in mind, and are
unlikely to function in an ACPI environment.

Thanks,
Mark.

  parent reply	other threads:[~2016-08-22 14:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-16  2:38 [PATCH v1 0/3] PM / AVS: add Rockchip cpu avs Finlye Xiao
2016-08-16  2:38 ` [PATCH v1 1/3] nvmem: rockchip-efuse: Change initcall to subsys Finlye Xiao
     [not found] ` <1471315139-28285-1-git-send-email-finley.xiao-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-08-16  2:38   ` [PATCH v1 2/3] of: Add support for reading a s32 from a multi-value property Finlye Xiao
     [not found]     ` <1471315139-28285-3-git-send-email-finley.xiao-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-08-16 12:09       ` Heiko Stübner
2016-08-19 14:15       ` David Woodhouse
2016-08-19 20:41         ` Heiko Stuebner
2016-08-19 20:47           ` David Woodhouse
     [not found]             ` <1471639654.4611.2.camel-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2016-08-22 14:07               ` Finley Xiao
2016-08-22 14:51             ` Mark Rutland [this message]
2016-08-16  2:38   ` [PATCH v1 3/3] PM / AVS: rockchip-cpu-avs: add driver handling Rockchip cpu avs Finlye Xiao
2016-08-16  5:13     ` kbuild test robot
2016-08-16 17:24     ` Heiko Stübner
2016-08-17 13:59       ` Finley Xiao
     [not found]     ` <1471315139-28285-4-git-send-email-finley.xiao-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-08-19 13:36       ` Rob Herring
2016-08-23  4:10         ` Finley Xiao
2016-08-23  9:03           ` Heiko Stübner
2016-08-23  9:29             ` Finley Xiao
     [not found]               ` <4eab5b34-58f8-30bb-1a2c-0b0d6b3e2b2c-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-09-08 16:56                 ` Rob Herring

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=20160822145157.GD30850@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=dbaryshkov@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=finley.xiao@rock-chips.com \
    --cc=frowand.list@gmail.com \
    --cc=heiko@sntech.de \
    --cc=jay.xu@rock-chips.com \
    --cc=khilman@kernel.org \
    --cc=lin.huang@rock-chips.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=nm@ti.com \
    --cc=rjw@rjwysocki.net \
    --cc=robh+dt@kernel.org \
    --cc=rocky.hao@rock-chips.com \
    --cc=sboyd@codeaurora.org \
    --cc=sre@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tim.chen@rock-chips.com \
    --cc=tony.xie@rock-chips.com \
    --cc=ulysses.huang@rock-chips.com \
    --cc=viresh.kumar@linaro.org \
    --cc=wxt@rock-chips.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).