All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Vorontsov <cbouatmailru@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>, Greg KH <gregkh@suse.de>,
	Kay Sievers <kay.sievers@vrfy.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Maciej Rutecki <maciej.rutecki@gmail.com>,
	Daniel Mack <daniel@caiaq.de>
Subject: [GIT PULL] battery-2.6.git
Date: Tue, 25 May 2010 14:27:22 +0400	[thread overview]
Message-ID: <20100525102722.GA2613@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20100525070844.GV30801@buzzloop.caiaq.de>

Hello Linus,

Please pull from

  git://git.infradead.org/battery-2.6.git master

to receive a fixup for regression reported by Rafael J. Wysocki
http://lkml.org/lkml/2010/5/24/273

Thanks!

commit bbabb158f0e9d41174ae5c2183a8e4f981daf6ce
Author: Daniel Mack <daniel@caiaq.de>
Date:   Tue May 25 02:39:45 2010 +0200

    power_supply: Fix regression for 'type' property
    
    Commit 5f487cd34f4337f9bc27ca19da72a39d1b0a0ab4 (power_supply: Use
    attribute groups) causes a regression the power supply core does not
    export the 'type' attribute anymore.
    
    POWER_SUPPLY_PROP_TYPE is handled by the power supply core without the
    low-level driver, so power_supply_attr_is_visible() must always return
    the entry as readable.
    
    Reported-by: Rafael J. Wysocki <rjw@sisk.pl>
    Signed-off-by: Daniel Mack <daniel@caiaq.de>
    Tested-by: Rafael J. Wysocki <rjw@sisk.pl>
    Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>

diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c
index 6a86cdf..9d30eeb 100644
--- a/drivers/power/power_supply_sysfs.c
+++ b/drivers/power/power_supply_sysfs.c
@@ -179,14 +179,16 @@ static mode_t power_supply_attr_is_visible(struct kobject *kobj,
 {
 	struct device *dev = container_of(kobj, struct device, kobj);
 	struct power_supply *psy = dev_get_drvdata(dev);
+	mode_t mode = S_IRUSR | S_IRGRP | S_IROTH;
 	int i;
 
+	if (attrno == POWER_SUPPLY_PROP_TYPE)
+		return mode;
+
 	for (i = 0; i < psy->num_properties; i++) {
 		int property = psy->properties[i];
 
 		if (property == attrno) {
-			mode_t mode = S_IRUSR | S_IRGRP | S_IROTH;
-
 			if (psy->property_is_writeable &&
 			    psy->property_is_writeable(psy, property) > 0)
 				mode |= S_IWUSR;

  reply	other threads:[~2010-05-25 10:27 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-24 22:28 [Regression] Commit "power_supply: Use attribute groups" breaks KDE battery monitor on openSUSE 11.3 M6 Rafael J. Wysocki
2010-05-24 22:32 ` Daniel Mack
2010-05-24 23:03   ` Rafael J. Wysocki
2010-05-25  0:20     ` Rafael J. Wysocki
2010-05-25  0:47       ` Daniel Mack
2010-05-25  0:55         ` Rafael J. Wysocki
2010-05-25  7:08           ` Daniel Mack
2010-05-25 10:27             ` Anton Vorontsov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-08-11  5:17 [GIT PULL] battery-2.6.git Anton Vorontsov
2010-10-26 14:41 Anton Vorontsov
2011-01-14 15:43 Anton Vorontsov
2011-03-24 14:58 Anton Vorontsov
2011-05-27 10:54 Anton Vorontsov
2011-05-27 11:10 ` David Woodhouse
2011-05-27 12:45   ` Anton Vorontsov
2011-07-31 10:40 Anton Vorontsov
2012-01-11  0:31 Anton Vorontsov
2012-03-30 20:50 Anton Vorontsov
2012-05-31  1:08 Anton Vorontsov
2012-05-31  1:17 ` Stephen Rothwell
2012-05-31 19:13 ` Linus Torvalds
2012-07-31 13:05 Anton Vorontsov
2012-10-05  3:04 Anton Vorontsov
2012-12-12 10:22 Anton Vorontsov
2013-02-19  7:09 Anton Vorontsov
2013-04-30  5:14 Anton Vorontsov
2013-05-25 22:23 Anton Vorontsov
2013-05-25 23:23 ` David Woodhouse
2013-05-25 22:39   ` Anton Vorontsov
2013-07-09  1:39 Anton Vorontsov
2013-09-11  5:24 Anton Vorontsov
2013-11-18  2:08 Anton Vorontsov
2014-01-03  9:27 Anton Vorontsov
2014-01-21 17:54 Dmitry Eremin-Solenikov

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=20100525102722.GA2613@oksana.dev.rtsoft.ru \
    --to=cbouatmailru@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=daniel@caiaq.de \
    --cc=gregkh@suse.de \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.rutecki@gmail.com \
    --cc=rjw@sisk.pl \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.