public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Dominik Brodowski <linux@dominikbrodowski.net>
To: Pavel Machek <pavel@ucw.cz>
Cc: Patrick Mochel <mochel@digitalimplant.org>,
	Andrew Morton <akpm@osdl.org>,
	Linux-pm mailing list <linux-pm@lists.osdl.org>,
	kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [linux-pm] [patch] pm: fix runtime powermanagement's /sys interface
Date: Thu, 5 Jan 2006 23:27:05 +0100	[thread overview]
Message-ID: <20060105222705.GA12242@isilmar.linta.de> (raw)
In-Reply-To: <20060105222338.GG2095@elf.ucw.cz>

On Thu, Jan 05, 2006 at 11:23:38PM +0100, Pavel Machek wrote:
> > In addition, your patch breaks pcmcia / pcmciautils which already uses
> > numbers (which I already had to change from "3" to "2" before...).
> 
> pcmcia actually uses this? Ouch. Do you just read the power file, or
> do you write to it, too?

Reading and writing. Replacement for "cardctl suspend" and "cardctl resume".


static int pccardctl_power_one(unsigned long socket_no, unsigned int device,
                               unsigned int power)
{
        int ret;
        char file[SYSFS_PATH_MAX];
        struct sysfs_attribute *attr;

        snprintf(file, SYSFS_PATH_MAX,
                 "/sys/bus/pcmcia/devices/%lu.%u/power/state",
                 socket_no, device);

        attr = sysfs_open_attribute(file);
        if (!attr)
                return -ENODEV;

        ret = sysfs_write_attribute(attr, power ? "2" : "0", 1);

        sysfs_close_attribute(attr);

        return (ret);
}


NB: it will break one day, one way or another, when gregkh makes the
/sys/class -> /sys/devices conversion. However, I'd want to try not to break
the new pcmciautils userspace too often...

	Dominik

  reply	other threads:[~2006-01-05 22:27 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-27 21:34 [patch] pm: fix runtime powermanagement's /sys interface Pavel Machek
2005-12-27 21:55 ` Dmitry Torokhov
2005-12-27 22:05   ` Pavel Machek
2005-12-28  4:22     ` Patrick Mochel
2006-01-04 21:34       ` [linux-pm] " Pavel Machek
2006-01-04 22:06         ` Alan Stern
2006-01-04 22:16           ` [linux-pm] " Pavel Machek
2006-01-05 21:43           ` Patrick Mochel
2006-01-05 22:06             ` [linux-pm] " Alan Stern
2006-01-05 22:28               ` Pavel Machek
2006-01-05 21:42         ` [linux-pm] " Patrick Mochel
2006-01-05 21:55           ` Pavel Machek
2006-01-05 22:13             ` [linux-pm] " Dominik Brodowski
2006-01-05 22:23               ` Pavel Machek
2006-01-05 22:27                 ` Dominik Brodowski [this message]
2006-01-05 22:59                   ` Pavel Machek
2006-01-05 23:08                   ` Pavel Machek
2006-01-05 23:46                     ` [linux-pm] " Dominik Brodowski
2006-01-05 23:58                       ` Pavel Machek
2006-01-06  0:04                         ` Patrick Mochel
2006-01-06  0:12                           ` Pavel Machek
2006-01-06  1:37                             ` Patrick Mochel
2006-01-06  8:59                               ` Pavel Machek
2006-01-07  5:47                                 ` Adam Belay
2006-01-06  9:00                               ` Pavel Machek
2006-01-06 15:00                               ` Dominik Brodowski
2006-01-07  5:58                                 ` Adam Belay
2006-01-06 15:42                               ` Alan Stern
2006-01-07  0:08                                 ` Pavel Machek
2006-01-07  3:19                                   ` Alan Stern
2006-01-07  7:58                                   ` Adam Belay
2006-01-07 10:20                                     ` Pavel Machek
2006-01-07 13:06                                       ` Adam Belay
2006-01-06  4:17                                         ` Pavel Machek
2006-01-07  7:41                                 ` [linux-pm] " Adam Belay
2006-01-07 15:24                                   ` Alan Stern
2006-01-06  1:10                           ` Dominik Brodowski
2006-01-06  8:53                             ` Pavel Machek
2006-01-06  0:38                   ` Greg KH
2006-01-06 15:03                     ` Dominik Brodowski
2006-01-06 16:25                       ` Kay Sievers
2006-01-09 20:10                         ` [linux-pm] " Dominik Brodowski
2006-01-05 22:15             ` Patrick Mochel
2006-01-05 22:44               ` Pavel Machek
2006-01-05 23:54                 ` Patrick Mochel
2006-01-06  0:07                   ` [linux-pm] " Pavel Machek
2006-01-06 14:34             ` Tom Marshall
2006-01-06 16:20               ` Pavel Machek
2006-01-07  8:36         ` Adam Belay
2006-01-07 10:25           ` Pavel Machek
2006-01-07 12:45             ` Adam Belay
2006-01-06  4:24               ` Pavel Machek
2006-01-13 20:00                 ` Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2006-01-05 15:16 Scott E. Preece
2006-01-05 16:41 ` [linux-pm] " Alan Stern
2006-01-05 21:14   ` Pavel Machek
2006-01-05 21:37     ` Alan Stern
2006-01-05 21:44       ` Pavel Machek
2006-01-05 21:48 ` Patrick Mochel
2006-01-05 22:13 Preece Scott-PREECE

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=20060105222705.GA12242@isilmar.linta.de \
    --to=linux@dominikbrodowski.net \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.osdl.org \
    --cc=mochel@digitalimplant.org \
    --cc=pavel@ucw.cz \
    /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