devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Hauke Mehrtens <hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
Cc: Ralf Baechle <ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org>,
	Linux MIPS Mailing List
	<linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org>,
	"open list:MEMORY TECHNOLOGY..."
	<linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"martin.blumenstingl"
	<martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>,
	john <john-Pj+rj9U5foFAfugRpC6u6w@public.gmane.org>,
	linux-spi <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"hauke.mehrtens"
	<hauke.mehrtens-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Subject: Re: [PATCH v6 10/16] reset: Add a reset controller driver for the Lantiq XWAY based SoCs
Date: Fri, 30 Jun 2017 15:22:56 +0300	[thread overview]
Message-ID: <CAHp75Ve+oO7Zzk4jN3BOVCWWsEVki0yNQfpkfuw4Q5K85CMQHg@mail.gmail.com> (raw)
In-Reply-To: <20170629213951.31176-11-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>

On Fri, Jun 30, 2017 at 12:39 AM, Hauke Mehrtens <hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org> wrote:

> +static int lantiq_rcu_reset_update(struct reset_controller_dev *rcdev,
> +                                  unsigned long id, bool assert)
> +{
> +       struct lantiq_rcu_reset_priv *priv = to_lantiq_rcu_reset_priv(rcdev);
> +       unsigned int set = id & 0x1f;


> +       int ret;
> +       u32 val;
> +
> +       if (assert)
> +               val = BIT(set);
> +       else
> +               val = 0;

I would put this as

u32 val = assert ? BIT(set) : 0;
int ret;

...but it's up to you.

The rest looks fine.

> +
> +       ret = regmap_update_bits(priv->regmap, priv->reset_offset, BIT(set),
> +                                val);
> +       if (ret) {
> +               dev_err(priv->dev, "Failed to set reset bit %u\n", set);
> +               return ret;
> +       }
> +
> +
> +       ret = lantiq_rcu_reset_status_timeout(rcdev, id, assert);
> +       if (ret)
> +               dev_err(priv->dev, "Failed to %s bit %u\n",
> +                       assert ? "assert" : "deassert", set);
> +
> +       return ret;
> +}

-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-06-30 12:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29 21:39 [PATCH v6 00/16] MIPS: lantiq: handle RCU register by separate drivers Hauke Mehrtens
     [not found] ` <20170629213951.31176-1-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2017-06-29 21:39   ` [PATCH v6 01/16] MIPS: lantiq: Use of_platform_default_populate instead of __dt_register_buses Hauke Mehrtens
2017-06-29 21:39   ` [PATCH v6 02/16] mtd: lantiq-flash: drop check of boot select Hauke Mehrtens
2017-06-29 21:39   ` [PATCH v6 03/16] mtd: spi-falcon: " Hauke Mehrtens
2017-06-29 21:39   ` [PATCH v6 04/16] watchdog: lantiq: access boot cause register through regmap Hauke Mehrtens
2017-06-29 21:39   ` [PATCH v6 05/16] watchdog: lantiq: add device tree binding documentation Hauke Mehrtens
2017-06-29 21:39   ` [PATCH v6 06/16] MIPS: lantiq: Enable MFD_SYSCON to be able to use it for the RCU MFD Hauke Mehrtens
2017-06-29 21:39   ` [PATCH v6 07/16] Documentation: DT: MIPS: lantiq: Add docs for the RCU bindings Hauke Mehrtens
2017-06-29 21:39   ` [PATCH v6 08/16] MIPS: lantiq: Convert the fpi bus driver to a platform_driver Hauke Mehrtens
     [not found]     ` <20170629213951.31176-9-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2017-06-30 12:19       ` Andy Shevchenko
2017-06-29 21:39   ` [PATCH v6 09/16] MIPS: lantiq: remove ltq_reset_cause() and ltq_boot_select() Hauke Mehrtens
2017-06-29 21:39   ` [PATCH v6 10/16] reset: Add a reset controller driver for the Lantiq XWAY based SoCs Hauke Mehrtens
     [not found]     ` <20170629213951.31176-11-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org>
2017-06-30 12:22       ` Andy Shevchenko [this message]
2017-06-29 21:39   ` [PATCH v6 11/16] MIPS: lantiq: remove old reset controller implementation Hauke Mehrtens
2017-06-29 21:39   ` [PATCH v6 12/16] MIPS: lantiq: Add a GPHY driver which uses the RCU syscon-mfd Hauke Mehrtens
2017-06-29 21:39   ` [PATCH v6 13/16] MIPS: lantiq: remove old GPHY loader code Hauke Mehrtens
2017-06-29 21:39   ` [PATCH v6 14/16] phy: Add an USB PHY driver for the Lantiq SoCs using the RCU module Hauke Mehrtens
2017-06-29 21:39   ` [PATCH v6 15/16] MIPS: lantiq: remove old USB PHY initialisation Hauke Mehrtens
2017-06-29 21:39   ` [PATCH v6 16/16] MIPS: lantiq: Remove the arch/mips/lantiq/xway/reset.c implementation Hauke Mehrtens

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=CAHp75Ve+oO7Zzk4jN3BOVCWWsEVki0yNQfpkfuw4Q5K85CMQHg@mail.gmail.com \
    --to=andy.shevchenko-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org \
    --cc=hauke.mehrtens-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=john-Pj+rj9U5foFAfugRpC6u6w@public.gmane.org \
    --cc=linux-mips-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org \
    --cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org \
    --cc=p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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).