public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Darren Hart <dvhart@infradead.org>
To: Azael Avalos <coproscefalo@gmail.com>
Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] toshiba_acpi: Add set_fan_status function
Date: Fri, 24 Jul 2015 15:45:35 -0700	[thread overview]
Message-ID: <20150724224535.GA18926@vmdeb7> (raw)
In-Reply-To: <1437615474-27936-3-git-send-email-coproscefalo@gmail.com>

On Wed, Jul 22, 2015 at 07:37:48PM -0600, Azael Avalos wrote:
> This patch adds a new function named "set_fan_status" to complement
> its get* counterpart, as well as to avoid code duplication between
> "fan_proc_write" and "fan_store".

It also appears to change the error codes returned via sysfs?

Also adds some pr_ statements.

> 
> Signed-off-by: Azael Avalos <coproscefalo@gmail.com>
> ---
>  drivers/platform/x86/toshiba_acpi.c | 55 ++++++++++++++++++++++++-------------
>  1 file changed, 36 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
> index 6013a11..08fc867 100644
> --- a/drivers/platform/x86/toshiba_acpi.c
> +++ b/drivers/platform/x86/toshiba_acpi.c
> @@ -1422,12 +1422,33 @@ static const struct file_operations video_proc_fops = {
>  	.write		= video_proc_write,
>  };
>  
> +/* Fan status */
>  static int get_fan_status(struct toshiba_acpi_dev *dev, u32 *status)
>  {
> -	u32 hci_result;
> +	u32 result = hci_read(dev, HCI_FAN, status);
>  
> -	hci_result = hci_read(dev, HCI_FAN, status);
> -	return hci_result == TOS_SUCCESS ? 0 : -EIO;
> +	if (result == TOS_FAILURE)
> +		pr_err("ACPI call to get Fan status failed\n");

s/Fan/fan/

Below too.

> +	else if (result == TOS_NOT_SUPPORTED)
> +		return -ENODEV;

This condition would have returned -EIO previously correct?

I agree this new one is the right change, but it does pose a risk to userspace.
There is a slim chance we will have to revert if someone complains and can't
work around it, so we need to be clear about this in the commit message at the
very least.
-- 
Darren Hart
Intel Open Source Technology Center

  reply	other threads:[~2015-07-24 22:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-23  1:37 [PATCH 1/1] toshiba_acpi: Reorder toshiba_acpi_alt_keymap entries Azael Avalos
2015-07-23  1:37 ` [PATCH 1/1] toshiba_acpi: Remove unused wireless defines Azael Avalos
2015-07-23  1:37 ` [PATCH 1/1] toshiba_acpi: Add set_fan_status function Azael Avalos
2015-07-24 22:45   ` Darren Hart [this message]
2015-07-24 23:40     ` Azael Avalos
2015-07-23  1:37 ` [PATCH] toshiba_acpi: Change some variables to avoid warnings the ninja-check script Azael Avalos
2015-07-23  1:37 ` [PATCH 0/4] toshiba_acpi: Refactor *{get, set} and *available functions Azael Avalos
2015-07-23  1:37 ` [PATCH 1/4] toshiba_acpi: Change *available functions return type Azael Avalos
2015-07-23  1:37 ` [PATCH 2/4] toshiba_acpi: Remove "*not supported" feature prints Azael Avalos
2015-07-23  1:37 ` [PATCH 3/4] toshiba_acpi: Refactor *{get, set} functions return value Azael Avalos
2015-07-23  1:37 ` [PATCH 4/4] toshiba_acpi: Bump driver version to 0.23 Azael Avalos

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=20150724224535.GA18926@vmdeb7 \
    --to=dvhart@infradead.org \
    --cc=coproscefalo@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@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