Commit 0b887d03 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (30 commits)
  ACPI: work around duplicate name "VID" problem on T61
  acpiphp_ibm: add missing '\n' to error message
  ACPI: add dump_stack() to trace acpi_format_exception programming errors
  make drivers/acpi/scan.c:create_modalias() static
  ACPI: Fix a warning of discarding qualifiers from pointer target type
  ACPI: "ACPI handle has no context!" should be KERN_DEBUG
  ACPI video hotkey: export missing ACPI video hotkey events via input layer
  ACPI: Validate XSDT, use RSDT if XSDT fails
  ACPI: /proc/acpi/thermal_zone trip points are now read-only, mark them as such
  ACPI: fix ia64 allnoconfig build
  PNP: remove null pointer checks
  PNP: remove MODULE infrastructure
  ISAPNP: removed unused isapnp_detected and ISAPNP_DEBUG
  PNPACPI: remove unnecessary casts of "void *"
  PNPACPI: simplify irq_flags()
  PNP: fix up after Lindent
  ACPI: enable GPEs before calling _WAK on resume
  asus-laptop: Fix rmmod of asus_laptop
  sony-laptop: call sonypi_compat_init earlier
  sony-laptop: enable Vaio FZ events
  ...
parents d1caeb02 136c4bbf
...@@ -126,6 +126,7 @@ const char *acpi_format_exception(acpi_status status) ...@@ -126,6 +126,7 @@ const char *acpi_format_exception(acpi_status status)
"Unknown exception code: 0x%8.8X", status)); "Unknown exception code: 0x%8.8X", status));
exception = "UNKNOWN_STATUS_CODE"; exception = "UNKNOWN_STATUS_CODE";
dump_stack();
} }
return (ACPI_CAST_PTR(const char, exception)); return (ACPI_CAST_PTR(const char, exception));
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/input.h>
#include <linux/backlight.h> #include <linux/backlight.h>
#include <linux/video_output.h> #include <linux/video_output.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -138,6 +138,8 @@ struct acpi_video_bus { ...@@ -138,6 +138,8 @@ struct acpi_video_bus {
struct semaphore sem; struct semaphore sem;
struct list_head video_device_list; struct list_head video_device_list;
struct proc_dir_entry *dir; struct proc_dir_entry *dir;
struct input_dev *input;
char phys[32]; /* for input device */
}; };
struct acpi_video_device_flags { struct acpi_video_device_flags {
...@@ -1764,6 +1766,9 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data) ...@@ -1764,6 +1766,9 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data)
{ {
struct acpi_video_bus *video = data; struct acpi_video_bus *video = data;
struct acpi_device *device = NULL; struct acpi_device *device = NULL;
struct input_dev *input;
int keycode;
printk("video bus notify\n"); printk("video bus notify\n");
...@@ -1771,11 +1776,13 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data) ...@@ -1771,11 +1776,13 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data)
return; return;
device = video->device; device = video->device;
input = video->input;
switch (event) { switch (event) {
case ACPI_VIDEO_NOTIFY_SWITCH: /* User requested a switch, case ACPI_VIDEO_NOTIFY_SWITCH: /* User requested a switch,
* most likely via hotkey. */ * most likely via hotkey. */
acpi_bus_generate_event(device, event, 0); acpi_bus_generate_proc_event(device, event, 0);
keycode = KEY_SWITCHVIDEOMODE;
break; break;
case ACPI_VIDEO_NOTIFY_PROBE: /* User plugged in or removed a video case ACPI_VIDEO_NOTIFY_PROBE: /* User plugged in or removed a video
...@@ -1783,22 +1790,38 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data) ...@@ -1783,22 +1790,38 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data)
acpi_video_device_enumerate(video); acpi_video_device_enumerate(video);
acpi_video_device_rebind(video); acpi_video_device_rebind(video);
acpi_video_switch_output(video, event); acpi_video_switch_output(video, event);
acpi_bus_generate_event(device, event, 0); acpi_bus_generate_proc_event(device, event, 0);
keycode = KEY_SWITCHVIDEOMODE;
break; break;
case ACPI_VIDEO_NOTIFY_CYCLE: /* Cycle Display output hotkey pressed. */ case ACPI_VIDEO_NOTIFY_CYCLE: /* Cycle Display output hotkey pressed. */
acpi_video_switch_output(video, event);
acpi_bus_generate_proc_event(device, event, 0);
keycode = KEY_SWITCHVIDEOMODE;
break;
case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT: /* Next Display output hotkey pressed. */ case ACPI_VIDEO_NOTIFY_NEXT_OUTPUT: /* Next Display output hotkey pressed. */
acpi_video_switch_output(video, event);
acpi_bus_generate_proc_event(device, event, 0);
keycode = KEY_VIDEO_NEXT;
break;
case ACPI_VIDEO_NOTIFY_PREV_OUTPUT: /* previous Display output hotkey pressed. */ case ACPI_VIDEO_NOTIFY_PREV_OUTPUT: /* previous Display output hotkey pressed. */
acpi_video_switch_output(video, event); acpi_video_switch_output(video, event);
acpi_bus_generate_event(device, event, 0); acpi_bus_generate_proc_event(device, event, 0);
keycode = KEY_VIDEO_PREV;
break; break;
default: default:
keycode = KEY_UNKNOWN;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Unsupported event [0x%x]\n", event)); "Unsupported event [0x%x]\n", event));
break; break;
} }
input_report_key(input, keycode, 1);
input_sync(input);
input_report_key(input, keycode, 0);
input_sync(input);
return; return;
} }
...@@ -1806,38 +1829,65 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data) ...@@ -1806,38 +1829,65 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
{ {
struct acpi_video_device *video_device = data; struct acpi_video_device *video_device = data;
struct acpi_device *device = NULL; struct acpi_device *device = NULL;
struct acpi_video_bus *bus;
struct input_dev *input;
int keycode;
if (!video_device) if (!video_device)
return; return;
device = video_device->dev; device = video_device->dev;
bus = video_device->video;
input = bus->input;
switch (event) { switch (event) {
case ACPI_VIDEO_NOTIFY_SWITCH: /* change in status (cycle output device) */
case ACPI_VIDEO_NOTIFY_PROBE: /* change in status (output device status) */
acpi_bus_generate_event(device, event, 0);
break;
case ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS: /* Cycle brightness */ case ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS: /* Cycle brightness */
acpi_video_switch_brightness(video_device, event);
acpi_bus_generate_proc_event(device, event, 0);
keycode = KEY_BRIGHTNESS_CYCLE;
break;
case ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS: /* Increase brightness */ case ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS: /* Increase brightness */
acpi_video_switch_brightness(video_device, event);
acpi_bus_generate_proc_event(device, event, 0);
keycode = KEY_BRIGHTNESSUP;
break;
case ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS: /* Decrease brightness */ case ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS: /* Decrease brightness */
acpi_video_switch_brightness(video_device, event);
acpi_bus_generate_proc_event(device, event, 0);
keycode = KEY_BRIGHTNESSDOWN;
break;
case ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS: /* zero brightnesss */ case ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS: /* zero brightnesss */
acpi_video_switch_brightness(video_device, event);
acpi_bus_generate_proc_event(device, event, 0);
keycode = KEY_BRIGHTNESS_ZERO;
break;
case ACPI_VIDEO_NOTIFY_DISPLAY_OFF: /* display device off */ case ACPI_VIDEO_NOTIFY_DISPLAY_OFF: /* display device off */
acpi_video_switch_brightness(video_device, event); acpi_video_switch_brightness(video_device, event);
acpi_bus_generate_event(device, event, 0); acpi_bus_generate_proc_event(device, event, 0);
keycode = KEY_DISPLAY_OFF;
break; break;
default: default:
keycode = KEY_UNKNOWN;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Unsupported event [0x%x]\n", event)); "Unsupported event [0x%x]\n", event));
break; break;
} }
input_report_key(input, keycode, 1);
input_sync(input);
input_report_key(input, keycode, 0);
input_sync(input);
return; return;
} }
static int instance;
static int acpi_video_bus_add(struct acpi_device *device) static int acpi_video_bus_add(struct acpi_device *device)
{ {
int result = 0; int result = 0;
acpi_status status = 0; acpi_status status = 0;
struct acpi_video_bus *video = NULL; struct acpi_video_bus *video = NULL;
struct input_dev *input;
if (!device) if (!device)
...@@ -1847,6 +1897,13 @@ static int acpi_video_bus_add(struct acpi_device *device) ...@@ -1847,6 +1897,13 @@ static int acpi_video_bus_add(struct acpi_device *device)
if (!video) if (!video)
return -ENOMEM; return -ENOMEM;
/* a hack to fix the duplicate name "VID" problem on T61 */
if (!strcmp(device->pnp.bus_id, "VID")) {
if (instance)
device->pnp.bus_id[3] = '0' + instance;
instance ++;
}
video->device = device; video->device = device;
strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME); strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME);
strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS); strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS);
...@@ -1881,6 +1938,39 @@ static int acpi_video_bus_add(struct acpi_device *device) ...@@ -1881,6 +1938,39 @@ static int acpi_video_bus_add(struct acpi_device *device)
goto end; goto end;
} }
video->input = input = input_allocate_device();
snprintf(video->phys, sizeof(video->phys),
"%s/video/input0", acpi_device_hid(video->device));
input->name = acpi_device_name(video->device);
input->phys = video->phys;
input->id.bustype = BUS_HOST;
input->id.product = 0x06;
input->evbit[0] = BIT(EV_KEY);
set_bit(KEY_SWITCHVIDEOMODE, input->keybit);
set_bit(KEY_VIDEO_NEXT, input->keybit);
set_bit(KEY_VIDEO_PREV, input->keybit);
set_bit(KEY_BRIGHTNESS_CYCLE, input->keybit);
set_bit(KEY_BRIGHTNESSUP, input->keybit);
set_bit(KEY_BRIGHTNESSDOWN, input->keybit);
set_bit(KEY_BRIGHTNESS_ZERO, input->keybit);
set_bit(KEY_DISPLAY_OFF, input->keybit);
set_bit(KEY_UNKNOWN, input->keybit);
result = input_register_device(input);
if (result) {
acpi_remove_notify_handler(video->device->handle,
ACPI_DEVICE_NOTIFY,
acpi_video_bus_notify);
acpi_video_bus_stop_devices(video);
acpi_video_bus_put_devices(video);
kfree(video->attached_array);
acpi_video_bus_remove_fs(device);
goto end;
}
printk(KERN_INFO PREFIX "%s [%s] (multi-head: %s rom: %s post: %s)\n", printk(KERN_INFO PREFIX "%s [%s] (multi-head: %s rom: %s post: %s)\n",
ACPI_VIDEO_DEVICE_NAME, acpi_device_bid(device), ACPI_VIDEO_DEVICE_NAME, acpi_device_bid(device),
video->flags.multihead ? "yes" : "no", video->flags.multihead ? "yes" : "no",
...@@ -1914,6 +2004,7 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type) ...@@ -1914,6 +2004,7 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type)
acpi_video_bus_put_devices(video); acpi_video_bus_put_devices(video);
acpi_video_bus_remove_fs(device); acpi_video_bus_remove_fs(device);
input_unregister_device(video->input);
kfree(video->attached_array); kfree(video->attached_array);
kfree(video); kfree(video);
......
...@@ -875,7 +875,7 @@ static irqreturn_t sonypi_irq(int irq, void *dev_id) ...@@ -875,7 +875,7 @@ static irqreturn_t sonypi_irq(int irq, void *dev_id)
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
if (sonypi_acpi_device) if (sonypi_acpi_device)
acpi_bus_generate_event(sonypi_acpi_device, 1, event); acpi_bus_generate_proc_event(sonypi_acpi_device, 1, event);
#endif #endif
kfifo_put(sonypi_device.fifo, (unsigned char *)&event, sizeof(event)); kfifo_put(sonypi_device.fifo, (unsigned char *)&event, sizeof(event));
......
...@@ -732,7 +732,7 @@ static void asus_hotk_notify(acpi_handle handle, u32 event, void *data) ...@@ -732,7 +732,7 @@ static void asus_hotk_notify(acpi_handle handle, u32 event, void *data)
lcd_blank(FB_BLANK_POWERDOWN); lcd_blank(FB_BLANK_POWERDOWN);
} }
acpi_bus_generate_event(hotk->device, event, acpi_bus_generate_proc_event(hotk->device, event,
hotk->event_count[event % 128]++); hotk->event_count[event % 128]++);
return; return;
...@@ -1072,7 +1072,8 @@ static void asus_backlight_exit(void) ...@@ -1072,7 +1072,8 @@ static void asus_backlight_exit(void)
} }
#define ASUS_LED_UNREGISTER(object) \ #define ASUS_LED_UNREGISTER(object) \
led_classdev_unregister(&object##_led) if (object##_led.dev) \
led_classdev_unregister(&object##_led)
static void asus_led_exit(void) static void asus_led_exit(void)
{ {
......
...@@ -855,6 +855,15 @@ static struct dmi_system_id sony_nc_ids[] = { ...@@ -855,6 +855,15 @@ static struct dmi_system_id sony_nc_ids[] = {
DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FE"), DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FE"),
}, },
}, },
{
.ident = "Sony Vaio FZ Series",
.callback = sony_nc_C_enable,
.driver_data = sony_C_events,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ"),
},
},
{ {
.ident = "Sony Vaio C Series", .ident = "Sony Vaio C Series",
.callback = sony_nc_C_enable, .callback = sony_nc_C_enable,
...@@ -904,7 +913,7 @@ static void sony_acpi_notify(acpi_handle handle, u32 event, void *data) ...@@ -904,7 +913,7 @@ static void sony_acpi_notify(acpi_handle handle, u32 event, void *data)
dprintk("sony_acpi_notify, event: 0x%.2x\n", ev); dprintk("sony_acpi_notify, event: 0x%.2x\n", ev);
sony_laptop_report_input_event(ev); sony_laptop_report_input_event(ev);
acpi_bus_generate_event(sony_nc_acpi_device, 1, ev); acpi_bus_generate_proc_event(sony_nc_acpi_device, 1, ev);
} }
static acpi_status sony_walk_callback(acpi_handle handle, u32 level, static acpi_status sony_walk_callback(acpi_handle handle, u32 level,
...@@ -2292,7 +2301,7 @@ static irqreturn_t sony_pic_irq(int irq, void *dev_id) ...@@ -2292,7 +2301,7 @@ static irqreturn_t sony_pic_irq(int irq, void *dev_id)
found: found:
sony_laptop_report_input_event(device_event); sony_laptop_report_input_event(device_event);
acpi_bus_generate_event(spic_dev.acpi_dev, 1, device_event); acpi_bus_generate_proc_event(spic_dev.acpi_dev, 1, device_event);
sonypi_compat_report_event(device_event); sonypi_compat_report_event(device_event);
return IRQ_HANDLED; return IRQ_HANDLED;
...@@ -2308,8 +2317,6 @@ static int sony_pic_remove(struct acpi_device *device, int type) ...@@ -2308,8 +2317,6 @@ static int sony_pic_remove(struct acpi_device *device, int type)
struct sony_pic_ioport *io, *tmp_io; struct sony_pic_ioport *io, *tmp_io;
struct sony_pic_irq *irq, *tmp_irq; struct sony_pic_irq *irq, *tmp_irq;
sonypi_compat_exit();
if (sony_pic_disable(device)) { if (sony_pic_disable(device)) {
printk(KERN_ERR DRV_PFX "Couldn't disable device.\n"); printk(KERN_ERR DRV_PFX "Couldn't disable device.\n");
return -ENXIO; return -ENXIO;
...@@ -2319,6 +2326,8 @@ static int sony_pic_remove(struct acpi_device *device, int type) ...@@ -2319,6 +2326,8 @@ static int sony_pic_remove(struct acpi_device *device, int type)
release_region(spic_dev.cur_ioport->io.minimum, release_region(spic_dev.cur_ioport->io.minimum,
spic_dev.cur_ioport->io.address_length); spic_dev.cur_ioport->io.address_length);
sonypi_compat_exit();
sony_laptop_remove_input(); sony_laptop_remove_input();
/* pf attrs */ /* pf attrs */
...@@ -2384,6 +2393,9 @@ static int sony_pic_add(struct acpi_device *device) ...@@ -2384,6 +2393,9 @@ static int sony_pic_add(struct acpi_device *device)
goto err_free_resources; goto err_free_resources;
} }
if (sonypi_compat_init())
goto err_remove_input;
/* request io port */ /* request io port */
list_for_each_entry(io, &spic_dev.ioports, list) { list_for_each_entry(io, &spic_dev.ioports, list) {
if (request_region(io->io.minimum, io->io.address_length, if (request_region(io->io.minimum, io->io.address_length,
...@@ -2398,7 +2410,7 @@ static int sony_pic_add(struct acpi_device *device) ...@@ -2398,7 +2410,7 @@ static int sony_pic_add(struct acpi_device *device)
if (!spic_dev.cur_ioport) { if (!spic_dev.cur_ioport) {
printk(KERN_ERR DRV_PFX "Failed to request_region.\n"); printk(KERN_ERR DRV_PFX "Failed to request_region.\n");
result = -ENODEV; result = -ENODEV;
goto err_remove_input; goto err_remove_compat;
} }
/* request IRQ */ /* request IRQ */
...@@ -2438,9 +2450,6 @@ static int sony_pic_add(struct acpi_device *device) ...@@ -2438,9 +2450,6 @@ static int sony_pic_add(struct acpi_device *device)
if (result) if (result)
goto err_remove_pf; goto err_remove_pf;
if (sonypi_compat_init())
goto err_remove_pf;
return 0; return 0;
err_remove_pf: err_remove_pf:
...@@ -2456,6 +2465,9 @@ static int sony_pic_add(struct acpi_device *device) ...@@ -2456,6 +2465,9 @@ static int sony_pic_add(struct acpi_device *device)
release_region(spic_dev.cur_ioport->io.minimum, release_region(spic_dev.cur_ioport->io.minimum,
spic_dev.cur_ioport->io.address_length); spic_dev.cur_ioport->io.address_length);
err_remove_compat:
sonypi_compat_exit();
err_remove_input: err_remove_input:
sony_laptop_remove_input(); sony_laptop_remove_input();
......
...@@ -1190,10 +1190,10 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) ...@@ -1190,10 +1190,10 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
} }
if (sendacpi) if (sendacpi)
acpi_bus_generate_event(ibm->acpi->device, event, hkey); acpi_bus_generate_proc_event(ibm->acpi->device, event, hkey);
} else { } else {
printk(IBM_ERR "unknown hotkey notification event %d\n", event); printk(IBM_ERR "unknown hotkey notification event %d\n", event);
acpi_bus_generate_event(ibm->acpi->device, event, 0); acpi_bus_generate_proc_event(ibm->acpi->device, event, 0);
} }
} }
...@@ -2162,22 +2162,27 @@ static void dock_notify(struct ibm_struct *ibm, u32 event) ...@@ -2162,22 +2162,27 @@ static void dock_notify(struct ibm_struct *ibm, u32 event)
int docked = dock_docked(); int docked = dock_docked();
int pci = ibm->acpi->hid && ibm->acpi->device && int pci = ibm->acpi->hid && ibm->acpi->device &&
acpi_match_device_ids(ibm->acpi->device, ibm_pci_device_ids); acpi_match_device_ids(ibm->acpi->device, ibm_pci_device_ids);
int data;
if (event == 1 && !pci) /* 570 */ if (event == 1 && !pci) /* 570 */
acpi_bus_generate_event(ibm->acpi->device, event, 1); /* button */ data = 1; /* button */
else if (event == 1 && pci) /* 570 */ else if (event == 1 && pci) /* 570 */
acpi_bus_generate_event(ibm->acpi->device, event, 3); /* dock */ data = 3; /* dock */
else if (event == 3 && docked) else if (event == 3 && docked)
acpi_bus_generate_event(ibm->acpi->device, event, 1); /* button */ data = 1; /* button */
else if (event == 3 && !docked) else if (event == 3 && !docked)
acpi_bus_generate_event(ibm->acpi->device, event, 2); /* undock */ data = 2; /* undock */
else if (event == 0 && docked) else if (event == 0 && docked)
acpi_bus_generate_event(ibm->acpi->device, event, 3); /* dock */ data = 3; /* dock */
else { else {
printk(IBM_ERR "unknown dock event %d, status %d\n", printk(IBM_ERR "unknown dock event %d, status %d\n",
event, _sta(dock_handle)); event, _sta(dock_handle));
acpi_bus_generate_event(ibm->acpi->device, event, 0); /* unknown */ data = 0; /* unknown */
} }
acpi_bus_generate_proc_event(ibm->acpi->device, event, data);
acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class,
ibm->acpi->device->dev.bus_id,
event, data);
} }
static int dock_read(char *p) static int dock_read(char *p)
...@@ -2275,7 +2280,10 @@ static int __init bay_init(struct ibm_init_struct *iibm) ...@@ -2275,7 +2280,10 @@ static int __init bay_init(struct ibm_init_struct *iibm)
static void bay_notify(struct ibm_struct *ibm, u32 event) static void bay_notify(struct ibm_struct *ibm, u32 event)
{ {
acpi_bus_generate_event(ibm->acpi->device, event, 0); acpi_bus_generate_proc_event(ibm->acpi->device, event, 0);
acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class,
ibm->acpi->device->dev.bus_id,
event, 0);
} }
#define bay_occupied(b) (_sta(b##_handle) & 1) #define bay_occupied(b) (_sta(b##_handle) & 1)
......
...@@ -267,7 +267,10 @@ static void ibm_handle_events(acpi_handle handle, u32 event, void *context) ...@@ -267,7 +267,10 @@ static void ibm_handle_events(acpi_handle handle, u32 event, void *context)
if (subevent == 0x80) { if (subevent == 0x80) {
dbg("%s: generationg bus event\n", __FUNCTION__); dbg("%s: generationg bus event\n", __FUNCTION__);
acpi_bus_generate_event(note->device, note->event, detail); acpi_bus_generate_proc_event(note->device, note->event, detail);
acpi_bus_generate_netlink_event(note->device->pnp.device_class,
note->device->dev.bus_id,
note->event, detail);
} else } else
note->event = event; note->event = event;
} }
...@@ -399,7 +402,7 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle, ...@@ -399,7 +402,7 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle,
status = acpi_get_object_info(handle, &info_buffer); status = acpi_get_object_info(handle, &info_buffer);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
err("%s: Failed to get device information", __FUNCTION__); err("%s: Failed to get device information\n", __FUNCTION__);
return 0; return 0;
} }
info.hardware_id.value[sizeof(info.hardware_id.value) - 1] = '\0'; info.hardware_id.value[sizeof(info.hardware_id.value) - 1] = '\0';
......
...@@ -25,13 +25,13 @@ static const struct pnp_card_device_id *match_card(struct pnp_card_driver *drv, ...@@ -25,13 +25,13 @@ static const struct pnp_card_device_id *match_card(struct pnp_card_driver *drv,
int found; int found;
struct pnp_dev *dev; struct pnp_dev *dev;
if (i == PNP_MAX_DEVICES if (i == PNP_MAX_DEVICES ||
|| !*drv_id->devs[i].id) !*drv_id->devs[i].id)
return drv_id; return drv_id;
found = 0; found = 0;
card_for_each_dev(card, dev) { card_for_each_dev(card, dev) {
if (compare_pnp_id if (compare_pnp_id(dev->id,
(dev->id, drv_id->devs[i].id)) { drv_id->devs[i].id)) {
found = 1; found = 1;
break; break;
} }
...@@ -183,7 +183,7 @@ static int pnp_interface_attach_card(struct pnp_card *card) ...@@ -183,7 +183,7 @@ static int pnp_interface_attach_card(struct pnp_card *card)
return 0; return 0;
err_name: err_name:
device_remove_file(&card->dev, &dev_attr_name); device_remove_file(&card->dev, &dev_attr_name);
return rc; return rc;
} }
...@@ -321,10 +321,10 @@ struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink, ...@@ -321,10 +321,10 @@ struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink,
pos = pos->next; pos = pos->next;
} }
done: done:
return NULL; return NULL;
found: found:
dev->card_link = clink; dev->card_link = clink;
dev->dev.driver = &drv->link.driver; dev->dev.driver = &drv->link.driver;
if (pnp_bus_type.probe(&dev->dev)) if (pnp_bus_type.probe(&dev->dev))
...@@ -334,7 +334,7 @@ struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink, ...@@ -334,7 +334,7 @@ struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink,
return dev; return dev;
err_out: err_out:
dev->dev.driver = NULL; dev->dev.driver = NULL;
dev->card_link = NULL; dev->card_link = NULL;
return NULL; return NULL;
......
...@@ -52,9 +52,6 @@ int pnp_register_protocol(struct pnp_protocol *protocol) ...@@ -52,9 +52,6 @@ int pnp_register_protocol(struct pnp_protocol *protocol)
int nodenum; int nodenum;
struct list_head *pos; struct list_head *pos;
if (!protocol)
return -EINVAL;
INIT_LIST_HEAD(&protocol->devices); INIT_LIST_HEAD(&protocol->devices);
INIT_LIST_HEAD(&protocol->cards); INIT_LIST_HEAD(&protocol->cards);
nodenum = 0; nodenum = 0;
...@@ -94,8 +91,6 @@ static void pnp_free_ids(struct pnp_dev *dev) ...@@ -94,8 +91,6 @@ static void pnp_free_ids(struct pnp_dev *dev)
struct pnp_id *id; struct pnp_id *id;
struct pnp_id *next; struct pnp_id *next;
if (!dev)
return;
id = dev->id; id = dev->id;
while (id) { while (id) {
next = id->next; next = id->next;
...@@ -143,7 +138,7 @@ int __pnp_add_device(struct pnp_dev *dev) ...@@ -143,7 +138,7 @@ int __pnp_add_device(struct pnp_dev *dev)
*/ */
int pnp_add_device(struct pnp_dev *dev) int pnp_add_device(struct pnp_dev *dev)
{ {
if (!dev || !dev->protocol || dev->card) if (dev->card)
return -EINVAL; return -EINVAL;
dev->dev.parent = &dev->protocol->dev; dev->dev.parent = &dev->protocol->dev;
sprintf(dev->dev.bus_id, "%02x:%02x", dev->protocol->number, sprintf(dev->dev.bus_id, "%02x:%02x", dev->protocol->number,
......
...@@ -118,7 +118,7 @@ static int pnp_device_probe(struct device *dev) ...@@ -118,7 +118,7 @@ static int pnp_device_probe(struct device *dev)
goto fail; goto fail;
return error; return error;
fail: fail:
pnp_device_detach(pnp_dev); pnp_device_detach(pnp_dev);
return error; return error;
} }
...@@ -232,10 +232,6 @@ int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev) ...@@ -232,10 +232,6 @@ int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev)
{ {
struct pnp_id *ptr; struct pnp_id *ptr;
if (!id)
return -EINVAL;
if (!dev)
return -EINVAL;
id->next = NULL; id->next = NULL;
ptr = dev->id; ptr = dev->id;
while (ptr && ptr->next) while (ptr && ptr->next)
......
...@@ -459,7 +459,8 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr, ...@@ -459,7 +459,8 @@ pnp_set_current_resources(struct device *dmdev, struct device_attribute *attr,
up(&pnp_res_mutex); up(&pnp_res_mutex);
goto done; goto done;
} }
done:
done:
if (retval < 0) if (retval < 0)
return retval; return retval;
return count; return count;
...@@ -499,10 +500,10 @@ int pnp_interface_attach_device(struct pnp_dev *dev) ...@@ -499,10 +500,10 @@ int pnp_interface_attach_device(struct pnp_dev *dev)
return 0; return 0;
err_res: err_res:
device_remove_file(&dev->dev, &dev_attr_resources); device_remove_file(&dev->dev, &dev_attr_resources);
err_opt: err_opt:
device_remove_file(&dev->dev, &dev_attr_options); device_remove_file(&dev->dev, &dev_attr_options);
err: err:
return rc; return rc;
} }
...@@ -47,9 +47,6 @@ ...@@ -47,9 +47,6 @@
#if 0 #if 0
#define ISAPNP_REGION_OK #define ISAPNP_REGION_OK
#endif #endif
#if 0
#define ISAPNP_DEBUG
#endif
int isapnp_disable; /* Disable ISA PnP */ int isapnp_disable; /* Disable ISA PnP */
static int isapnp_rdp; /* Read Data Port */ static int isapnp_rdp; /* Read Data Port */
...@@ -93,7 +90,6 @@ MODULE_LICENSE("GPL"); ...@@ -93,7 +90,6 @@ MODULE_LICENSE("GPL");
static unsigned char isapnp_checksum_value; static unsigned char isapnp_checksum_value;
static DEFINE_MUTEX(isapnp_cfg_mutex); static DEFINE_MUTEX(isapnp_cfg_mutex);
static int isapnp_detected;
static int isapnp_csn_count; static int isapnp_csn_count;
/* some prototypes */ /* some prototypes */
...@@ -335,7 +331,7 @@ static int __init isapnp_isolate(void) ...@@ -335,7 +331,7 @@ static int __init isapnp_isolate(void)
} else if (iteration > 1) { } else if (iteration > 1) {
break; break;
} }
__next: __next:
if (csn == 255) if (csn == 255)
break; break;
checksum = 0x6a; checksum = 0x6a;
...@@ -733,7 +729,7 @@ static int __init isapnp_create_device(struct pnp_card *card, ...@@ -733,7 +729,7 @@ static int __init isapnp_create_device(struct pnp_card *card,
"isapnp: unexpected or unknown tag type 0x%x for logical device %i (device %i), ignored\n", "isapnp: unexpected or unknown tag type 0x%x for logical device %i (device %i), ignored\n",
type, dev->number, card->number); type, dev->number, card->number);
} }
__skip: __skip:
if (size > 0) if (size > 0)
isapnp_skip_bytes(size); isapnp_skip_bytes(size);
} }
...@@ -788,7 +784,7 @@ static void __init isapnp_parse_resource_map(struct pnp_card *card) ...@@ -788,7 +784,7 @@ static void __init isapnp_parse_resource_map(struct pnp_card *card)
"isapnp: unexpected or unknown tag type 0x%x for device %i, ignored\n", "isapnp: unexpected or unknown tag type 0x%x for device %i, ignored\n",
type, card->number); type, card->number);
} }
__skip: __skip:
if (size > 0) if (size > 0)
isapnp_skip_bytes(size); isapnp_skip_bytes(size);
} }
...@@ -940,9 +936,6 @@ EXPORT_SYMBOL(isapnp_protocol); ...@@ -940,9 +936,6 @@ EXPORT_SYMBOL(isapnp_protocol);
EXPORT_SYMBOL(isapnp_present); EXPORT_SYMBOL(isapnp_present);
EXPORT_SYMBOL(isapnp_cfg_begin); EXPORT_SYMBOL(isapnp_cfg_begin);
EXPORT_SYMBOL(isapnp_cfg_end); EXPORT_SYMBOL(isapnp_cfg_end);
#if 0
EXPORT_SYMBOL(isapnp_read_byte);
#endif
EXPORT_SYMBOL(isapnp_write_byte); EXPORT_SYMBOL(isapnp_write_byte);
static int isapnp_read_resources(struct pnp_dev *dev, static int isapnp_read_resources(struct pnp_dev *dev,
...@@ -993,6 +986,7 @@ static int isapnp_get_resources(struct pnp_dev *dev, ...@@ -993,6 +986,7 @@ static int isapnp_get_resources(struct pnp_dev *dev,
struct pnp_resource_table *res) struct pnp_resource_table *res)
{ {
int ret; int ret;
pnp_init_resource_table(res); pnp_init_resource_table(res);
isapnp_cfg_begin(dev->card->number, dev->number); isapnp_cfg_begin(dev->card->number, dev->number);
ret = isapnp_read_resources(dev, res); ret = isapnp_read_resources(dev, res);
...@@ -1046,7 +1040,7 @@ static int isapnp_set_resources(struct pnp_dev *dev, ...@@ -1046,7 +1040,7 @@ static int isapnp_set_resources(struct pnp_dev *dev,
static int isapnp_disable_resources(struct pnp_dev *dev) static int isapnp_disable_resources(struct pnp_dev *dev)
{ {
if (!dev || !dev->active) if (!dev->active)
return -EINVAL; return -EINVAL;
isapnp_cfg_begin(dev->card->number, dev->number); isapnp_cfg_begin(dev->card->number, dev->number);
isapnp_deactivate(dev->number); isapnp_deactivate(dev->number);
...@@ -1069,7 +1063,6 @@ static int __init isapnp_init(void) ...@@ -1069,7 +1063,6 @@ static int __init isapnp_init(void)
struct pnp_dev *dev; struct pnp_dev *dev;
if (isapnp_disable) { if (isapnp_disable) {
isapnp_detected = 0;
printk(KERN_INFO "isapnp: ISA Plug & Play support disabled\n"); printk(KERN_INFO "isapnp: ISA Plug & Play support disabled\n");
return 0; return 0;
} }
...@@ -1117,7 +1110,6 @@ static int __init isapnp_init(void) ...@@ -1117,7 +1110,6 @@ static int __init isapnp_init(void)
} }
isapnp_set_rdp(); isapnp_set_rdp();
} }
isapnp_detected = 1;
if (isapnp_rdp < 0x203 || isapnp_rdp > 0x3ff) { if (isapnp_rdp < 0x203 || isapnp_rdp > 0x3ff) {
cards = isapnp_isolate(); cards = isapnp_isolate();
if (cards < 0 || (isapnp_rdp < 0x203 || isapnp_rdp > 0x3ff)) { if (cards < 0 || (isapnp_rdp < 0x203 || isapnp_rdp > 0x3ff)) {
...@@ -1125,7 +1117,6 @@ static int __init isapnp_init(void) ...@@ -1125,7 +1117,6 @@ static int __init isapnp_init(void)
release_region(_PIDXR, 1); release_region(_PIDXR, 1);
#endif #endif
release_region(_PNPWRP, 1); release_region(_PNPWRP, 1);
isapnp_detected = 0;
printk(KERN_INFO printk(KERN_INFO
"isapnp: No Plug & Play device found\n"); "isapnp: No Plug & Play device found\n");
return 0; return 0;
...@@ -1148,13 +1139,12 @@ static int __init isapnp_init(void) ...@@ -1148,13 +1139,12 @@ static int __init isapnp_init(void)
} }
} }
} }
if (cards) { if (cards)
printk(KERN_INFO printk(KERN_INFO
"isapnp: %i Plug & Play card%s detected total\n", cards, "isapnp: %i Plug & Play card%s detected total\n", cards,
cards > 1 ? "s" : ""); cards > 1 ? "s" : "");
} else { else
printk(KERN_INFO "isapnp: No Plug & Play card found\n"); printk(KERN_INFO "isapnp: No Plug & Play card found\n");
}
isapnp_proc_init(); isapnp_proc_init();
return 0; return 0;
......
...@@ -112,33 +112,6 @@ static int isapnp_proc_attach_device(struct pnp_dev *dev) ...@@ -112,33 +112,6 @@ static int isapnp_proc_attach_device(struct pnp_dev *dev)
return 0; return 0;
} }
#ifdef MODULE
static int __exit isapnp_proc_detach_device(struct pnp_dev *dev)
{
struct pnp_card *bus = dev->card;
struct proc_dir_entry *de;
char name[16];
if (!(de = bus->procdir))
return -EINVAL;
sprintf(name, "%02x", dev->number);
remove_proc_entry(name, de);
return 0;
}
static int __exit isapnp_proc_detach_bus(struct pnp_card *bus)
{
struct proc_dir_entry *de;
char name[16];
if (!(de = bus->procdir))
return -EINVAL;
sprintf(name, "%02x", bus->number);
remove_proc_entry(name, isapnp_proc_bus_dir);
return 0;
}
#endif /* MODULE */
int __init isapnp_proc_init(void) int __init isapnp_proc_init(void)
{ {
struct pnp_dev *dev; struct pnp_dev *dev;
...@@ -149,21 +122,3 @@ int __init isapnp_proc_init(void) ...@@ -149,21 +122,3 @@ int __init isapnp_proc_init(void)
} }
return 0; return 0;
} }
#ifdef MODULE
int __exit isapnp_proc_done(void)
{
struct pnp_dev *dev;
struct pnp_bus *card;
isapnp_for_each_dev(dev) {
isapnp_proc_detach_device(dev);
}
isapnp_for_each_card(card) {
isapnp_proc_detach_bus(card);
}
if (isapnp_proc_bus_dir)
remove_proc_entry("isapnp", proc_bus);
return 0;
}
#endif /* MODULE */
...@@ -21,9 +21,6 @@ static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx) ...@@ -21,9 +21,6 @@ static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx)
resource_size_t *start, *end; resource_size_t *start, *end;
unsigned long *flags; unsigned long *flags;
if (!dev || !rule)
return -EINVAL;
if (idx >= PNP_MAX_PORT) { if (idx >= PNP_MAX_PORT) {
pnp_err pnp_err
("More than 4 ports is incompatible with pnp specifications."); ("More than 4 ports is incompatible with pnp specifications.");
...@@ -66,9 +63,6 @@ static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx) ...@@ -66,9 +63,6 @@ static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx)
resource_size_t *start, *end; resource_size_t *start, *end;
unsigned long *flags; unsigned long *flags;
if (!dev || !rule)
return -EINVAL;
if (idx >= PNP_MAX_MEM) { if (idx >= PNP_MAX_MEM) {
pnp_err pnp_err
("More than 8 mems is incompatible with pnp specifications."); ("More than 8 mems is incompatible with pnp specifications.");
...@@ -127,9 +121,6 @@ static int pnp_assign_irq(struct pnp_dev *dev, struct pnp_irq *rule, int idx) ...@@ -127,9 +121,6 @@ static int pnp_assign_irq(struct pnp_dev *dev, struct pnp_irq *rule, int idx)
5, 10, 11, 12, 9, 14, 15, 7, 3, 4, 13, 0, 1, 6, 8, 2 5, 10, 11, 12, 9, 14, 15, 7, 3, 4, 13, 0, 1, 6, 8, 2
}; };
if (!dev || !rule)
return -EINVAL;
if (idx >= PNP_MAX_IRQ) { if (idx >= PNP_MAX_IRQ) {
pnp_err pnp_err
("More than 2 irqs is incompatible with pnp specifications."); ("More than 2 irqs is incompatible with pnp specifications.");
...@@ -181,9 +172,6 @@ static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx) ...@@ -181,9 +172,6 @@ static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx)
1, 3, 5, 6, 7, 0, 2, 4 1, 3, 5, 6, 7, 0, 2, 4
}; };
if (!dev || !rule)
return -EINVAL;
if (idx >= PNP_MAX_DMA) { if (idx >= PNP_MAX_DMA) {
pnp_err pnp_err
("More than 2 dmas is incompatible with pnp specifications."); ("More than 2 dmas is incompatible with pnp specifications.");
...@@ -390,7 +378,7 @@ static int pnp_assign_resources(struct pnp_dev *dev, int depnum) ...@@ -390,7 +378,7 @@ static int pnp_assign_resources(struct pnp_dev *dev, int depnum)
up(&pnp_res_mutex); up(&pnp_res_mutex);
return 1; return 1;
fail: fail:
pnp_clean_resource_table(&dev->res); pnp_clean_resource_table(&dev->res);
up(&pnp_res_mutex); up(&pnp_res_mutex);
return 0; return 0;
...@@ -410,8 +398,6 @@ int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, ...@@ -410,8 +398,6 @@ int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res,
int i; int i;
struct pnp_resource_table *bak; struct pnp_resource_table *bak;
if (!dev || !res)
return -EINVAL;
if (!pnp_can_configure(dev)) if (!pnp_can_configure(dev))
return -ENODEV; return -ENODEV;
bak = pnp_alloc(sizeof(struct pnp_resource_table)); bak = pnp_alloc(sizeof(struct pnp_resource_table));
...@@ -444,7 +430,7 @@ int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, ...@@ -444,7 +430,7 @@ int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res,
kfree(bak); kfree(bak);
return 0; return 0;
fail: fail:
dev->res = *bak; dev->res = *bak;
up(&pnp_res_mutex); up(&pnp_res_mutex);
kfree(bak); kfree(bak);
...@@ -460,9 +446,6 @@ int pnp_auto_config_dev(struct pnp_dev *dev) ...@@ -460,9 +446,6 @@ int pnp_auto_config_dev(struct pnp_dev *dev)
struct pnp_option *dep; struct pnp_option *dep;
int i = 1; int i = 1;
if (!dev)
return -EINVAL;
if (!pnp_can_configure(dev)) { if (!pnp_can_configure(dev)) {
pnp_dbg("Device %s does not support resource configuration.", pnp_dbg("Device %s does not support resource configuration.",
dev->dev.bus_id); dev->dev.bus_id);
...@@ -541,8 +524,6 @@ int pnp_activate_dev(struct pnp_dev *dev) ...@@ -541,8 +524,6 @@ int pnp_activate_dev(struct pnp_dev *dev)
{ {
int error; int error;
if (!dev)
return -EINVAL;
if (dev->active) if (dev->active)
return 0; /* the device is already active */ return 0; /* the device is already active */
...@@ -568,8 +549,6 @@ int pnp_disable_dev(struct pnp_dev *dev) ...@@ -568,8 +549,6 @@ int pnp_disable_dev(struct pnp_dev *dev)
{ {
int error; int error;
if (!dev)
return -EINVAL;
if (!dev->active) if (!dev->active)
return 0; /* the device is already disabled */ return 0; /* the device is already disabled */
...@@ -596,8 +575,6 @@ int pnp_disable_dev(struct pnp_dev *dev) ...@@ -596,8 +575,6 @@ int pnp_disable_dev(struct pnp_dev *dev)
void pnp_resource_change(struct resource *resource, resource_size_t start, void pnp_resource_change(struct resource *resource, resource_size_t start,
resource_size_t size) resource_size_t size)
{ {
if (resource == NULL)
return;
resource->flags &= ~(IORESOURCE_AUTO | IORESOURCE_UNSET); resource->flags &= ~(IORESOURCE_AUTO | IORESOURCE_UNSET);
resource->start = start; resource->start = start;
resource->end = start + size - 1; resource->end = start + size - 1;
......
...@@ -248,9 +248,9 @@ static int __init pnpacpi_add_device(struct acpi_device *device) ...@@ -248,9 +248,9 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
num++; num++;
return AE_OK; return AE_OK;
err1: err1:
kfree(dev_id); kfree(dev_id);
err: err:
kfree(dev); kfree(dev);
return -EINVAL; return -EINVAL;
} }
......
...@@ -34,19 +34,17 @@ ...@@ -34,19 +34,17 @@
*/ */
static int irq_flags(int triggering, int polarity) static int irq_flags(int triggering, int polarity)
{ {
int flag;
if (triggering == ACPI_LEVEL_SENSITIVE) { if (triggering == ACPI_LEVEL_SENSITIVE) {
if (polarity == ACPI_ACTIVE_LOW) if (polarity == ACPI_ACTIVE_LOW)
flag = IORESOURCE_IRQ_LOWLEVEL; return IORESOURCE_IRQ_LOWLEVEL;
else else
flag = IORESOURCE_IRQ_HIGHLEVEL; return IORESOURCE_IRQ_HIGHLEVEL;
} else { } else {
if (polarity == ACPI_ACTIVE_LOW) if (polarity == ACPI_ACTIVE_LOW)
flag = IORESOURCE_IRQ_LOWEDGE; return IORESOURCE_IRQ_LOWEDGE;
else else
flag = IORESOURCE_IRQ_HIGHEDGE; return IORESOURCE_IRQ_HIGHEDGE;
} }
return flag;
} }
static void decode_irq_flags(int flag, int *triggering, int *polarity) static void decode_irq_flags(int flag, int *triggering, int *polarity)
...@@ -242,8 +240,7 @@ static void pnpacpi_parse_allocated_address_space(struct pnp_resource_table *res ...@@ -242,8 +240,7 @@ static void pnpacpi_parse_allocated_address_space(struct pnp_resource_table *res
static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
void *data) void *data)
{ {
struct pnp_resource_table *res_table = struct pnp_resource_table *res_table = data;
(struct pnp_resource_table *)data;
int i; int i;
switch (res->type) { switch (res->type) {
...@@ -566,8 +563,7 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res, ...@@ -566,8 +563,7 @@ static acpi_status pnpacpi_option_resource(struct acpi_resource *res,
void *data) void *data)
{ {
int priority = 0; int priority = 0;
struct acpipnp_parse_option_s *parse_data = struct acpipnp_parse_option_s *parse_data = data;
(struct acpipnp_parse_option_s *)data;
struct pnp_dev *dev = parse_data->dev; struct pnp_dev *dev = parse_data->dev;
struct pnp_option *option = parse_data->option; struct pnp_option *option = parse_data->option;
...@@ -705,7 +701,7 @@ static int pnpacpi_supported_resource(struct acpi_resource *res) ...@@ -705,7 +701,7 @@ static int pnpacpi_supported_resource(struct acpi_resource *res)
static acpi_status pnpacpi_count_resources(struct acpi_resource *res, static acpi_status pnpacpi_count_resources(struct acpi_resource *res,
void *data) void *data)
{ {
int *res_cnt = (int *)data; int *res_cnt = data;
if (pnpacpi_supported_resource(res)) if (pnpacpi_supported_resource(res))
(*res_cnt)++; (*res_cnt)++;
...@@ -714,7 +710,7 @@ static acpi_status pnpacpi_count_resources(struct acpi_resource *res, ...@@ -714,7 +710,7 @@ static acpi_status pnpacpi_count_resources(struct acpi_resource *res,
static acpi_status pnpacpi_type_resources(struct acpi_resource *res, void *data) static acpi_status pnpacpi_type_resources(struct acpi_resource *res, void *data)
{ {
struct acpi_resource **resource = (struct acpi_resource **)data; struct acpi_resource **resource = data;
if (pnpacpi_supported_resource(res)) { if (pnpacpi_supported_resource(res)) {
(*resource)->type = res->type; (*resource)->type = res->type;
...@@ -886,8 +882,7 @@ int pnpacpi_encode_resources(struct pnp_resource_table *res_table, ...@@ -886,8 +882,7 @@ int pnpacpi_encode_resources(struct pnp_resource_table *res_table,
int i = 0; int i = 0;
/* pnpacpi_build_resource_template allocates extra mem */ /* pnpacpi_build_resource_template allocates extra mem */
int res_cnt = (buffer->length - 1) / sizeof(struct acpi_resource) - 1; int res_cnt = (buffer->length - 1) / sizeof(struct acpi_resource) - 1;
struct acpi_resource *resource = struct acpi_resource *resource = buffer->pointer;
(struct acpi_resource *)buffer->pointer;
int port = 0, irq = 0, dma = 0, mem = 0; int port = 0, irq = 0, dma = 0, mem = 0;
pnp_dbg("res cnt %d", res_cnt); pnp_dbg("res cnt %d", res_cnt);
......
...@@ -419,7 +419,6 @@ static void __init build_devlist(void) ...@@ -419,7 +419,6 @@ static void __init build_devlist(void)
static int pnpbios_disabled; static int pnpbios_disabled;
int pnpbios_dont_use_current_config; int pnpbios_dont_use_current_config;
#ifndef MODULE
static int __init pnpbios_setup(char *str) static int __init pnpbios_setup(char *str)
{ {
int invert; int invert;
...@@ -443,7 +442,6 @@ static int __init pnpbios_setup(char *str) ...@@ -443,7 +442,6 @@ static int __init pnpbios_setup(char *str)
} }
__setup("pnpbios=", pnpbios_setup); __setup("pnpbios=", pnpbios_setup);
#endif
/* PnP BIOS signature: "$PnP" */ /* PnP BIOS signature: "$PnP" */
#define PNP_SIGNATURE (('$' << 0) + ('P' << 8) + ('n' << 16) + ('P' << 24)) #define PNP_SIGNATURE (('$' << 0) + ('P' << 8) + ('n' << 16) + ('P' << 24))
...@@ -591,6 +589,7 @@ subsys_initcall(pnpbios_init); ...@@ -591,6 +589,7 @@ subsys_initcall(pnpbios_init);
static int __init pnpbios_thread_init(void) static int __init pnpbios_thread_init(void)
{ {
struct task_struct *task; struct task_struct *task;
#if defined(CONFIG_PPC_MERGE) #if defined(CONFIG_PPC_MERGE)
if (check_legacy_ioport(PNPBIOS_BASE)) if (check_legacy_ioport(PNPBIOS_BASE))
return 0; return 0;
...@@ -606,48 +605,7 @@ static int __init pnpbios_thread_init(void) ...@@ -606,48 +605,7 @@ static int __init pnpbios_thread_init(void)
return 0; return 0;
} }
#ifndef MODULE
/* init/main.c calls pnpbios_init early */
/* Start the kernel thread later: */ /* Start the kernel thread later: */
module_init(pnpbios_thread_init); module_init(pnpbios_thread_init);
#else
/*
* N.B.: Building pnpbios as a module hasn't been fully implemented
*/
MODULE_LICENSE("GPL");
static int __init pnpbios_init_all(void)
{
int r;
r = pnpbios_init();
if (r)
return r;
r = pnpbios_thread_init();
if (r)
return r;
return 0;
}
static void __exit pnpbios_exit(void)
{
#ifdef CONFIG_HOTPLUG
unloading = 1;
wait_for_completion(&unload_sem);
#endif
pnpbios_proc_exit();
/* We ought to free resources here */
return;
}
module_init(pnpbios_init_all);
module_exit(pnpbios_exit);
#endif
EXPORT_SYMBOL(pnpbios_protocol); EXPORT_SYMBOL(pnpbios_protocol);
...@@ -212,7 +212,7 @@ static int proc_write_node(struct file *file, const char __user * buf, ...@@ -212,7 +212,7 @@ static int proc_write_node(struct file *file, const char __user * buf,
goto out; goto out;
} }
ret = count; ret = count;
out: out:
kfree(node); kfree(node);
return ret; return ret;
} }
......
...@@ -238,7 +238,7 @@ static unsigned char *pnpbios_parse_allocated_resource_data(unsigned char *p, ...@@ -238,7 +238,7 @@ static unsigned char *pnpbios_parse_allocated_resource_data(unsigned char *p,
break; break;
default: /* an unkown tag */ default: /* an unkown tag */
len_err: len_err:
printk(KERN_ERR printk(KERN_ERR
"PnPBIOS: Unknown tag '0x%x', length '%d'.\n", "PnPBIOS: Unknown tag '0x%x', length '%d'.\n",
tag, len); tag, len);
...@@ -298,6 +298,7 @@ static void pnpbios_parse_fixed_mem32_option(unsigned char *p, int size, ...@@ -298,6 +298,7 @@ static void pnpbios_parse_fixed_mem32_option(unsigned char *p, int size,
struct pnp_option *option) struct pnp_option *option)
{ {
struct pnp_mem *mem; struct pnp_mem *mem;
mem = kzalloc(sizeof(struct pnp_mem), GFP_KERNEL); mem = kzalloc(sizeof(struct pnp_mem), GFP_KERNEL);
if (!mem) if (!mem)
return; return;
...@@ -468,7 +469,7 @@ static unsigned char *pnpbios_parse_resource_option_data(unsigned char *p, ...@@ -468,7 +469,7 @@ static unsigned char *pnpbios_parse_resource_option_data(unsigned char *p,
return p + 2; return p + 2;
default: /* an unkown tag */ default: /* an unkown tag */
len_err: len_err:
printk(KERN_ERR printk(KERN_ERR
"PnPBIOS: Unknown tag '0x%x', length '%d'.\n", "PnPBIOS: Unknown tag '0x%x', length '%d'.\n",
tag, len); tag, len);
...@@ -562,7 +563,7 @@ static unsigned char *pnpbios_parse_compatible_ids(unsigned char *p, ...@@ -562,7 +563,7 @@ static unsigned char *pnpbios_parse_compatible_ids(unsigned char *p,
break; break;
default: /* an unkown tag */ default: /* an unkown tag */
len_err: len_err:
printk(KERN_ERR printk(KERN_ERR
"PnPBIOS: Unknown tag '0x%x', length '%d'.\n", "PnPBIOS: Unknown tag '0x%x', length '%d'.\n",
tag, len); tag, len);
...@@ -756,7 +757,7 @@ static unsigned char *pnpbios_encode_allocated_resource_data(unsigned char *p, ...@@ -756,7 +757,7 @@ static unsigned char *pnpbios_encode_allocated_resource_data(unsigned char *p,
break; break;
default: /* an unkown tag */ default: /* an unkown tag */
len_err: len_err:
printk(KERN_ERR printk(KERN_ERR
"PnPBIOS: Unknown tag '0x%x', length '%d'.\n", "PnPBIOS: Unknown tag '0x%x', length '%d'.\n",
tag, len); tag, len);
......
...@@ -47,9 +47,6 @@ struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev) ...@@ -47,9 +47,6 @@ struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev)
{ {
struct pnp_option *option; struct pnp_option *option;
if (!dev)
return NULL;
option = pnp_build_option(PNP_RES_PRIORITY_PREFERRED); option = pnp_build_option(PNP_RES_PRIORITY_PREFERRED);
/* this should never happen but if it does we'll try to continue */ /* this should never happen but if it does we'll try to continue */
...@@ -64,9 +61,6 @@ struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev, ...@@ -64,9 +61,6 @@ struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev,
{ {
struct pnp_option *option; struct pnp_option *option;
if (!dev)
return NULL;
option = pnp_build_option(priority); option = pnp_build_option(priority);
if (dev->dependent) { if (dev->dependent) {
...@@ -83,11 +77,6 @@ int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data) ...@@ -83,11 +77,6 @@ int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data)
{ {
struct pnp_irq *ptr; struct pnp_irq *ptr;
if (!option)
return -EINVAL;
if (!data)
return -EINVAL;
ptr = option->irq; ptr = option->irq;
while (ptr && ptr->next) while (ptr && ptr->next)
ptr = ptr->next; ptr = ptr->next;
...@@ -112,11 +101,6 @@ int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data) ...@@ -112,11 +101,6 @@ int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data)
{ {
struct pnp_dma *ptr; struct pnp_dma *ptr;
if (!option)
return -EINVAL;
if (!data)
return -EINVAL;
ptr = option->dma; ptr = option->dma;
while (ptr && ptr->next) while (ptr && ptr->next)
ptr = ptr->next; ptr = ptr->next;
...@@ -132,11 +116,6 @@ int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data) ...@@ -132,11 +116,6 @@ int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data)
{ {
struct pnp_port *ptr; struct pnp_port *ptr;
if (!option)
return -EINVAL;
if (!data)
return -EINVAL;
ptr = option->port; ptr = option->port;
while (ptr && ptr->next) while (ptr && ptr->next)
ptr = ptr->next; ptr = ptr->next;
...@@ -152,11 +131,6 @@ int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data) ...@@ -152,11 +131,6 @@ int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data)
{ {
struct pnp_mem *ptr; struct pnp_mem *ptr;
if (!option)
return -EINVAL;
if (!data)
return -EINVAL;
ptr = option->mem; ptr = option->mem;
while (ptr && ptr->next) while (ptr && ptr->next)
ptr = ptr->next; ptr = ptr->next;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment