public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rodolfo Giometti <giometti@enneenne.com>
To: Paul Mundt <lethal@linux-sh.org>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.arm.linux.org.uk,
	linux-mips@linux-mips.org
Subject: [PATCH 1/1] APM-EMULATION: apm_get_power_status() should be NULL on init [was: Advice on battery support]
Date: Fri, 2 Feb 2007 22:27:41 +0100	[thread overview]
Message-ID: <20070202212741.GH8882@enneenne.com> (raw)
In-Reply-To: <20070201095904.GE8882@enneenne.com>

APM-EMULATION: apm_get_power_status() should be NULL on init.

Signed-off-by: Rodolfo Giometti <giometti@enneenne.com>

---

If the function apm_get_info() do like this:

   static int apm_get_info(char *buf, char **start, off_t fpos, int length)
   {
           struct apm_power_info info;
           char *units;
           int ret;

           info.ac_line_status = 0xff;
           info.battery_status = 0xff;
           info.battery_flag   = 0xff;
           info.battery_life   = -1;
           info.time           = -1;
           info.units          = -1;

           if (apm_get_power_status)
                   apm_get_power_status(&info);
   ...

we shouldn't set:

   static void __apm_get_power_status(struct apm_power_info *info)
   {
   }

   void (*apm_get_power_status)(struct apm_power_info *) = __apm_get_power_status;

otherwise the check is not needed. Furthermore setting the function to
NULL signals that the apm-emulation layer is not already assigned (I
found this very useful for my apm-emulation battery_class support).

  parent reply	other threads:[~2007-02-02 21:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-29 23:07 Advice on APM-EMU reunion Rodolfo Giometti
2007-01-29 23:53 ` Richard Purdie
2007-01-29 23:59   ` Rodolfo Giometti
2007-01-30  1:00 ` Paul Mundt
2007-01-30 14:05   ` Ralf Baechle
2007-02-01  9:59   ` Advice on battery support [was: Advice on APM-EMU reunion] Rodolfo Giometti
2007-02-01 18:19     ` Matt Reimer
2007-02-02 21:27     ` Rodolfo Giometti [this message]
2007-02-02 21:35     ` Pavel Machek

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=20070202212741.GH8882@enneenne.com \
    --to=giometti@enneenne.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.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