public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Seth Forshee <seth.forshee@canonical.com>
Cc: Matthew Garrett <mjg@redhat.com>,
	Azael Avalos <coproscefalo@gmail.com>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/6] toshiba_acpi: Convert to use acpi_driver
Date: Tue, 20 Sep 2011 15:17:57 -0700	[thread overview]
Message-ID: <1316557078.1903.11.camel@Joe-Laptop> (raw)
In-Reply-To: <1316555754-25949-2-git-send-email-seth.forshee@canonical.com>

On Tue, 2011-09-20 at 16:55 -0500, Seth Forshee wrote:
> Changes toshiba_acpi to register an acpi driver and eliminates the
> platform device it was using.

Just trivial comments...

> diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c
> +static acpi_status hci_raw(struct toshiba_acpi_dev *dev,
> +			   const u32 in[HCI_WORDS], u32 out[HCI_WORDS])
[]
> @@ -237,85 +234,79 @@ static acpi_status hci_raw(const u32 in[HCI_WORDS], u32 out[HCI_WORDS])
>   * may be useful (such as "not supported").
>   */
>  
> -static acpi_status hci_write1(u32 reg, u32 in1, u32 * result)
> +static acpi_status hci_write1(struct toshiba_acpi_dev *dev, u32 reg,
> +			      u32 in1, u32 *result)
>  {
>  	u32 in[HCI_WORDS] = { HCI_SET, reg, in1, 0, 0, 0 };

A lot of the in[HCI_WORDS] could be static const or const

	static const u32 in[HCI_WORDS] etc...

> +static acpi_status hci_read1(struct toshiba_acpi_dev *dev, u32 reg,
> +			     u32 *out1, u32 *result)
>  {
>  	u32 in[HCI_WORDS] = { HCI_GET, reg, 0, 0, 0, 0 };

here too.

>  	u32 out[HCI_WORDS];
> -	acpi_status status = hci_raw(in, out);
> +	acpi_status status = hci_raw(dev, in, out);
>  	*out1 = out[2];
>  	*result = (status == AE_OK) ? out[0] : HCI_FAILURE;
>  	return status;
>  }
>  
> -static acpi_status hci_write2(u32 reg, u32 in1, u32 in2, u32 *result)
> +static acpi_status hci_write2(struct toshiba_acpi_dev *dev, u32 reg,
> +			      u32 in1, u32 in2, u32 *result)
>  {
>  	u32 in[HCI_WORDS] = { HCI_SET, reg, in1, in2, 0, 0 };

const etc.

> @@ -507,8 +486,13 @@ static int get_lcd(struct backlight_device *bd)
>  
>  static int lcd_proc_show(struct seq_file *m, void *v)
>  {
> -	int value = get_lcd(NULL);
> +	struct toshiba_acpi_dev *dev = m->private;
> +	int value;
> +
> +	if (!dev->backlight_dev)
> +		return -ENODEV;
>  
> +	value = get_lcd(dev->backlight_dev);
>  	if (value >= 0) {
>  		seq_printf(m, "brightness:              %d\n", value);
>  		seq_printf(m, "brightness_levels:       %d\n",

Some small amount space could be saved by using:

		seq_printf(m, "%-24s %d\n", "brightness:", value);
		seq_printf(m, "%-24s %d\n", "brightness_levels:", etc...
[]
> @@ -675,13 +663,14 @@ static const struct file_operations video_proc_fops = {
>  
>  static int fan_proc_show(struct seq_file *m, void *v)
>  {
> +	struct toshiba_acpi_dev *dev = m->private;
>  	u32 hci_result;
>  	u32 value;
>  
> -	hci_read1(HCI_FAN, &value, &hci_result);
> +	hci_read1(dev, HCI_FAN, &value, &hci_result);
>  	if (hci_result == HCI_SUCCESS) {
>  		seq_printf(m, "running:                 %d\n", (value > 0));

Here too:

		seq_printf(m, "%-24s %d\n", "running:", (value > 0);

> -		seq_printf(m, "force_on:                %d\n", force_fan);
> +		seq_printf(m, "force_on:                %d\n", dev->force_fan);

etc.



  reply	other threads:[~2011-09-20 22:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-20 21:55 [PATCH 0/6] toshiba_acpi: Cleanup and TOS1900 device support Seth Forshee
2011-09-20 21:55 ` [PATCH 1/6] toshiba_acpi: Convert to use acpi_driver Seth Forshee
2011-09-20 22:17   ` Joe Perches [this message]
2011-09-21  7:31     ` Corentin Chary
2011-09-21 12:52     ` Seth Forshee
2011-09-21  7:28   ` Corentin Chary
2011-09-21 13:24     ` Seth Forshee
2011-09-21 13:30       ` Corentin Chary
2011-09-21 15:13         ` Azael Avalos
2011-09-21 15:35     ` Matthew Garrett
2011-09-20 21:55 ` [PATCH 2/6] toshiba_acpi: Fix up return codes Seth Forshee
2011-09-20 21:55 ` [PATCH 3/6] toshiba_acpi: Use handle for HCI calls Seth Forshee
2011-09-20 21:55 ` [PATCH 4/6] toshiba_acpi: Support SPFC as an HCI method Seth Forshee
2011-09-20 21:55 ` [PATCH 5/6] toshiba_acpi: Don't add devices for unsupported features Seth Forshee
2011-09-20 21:55 ` [PATCH 6/6] toshiba_acpi: Initialize brightness in backlight device Seth Forshee
2011-09-21 15:31 ` [PATCH 0/6] toshiba_acpi: Cleanup and TOS1900 device support Matthew Garrett
2011-09-21 16:10   ` Seth Forshee
2011-10-26 13:54     ` Seth Forshee
2011-10-26 16:58       ` 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=1316557078.1903.11.camel@Joe-Laptop \
    --to=joe@perches.com \
    --cc=coproscefalo@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg@redhat.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=seth.forshee@canonical.com \
    /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