login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
May
»
4
Re: [PATCH] hwmon: applesmc: Add temperature sensor labels to sysfs interface
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Jean Delvare
Subject:
Re: [PATCH] hwmon: applesmc: Add temperature sensor labels to sysfs interface
Date: Tuesday, May 4, 2010 - 3:06 am
Hi Henrik, On Tue, 4 May 2010 11:55:29 +0200, Henrik Rydberg wrote:
quoted text
> From: Alex Murray <murray.alex@gmail.com> > > The Apple SMC uses a systematic labeling scheme for the hardware > temperature sensors. This scheme is currently hidden from > userland. Since the sensor set, and consequently the numbering, > differs between models, an extensive database of configurations is > required for an application such as fan control. This patch adds the > SMC labels to the hwmon sysfs interface, allowing applications to use > the sensors more intelligibly.
I like the idea.
quoted text
> Signed-off-by: Alex Murray <murray.alex@gmail.com> > Signed-off-by: Henrik Rydberg <rydberg@euromail.se> > --- > drivers/hwmon/applesmc.c | 145 +++++++++++++++++++++++++++++++++++++++++++++- > 1 files changed, 144 insertions(+), 1 deletions(-) > > diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c > index 36a0d62..8be86ef 100644 > --- a/drivers/hwmon/applesmc.c > +++ b/drivers/hwmon/applesmc.c > (...) > @@ -1252,6 +1387,9 @@ static struct attribute *temperature_attributes[] = { > static const struct attribute_group temperature_attributes_group = > { .attrs = temperature_attributes }; > > +static const struct attribute_group label_attributes_group = { > + .attrs = label_attributes > +};
Missing blank like.
quoted text
> /* Module stuff */ > > /* > @@ -1568,7 +1706,8 @@ static int __init applesmc_init(void) > for (i = 0; > temperature_sensors_sets[applesmc_temperature_set][i] != NULL; > i++) { > - if (temperature_attributes[i] == NULL) { > + if (temperature_attributes[i] == NULL || > + label_attributes[i] == NULL) { > printk(KERN_ERR "applesmc: More temperature sensors " > "in temperature_sensors_sets (at least %i)" > "than available sysfs files in " > @@ -1578,6 +1717,8 @@ static int __init applesmc_init(void) > } > ret = sysfs_create_file(&pdev->dev.kobj, > temperature_attributes[i]);
Missing error handling.
quoted text
> + ret = sysfs_create_file(&pdev->dev.kobj, > + label_attributes[i]); > if (ret) > goto out_temperature; > }
Other than that, the patch looks good. -- Jean Delvare --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] hwmon: applesmc: Add temperature sensor labels to ...
, Henrik Rydberg
, (Tue May 4, 2:55 am)
Re: [PATCH] hwmon: applesmc: Add temperature sensor labels ...
, Jean Delvare
, (Tue May 4, 3:06 am)
Re: [PATCH] hwmon: applesmc: Add temperature sensor labels ...
, Henrik Rydberg
, (Tue May 4, 4:15 am)
Re: [PATCH] hwmon: applesmc: Add temperature sensor labels ...
, Jean Delvare
, (Tue May 4, 4:32 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
David Lang
Re: [patch] MTD: fix DOC2000/2001/2001PLUS build error
Steven Rostedt
Re: [PATCH] input: Fix interrupt enable in i8042_ctr when enabling interrupt fails
Linus Torvalds
Re: [patch] epoll use a single inode ...
David Miller
Re: tg3: unable to handle null pointer dereference
Frank Seidel
Re: [RFC 13/13] Char: nozomi, cleanup read and write
git-commits-head
:
Linux Kernel Mailing List
amba: struct device - replace bus_id with dev_name(), dev_set_name()
Linux Kernel Mailing List
cpumask: make irq_set_affinity() take a const struct cpumask
Linux Kernel Mailing List
cgroups: fix probable race with put_css_set[_taskexit] and find_css_set
Linux Kernel Mailing List
[libata] Export ata_pio_queue_task() so that it can be used from sata_mv.
Linux Kernel Mailing List
[ARM] 5209/1: metronomefb: changes to use platform framebuffer
git
:
Junio C Hamano
Re: mingw, windows, crlf/lf, and git
Junio C Hamano
Re: [PATCH 1/2] Teach git-describe to display distances from tags.
Daniel Barkalow
Re: git and mtime
Linus Torvalds
Re: [PATCH] Teach 'git pull' the '--rebase' option
Alex Riesen
Re: Easy shell question: how to make a script killing all his childs when killed?
freebsd-current
:
Mark Linimon
Why the FreeBSD license will not be changing
Michael Moll
Re: Unable to boot on ECS K7S5A
FreeBSD Tinderbox
[head tinderbox] failure on ia64/ia64
Jille Timmermans
Re: svn commit: r185482 - head/sys/dev/ath/ath_rate/sample
Hayer, Sukhjinder
8_CURRENT boot problem
linux-netdev
:
Timo Teräs
ip xfrm policy semantics
Andi Kleen
Re: [ANNOUNCE]: First release of nftables
John P Poet
Realtek 8111C transmit timed out
Jeff Garzik
Re: [PATCH] fix netxen_pci_tbl[] breakage
Jesper Dangaard Brouer
[PATCH] iputils: arping fails to set correct broadcast address
Colocation donated by:
Syndicate