From: Philipp Zabel <p.zabel@pengutronix.de>
To: dinguyen@opensource.altera.com
Cc: dinh.linux@gmail.com, atull@opensource.altera.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] reset: add reset_control_status helper function
Date: Thu, 09 Oct 2014 10:44:00 +0200 [thread overview]
Message-ID: <1412844240.6809.1.camel@pengutronix.de> (raw)
In-Reply-To: <1412808351-4598-1-git-send-email-dinguyen@opensource.altera.com>
Hi Dinh,
thank you for the patch. Just two small issues below:
Am Mittwoch, den 08.10.2014, 17:45 -0500 schrieb dinguyen@opensource.altera.com:
[...]
> @@ -126,6 +126,19 @@ int reset_control_deassert(struct reset_control *rstc)
> EXPORT_SYMBOL_GPL(reset_control_deassert);
>
> /**
> + * reset_control_status - returns a status of a reset bit
> + * @rstc: reset controller
> + */
> +unsigned int reset_control_status(struct reset_control *rstc)
> +{
> + if (rstc->rcdev->ops->status)
> + return rstc->rcdev->ops->status(rstc->rcdev, rstc->id);
> +
> + return -ENOSYS;
> +}
> +EXPORT_SYMBOL_GPL(reset_control_status);
Since this function can return negative error numbers, please make the
return value of reset_control_status int. That also means that drivers
must not set the MSB when returning status.
> +
> +/**
> * of_reset_control_get - Lookup and obtain a reference to a reset controller.
> * @node: device to be reset by the controller
> * @id: reset line name
> diff --git a/include/linux/reset-controller.h b/include/linux/reset-controller.h
> index 41a4695..8e659d5 100644
> --- a/include/linux/reset-controller.h
> +++ b/include/linux/reset-controller.h
> @@ -17,6 +17,7 @@ struct reset_control_ops {
> int (*reset)(struct reset_controller_dev *rcdev, unsigned long id);
> int (*assert)(struct reset_controller_dev *rcdev, unsigned long id);
> int (*deassert)(struct reset_controller_dev *rcdev, unsigned long id);
> + unsigned int (*status)(struct reset_controller_dev *rcdev, unsigned long id);
> };
Please change the return value of the status callback to int and
describe it in the kerneldoc comment above. It should probably be
mentioned that the returned status value must be >= 0 except in error
cases.
regards
Philipp
next prev parent reply other threads:[~2014-10-09 8:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-08 22:45 dinguyen
2014-10-09 8:44 ` Philipp Zabel [this message]
2014-10-09 13:17 ` Dinh Nguyen
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=1412844240.6809.1.camel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=atull@opensource.altera.com \
--cc=dinguyen@opensource.altera.com \
--cc=dinh.linux@gmail.com \
--cc=linux-kernel@vger.kernel.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