linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: p.zabel@pengutronix.de (Philipp Zabel)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 12/21] reset: uniphier: add core support for UniPhier reset driver
Date: Tue, 10 May 2016 15:54:57 +0200	[thread overview]
Message-ID: <1462888497.9155.9.camel@pengutronix.de> (raw)
In-Reply-To: <1462873862-30940-13-git-send-email-yamada.masahiro@socionext.com>

Am Dienstag, den 10.05.2016, 18:50 +0900 schrieb Masahiro Yamada:
[...]
> +static int uniphier_reset_update(struct reset_controller_dev *rcdev,
> +				 unsigned long id, bool assert)
> +{
> +	struct uniphier_reset_priv *priv = to_uniphier_reset_priv(rcdev);
> +	const struct uniphier_reset_data *p;
> +	bool handled = false;
> +
> +	for (p = priv->data; p->id != UNIPHIER_RESET_ID_END; p++) {
> +		unsigned int val;
> +		int ret;
> +
> +		if (p->id != id)
> +			continue;
> +
> +		val = p->deassert_val;
> +		if (assert)
> +			val = ~val;
> +
> +		ret = regmap_write_bits(priv->regmap, p->reg, p->mask, val);

What is the difference between mask and deassert_val? Couldn't you just
assign
	val = assert ? 0 : p->mask;
?

> +static const struct reset_control_ops uniphier_reset_ops = {
> +	.assert = uniphier_reset_assert,
> +	.deassert = uniphier_reset_deassert,
> +	.status = uniphier_reset_status,
> +};
> +
> +int uniphier_reset_probe(struct platform_device *pdev,
> +			 const struct uniphier_reset_data *data)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct uniphier_reset_priv *priv;
> +	const struct uniphier_reset_data *p;
> +	struct regmap *regmap;
> +	unsigned int nr_resets = 0;
> +
> +	/* parent should be MFD and syscon node */
> +	regmap = syscon_node_to_regmap(dev->parent->of_node);
> +	if (IS_ERR(regmap)) {
> +		dev_err(dev, "failed to get regmap\n");

syscon_node_to_regmap can return different error codes. It might be
helpful to use
	dev_err(dev, "failed to get regmap: %d\n", PTR_ERR(regmap));
here.

regards
Philipp

  reply	other threads:[~2016-05-10 13:54 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-10  9:50 [RFC PATCH 00/21] mfd, clock, reset: add UniPhier clock/reset driver support Masahiro Yamada
2016-05-10  9:50 ` [RFC PATCH 01/21] mfd: uniphier: add UniPhier MFD driver Masahiro Yamada
2016-05-10 11:26   ` Lee Jones
2016-05-11  1:51     ` Masahiro Yamada
2016-05-11  7:38       ` Lee Jones
2016-05-10  9:50 ` [RFC PATCH 02/21] clk: uniphier: add core support for UniPhier clock driver Masahiro Yamada
2016-05-10  9:50 ` [RFC PATCH 03/21] clk: uniphier: add clock driver for UniPhier PH1-LD4 SoC Masahiro Yamada
2016-05-10  9:50 ` [RFC PATCH 04/21] clk: uniphier: add clock driver for UniPhier PH1-Pro4 SoC Masahiro Yamada
2016-05-10  9:50 ` [RFC PATCH 05/21] clk: uniphier: add clock driver for UniPhier PH1-sLD8 SoC Masahiro Yamada
2016-05-10  9:50 ` [RFC PATCH 06/21] clk: uniphier: add clock driver for UniPhier PH1-Pro5 SoC Masahiro Yamada
2016-05-10  9:50 ` [RFC PATCH 07/21] clk: uniphier: add clock driver for UniPhier ProXstream2/PH1-LD6b SoC Masahiro Yamada
2016-05-10  9:50 ` [RFC PATCH 08/21] clk: uniphier: add clock driver for UniPhier PH1-LD11 SoC Masahiro Yamada
2016-05-10  9:50 ` [RFC PATCH 09/21] clk: uniphier: add clock driver for UniPhier PH1-LD20 SoC Masahiro Yamada
2016-05-10  9:50 ` [RFC PATCH 10/21] clk: uniphier: add clock driver for Media I/O block on UniPhier SoCs Masahiro Yamada
2016-05-10  9:50 ` [RFC PATCH 11/21] clk: uniphier: add clock driver for Peripheral " Masahiro Yamada
2016-05-10  9:50 ` [RFC PATCH 12/21] reset: uniphier: add core support for UniPhier reset driver Masahiro Yamada
2016-05-10 13:54   ` Philipp Zabel [this message]
2016-05-11  2:46     ` Masahiro Yamada
2016-05-11 10:34       ` Philipp Zabel
2016-05-10  9:50 ` [RFC PATCH 13/21] reset: uniphier: add reset driver for UniPhier PH1-LD4 SoC Masahiro Yamada
2016-05-10 12:25   ` Philipp Zabel
2016-05-11  2:52     ` Masahiro Yamada
2016-05-11 10:34       ` Philipp Zabel
2016-05-11 10:37         ` Philipp Zabel
2016-05-10  9:50 ` [RFC PATCH 14/21] reset: uniphier: add reset driver for UniPhier PH1-Pro4 SoC Masahiro Yamada
2016-05-10  9:50 ` [RFC PATCH 15/21] reset: uniphier: add reset driver for UniPhier PH1-sLD8 SoC Masahiro Yamada
2016-05-10  9:50 ` [RFC PATCH 16/21] reset: uniphier: add reset driver for UniPhier PH1-Pro5 SoC Masahiro Yamada
2016-05-10  9:50 ` [RFC PATCH 17/21] reset: uniphier: add reset driver for UniPhier ProXstream2/PH1-LD6b SoC Masahiro Yamada
2016-05-10  9:50 ` [RFC PATCH 18/21] reset: uniphier: add reset driver for UniPhier PH1-LD11 SoC Masahiro Yamada
2016-05-10  9:51 ` [RFC PATCH 19/21] reset: uniphier: add reset driver for UniPhier PH1-LD20 SoC Masahiro Yamada
2016-05-10  9:51 ` [RFC PATCH 20/21] reset: uniphier: add reset driver for Media I/O block on UniPhier SoCs Masahiro Yamada
2016-05-10  9:51 ` [RFC PATCH 21/21] reset: uniphier: add reset driver for Peripheral " Masahiro Yamada

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=1462888497.9155.9.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --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;
as well as URLs for NNTP newsgroup(s).