projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[powerpc.git]
/
drivers
/
acpi
/
ac.c
diff --git
a/drivers/acpi/ac.c
b/drivers/acpi/ac.c
index
24ccf81
..
37c7dc4
100644
(file)
--- a/
drivers/acpi/ac.c
+++ b/
drivers/acpi/ac.c
@@
-35,7
+35,6
@@
#define ACPI_AC_COMPONENT 0x00020000
#define ACPI_AC_CLASS "ac_adapter"
#define ACPI_AC_HID "ACPI0003"
#define ACPI_AC_COMPONENT 0x00020000
#define ACPI_AC_CLASS "ac_adapter"
#define ACPI_AC_HID "ACPI0003"
-#define ACPI_AC_DRIVER_NAME "ACPI AC Adapter Driver"
#define ACPI_AC_DEVICE_NAME "AC Adapter"
#define ACPI_AC_FILE_STATE "state"
#define ACPI_AC_NOTIFY_STATUS 0x80
#define ACPI_AC_DEVICE_NAME "AC Adapter"
#define ACPI_AC_FILE_STATE "state"
#define ACPI_AC_NOTIFY_STATUS 0x80
@@
-44,10
+43,10
@@
#define ACPI_AC_STATUS_UNKNOWN 0xFF
#define _COMPONENT ACPI_AC_COMPONENT
#define ACPI_AC_STATUS_UNKNOWN 0xFF
#define _COMPONENT ACPI_AC_COMPONENT
-ACPI_MODULE_NAME("ac
pi_ac")
+ACPI_MODULE_NAME("ac
");
-
MODULE_AUTHOR("Paul Diefenbaugh");
-MODULE_DESCRIPTION(
ACPI_AC_DRIVER_NAME
);
+MODULE_AUTHOR("Paul Diefenbaugh");
+MODULE_DESCRIPTION(
"ACPI AC Adapter Driver"
);
MODULE_LICENSE("GPL");
extern struct proc_dir_entry *acpi_lock_ac_dir(void);
MODULE_LICENSE("GPL");
extern struct proc_dir_entry *acpi_lock_ac_dir(void);
@@
-58,7
+57,7
@@
static int acpi_ac_remove(struct acpi_device *device, int type);
static int acpi_ac_open_fs(struct inode *inode, struct file *file);
static struct acpi_driver acpi_ac_driver = {
static int acpi_ac_open_fs(struct inode *inode, struct file *file);
static struct acpi_driver acpi_ac_driver = {
- .name =
ACPI_AC_DRIVER_NAME
,
+ .name =
"ac"
,
.class = ACPI_AC_CLASS,
.ids = ACPI_AC_HID,
.ops = {
.class = ACPI_AC_CLASS,
.ids = ACPI_AC_HID,
.ops = {
@@
-72,7
+71,7
@@
struct acpi_ac {
unsigned long state;
};
unsigned long state;
};
-static struct file_operations acpi_ac_fops = {
+static
const
struct file_operations acpi_ac_fops = {
.open = acpi_ac_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.open = acpi_ac_open_fs,
.read = seq_read,
.llseek = seq_lseek,
@@
-109,7
+108,7
@@
static struct proc_dir_entry *acpi_ac_dir;
static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
{
static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
{
- struct acpi_ac *ac =
(struct acpi_ac *)
seq->private;
+ struct acpi_ac *ac = seq->private;
if (!ac)
if (!ac)
@@
-187,7
+186,7
@@
static int acpi_ac_remove_fs(struct acpi_device *device)
static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
{
static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
{
- struct acpi_ac *ac =
(struct acpi_ac *)
data;
+ struct acpi_ac *ac = data;
struct acpi_device *device = NULL;
struct acpi_device *device = NULL;
@@
-221,10
+220,9
@@
static int acpi_ac_add(struct acpi_device *device)
if (!device)
return -EINVAL;
if (!device)
return -EINVAL;
- ac = k
m
alloc(sizeof(struct acpi_ac), GFP_KERNEL);
+ ac = k
z
alloc(sizeof(struct acpi_ac), GFP_KERNEL);
if (!ac)
return -ENOMEM;
if (!ac)
return -ENOMEM;
- memset(ac, 0, sizeof(struct acpi_ac));
ac->device = device;
strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME);
ac->device = device;
strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME);
@@
-269,7
+267,7
@@
static int acpi_ac_remove(struct acpi_device *device, int type)
if (!device || !acpi_driver_data(device))
return -EINVAL;
if (!device || !acpi_driver_data(device))
return -EINVAL;
- ac =
(struct acpi_ac *)
acpi_driver_data(device);
+ ac = acpi_driver_data(device);
status = acpi_remove_notify_handler(device->handle,
ACPI_ALL_NOTIFY, acpi_ac_notify);
status = acpi_remove_notify_handler(device->handle,
ACPI_ALL_NOTIFY, acpi_ac_notify);
@@
-285,6
+283,8
@@
static int __init acpi_ac_init(void)
{
int result;
{
int result;
+ if (acpi_disabled)
+ return -ENODEV;
acpi_ac_dir = acpi_lock_ac_dir();
if (!acpi_ac_dir)
acpi_ac_dir = acpi_lock_ac_dir();
if (!acpi_ac_dir)