From: Alexandru Gagniuc <alex.g@adaptrum.com>
To: Philipp Zabel <p.zabel@pengutronix.de>, linux-kernel@vger.kernel.org
Cc: Andre Przywara <andre.przywara@arm.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@st.com>,
Maxime Ripard <maxime.ripard@free-electrons.com>,
Chen-Yu Tsai <wens@csie.org>, Baoyou Xie <baoyou.xie@linaro.org>,
Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>,
Steffen Trumtrar <s.trumtrar@pengutronix.de>,
Dinh Nguyen <dinguyen@kernel.org>,
linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de
Subject: Re: [PATCH v2 2/5] reset: socfpga: use the reset-simple driver
Date: Fri, 11 Aug 2017 09:28:44 -0700 [thread overview]
Message-ID: <d1d06519-f676-5d36-2f82-e9537cef4f74@adaptrum.com> (raw)
In-Reply-To: <20170811130618.3676-3-p.zabel@pengutronix.de>
Hi Phillip,
On 08/11/2017 06:06 AM, Philipp Zabel wrote:
[snip]
> @@ -113,8 +137,33 @@ static int reset_simple_probe(struct platform_device *pdev)
> data->rcdev.ops = &reset_simple_ops;
> data->rcdev.of_node = dev->of_node;
>
> - if (devdata)
> + if (devdata == &reset_simple_socfpga) {
This sort of special-case handling opens the gate to adding special-case
handling for any new device, which somewhat defeats the purpose of a
generic driver.
> + u32 modrst_offset;
> +
> + /*
> + * The binding was mainlined without the required property.
> + * Do not continue, when we encounter an old DT.
> + */
> + if (!of_find_property(dev->of_node, "#reset-cells", NULL)) {
> + dev_err(dev, "%pOF missing #reset-cells property\n",
> + dev->of_node);
> + return -EINVAL;
> + }
Is the check still required in this context, since
(devm_)reset_control_get() complains really loudly if #reset-cells is
missing?
> +
> + if (of_property_read_u32(dev->of_node, "altr,modrst-offset",
> + &modrst_offset)) {
> + dev_warn(dev, "missing altr,modrst-offset property, assuming 0x10!\n");
> + modrst_offset = 0x10;
> + }
This can be a generic "reg-offset" property. If and until the
devicetrees are updated, "altr,modrst-offset" would also have to be read
as an alternative. Since a platform data already exists,
reset_simple_devdata could be a better place to store the default offset
of 0x10 for socfpga.
Alex
next prev parent reply other threads:[~2017-08-11 16:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-11 13:06 [PATCH v2 0/5] Unify simple reset drivers Philipp Zabel
2017-08-11 13:06 ` [PATCH v2 1/5] reset: add reset-simple to unify socfpga, stm32, sunxi, and zx2967 Philipp Zabel
2017-08-11 15:39 ` Dinh Nguyen
2017-08-11 15:59 ` Philipp Zabel
2017-08-11 15:51 ` Chen-Yu Tsai
2017-08-11 15:57 ` Philipp Zabel
2017-08-11 16:04 ` Alexandru Gagniuc
2017-08-11 16:37 ` Philipp Zabel
2017-08-14 13:45 ` Eugeniy Paltsev
2017-08-11 17:47 ` Alexandru Gagniuc
2017-08-14 7:26 ` Philipp Zabel
2017-08-11 13:06 ` [PATCH v2 2/5] reset: socfpga: use the reset-simple driver Philipp Zabel
2017-08-11 16:28 ` Alexandru Gagniuc [this message]
2017-08-11 16:50 ` Philipp Zabel
2017-08-11 13:06 ` [PATCH v2 3/5] reset: stm32: " Philipp Zabel
2017-08-11 13:06 ` [PATCH v2 4/5] reset: zx2967: " Philipp Zabel
2017-08-11 13:06 ` [PATCH v2 5/5] reset: simple: read back to make sure changes are applied Philipp Zabel
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=d1d06519-f676-5d36-2f82-e9537cef4f74@adaptrum.com \
--to=alex.g@adaptrum.com \
--cc=Eugeniy.Paltsev@synopsys.com \
--cc=alexandre.torgue@st.com \
--cc=andre.przywara@arm.com \
--cc=baoyou.xie@linaro.org \
--cc=dinguyen@kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.ripard@free-electrons.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=s.trumtrar@pengutronix.de \
--cc=wens@csie.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
Powered by JetHome