From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko 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 Message-ID: References: <20170629213951.31176-1-hauke@hauke-m.de> <20170629213951.31176-11-hauke@hauke-m.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <20170629213951.31176-11-hauke-5/S+JYg5SzeELgA04lAiVw@public.gmane.org> Sender: linux-spi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Hauke Mehrtens Cc: Ralf Baechle , Linux MIPS Mailing List , "open list:MEMORY TECHNOLOGY..." , linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree , "martin.blumenstingl" , john , linux-spi , "hauke.mehrtens" , Rob Herring , Philipp Zabel List-Id: devicetree@vger.kernel.org On Fri, Jun 30, 2017 at 12:39 AM, Hauke Mehrtens 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