Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40717
b: refs/heads/master
c: 59359ff
h: refs/heads/master
i:
  40715: 3de051b
v: v3
  • Loading branch information
David S. Miller committed Nov 6, 2006
1 parent 35a9e46 commit 7cfc87a
Show file tree
Hide file tree
Showing 84 changed files with 560 additions and 1,832 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4bdbd2807deeccc0793d57fb5120d7a53f2c0b3c
refs/heads/master: 59359ff87700f5e742c96a55da9cf0819984c128
8 changes: 0 additions & 8 deletions trunk/Documentation/DocBook/kernel-api.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -533,12 +533,4 @@ X!Idrivers/video/console/fonts.c
-->
</sect1>
</chapter>

<chapter id="input_subsystem">
<title>Input Subsystem</title>
!Iinclude/linux/input.h
!Edrivers/input/input.c
!Edrivers/input/ff-core.c
!Edrivers/input/ff-memless.c
</chapter>
</book>
3 changes: 1 addition & 2 deletions trunk/arch/sparc/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,12 @@
#include <asm/mxcc.h>
#include <asm/thread_info.h>
#include <asm/param.h>
#include <asm/unistd.h>

#include <asm/asmmacro.h>

#define curptr g6

#define NR_SYSCALLS 300 /* Each OS is different... */

/* These are just handy. */
#define _SV save %sp, -STACKFRAME_SZ, %sp
#define _RS restore
Expand Down
5 changes: 3 additions & 2 deletions trunk/arch/sparc/kernel/systbls.S
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ sys_call_table:
/*285*/ .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64
/*290*/ .long sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
/*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
/*300*/ .long sys_set_robust_list, sys_get_robust_list
/*300*/ .long sys_set_robust_list, sys_get_robust_list, sys_migrate_pages

#ifdef CONFIG_SUNOS_EMUL
/* Now the SunOS syscall table. */
Expand Down Expand Up @@ -190,6 +190,7 @@ sunos_sys_table:
/*290*/ .long sunos_nosys, sunos_nosys, sunos_nosys
.long sunos_nosys, sunos_nosys, sunos_nosys
.long sunos_nosys, sunos_nosys, sunos_nosys
.long sunos_nosys, sunos_nosys, sunos_nosys
.long sunos_nosys
/*300*/ .long sunos_nosys, sunos_nosys, sunos_nosys

#endif
3 changes: 1 addition & 2 deletions trunk/arch/sparc64/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@
#include <asm/auxio.h>
#include <asm/sfafsr.h>
#include <asm/pil.h>
#include <asm/unistd.h>

#define curptr g6

#define NR_SYSCALLS 300 /* Each OS is different... */

.text
.align 32

Expand Down
8 changes: 5 additions & 3 deletions trunk/arch/sparc64/kernel/systbls.S
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ sys_call_table32:
.word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64
/*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
.word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare
/*300*/ .word compat_sys_set_robust_list, compat_sys_get_robust_list
/*300*/ .word compat_sys_set_robust_list, compat_sys_get_robust_list, compat_sys_migrate_pages

#endif /* CONFIG_COMPAT */

Expand Down Expand Up @@ -149,7 +149,7 @@ sys_call_table:
.word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64
/*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat
.word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare
/*300*/ .word sys_set_robust_list, sys_get_robust_list
/*300*/ .word sys_set_robust_list, sys_get_robust_list, sys_migrate_pages

#if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \
defined(CONFIG_SOLARIS_EMUL_MODULE)
Expand Down Expand Up @@ -262,5 +262,7 @@ sunos_sys_table:
/*290*/ .word sunos_nosys, sunos_nosys, sunos_nosys
.word sunos_nosys, sunos_nosys, sunos_nosys
.word sunos_nosys, sunos_nosys, sunos_nosys
.word sunos_nosys, sunos_nosys, sunos_nosys
.word sunos_nosys
/*300*/ .word sunos_nosys, sunos_nosys, sunos_nosys

#endif
2 changes: 1 addition & 1 deletion trunk/drivers/char/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ static void k_fn(struct vc_data *vc, unsigned char value, char up_flag)

static void k_cur(struct vc_data *vc, unsigned char value, char up_flag)
{
static const char cur_chars[] = "BDCA";
static const char *cur_chars = "BDCA";

if (up_flag)
return;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/input/ff-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ static int erase_effect(struct input_dev *dev, int effect_id,
}

/**
* input_ff_erase - erase a force-feedback effect from device
* input_ff_erase - erase an effect from device
* @dev: input device to erase effect from
* @effect_id: id of the ffect to be erased
* @file: purported owner of the request
Expand Down Expand Up @@ -347,7 +347,7 @@ EXPORT_SYMBOL_GPL(input_ff_create);

/**
* input_ff_free() - frees force feedback portion of input device
* @dev: input device supporting force feedback
* @dev: input device supporintg force feedback
*
* This function is only needed in error path as input core will
* automatically free force feedback structures when device is
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/input/ff-memless.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ static void ml_ff_destroy(struct ff_device *ff)
}

/**
* input_ff_create_memless() - create memoryless force-feedback device
* input_ff_create_memless() - create memoryless FF device
* @dev: input device supporting force-feedback
* @data: driver-specific data to be passed into @play_effect
* @play_effect: driver-specific method for playing FF effect
Expand Down
19 changes: 10 additions & 9 deletions trunk/drivers/input/gameport/gameport.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,12 @@ static int gameport_driver_remove(struct device *dev)
return 0;
}

static struct bus_type gameport_bus = {
.name = "gameport",
.probe = gameport_driver_probe,
.remove = gameport_driver_remove,
};

static void gameport_add_driver(struct gameport_driver *drv)
{
int error;
Expand Down Expand Up @@ -775,15 +781,6 @@ static int gameport_bus_match(struct device *dev, struct device_driver *drv)
return !gameport_drv->ignore;
}

static struct bus_type gameport_bus = {
.name = "gameport",
.dev_attrs = gameport_device_attrs,
.drv_attrs = gameport_driver_attrs,
.match = gameport_bus_match,
.probe = gameport_driver_probe,
.remove = gameport_driver_remove,
};

static void gameport_set_drv(struct gameport *gameport, struct gameport_driver *drv)
{
mutex_lock(&gameport->drv_mutex);
Expand All @@ -793,6 +790,7 @@ static void gameport_set_drv(struct gameport *gameport, struct gameport_driver *

int gameport_open(struct gameport *gameport, struct gameport_driver *drv, int mode)
{

if (gameport->open) {
if (gameport->open(gameport, mode)) {
return -1;
Expand Down Expand Up @@ -820,6 +818,9 @@ static int __init gameport_init(void)
{
int error;

gameport_bus.dev_attrs = gameport_device_attrs;
gameport_bus.drv_attrs = gameport_driver_attrs;
gameport_bus.match = gameport_bus_match;
error = bus_register(&gameport_bus);
if (error) {
printk(KERN_ERR "gameport: failed to register gameport bus, error: %d\n", error);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/input/gameport/lightning.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ static int __init l4_init(void)
int i, cards = 0;

if (!request_region(L4_PORT, 1, "lightning"))
return -EBUSY;
return -1;

for (i = 0; i < 2; i++)
if (l4_add_card(i) == 0)
Expand All @@ -319,7 +319,7 @@ static int __init l4_init(void)

if (!cards) {
release_region(L4_PORT, 1);
return -ENODEV;
return -1;
}

return 0;
Expand Down
25 changes: 1 addition & 24 deletions trunk/drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static struct input_handler *input_table[8];

/**
* input_event() - report new input event
* @dev: device that generated the event
* @handle: device that generated the event
* @type: type of the event
* @code: event code
* @value: value of the event
Expand Down Expand Up @@ -900,15 +900,6 @@ struct class input_class = {
};
EXPORT_SYMBOL_GPL(input_class);

/**
* input_allocate_device - allocate memory for new input device
*
* Returns prepared struct input_dev or NULL.
*
* NOTE: Use input_free_device() to free devices that have not been
* registered; input_unregister_device() should be used for already
* registered devices.
*/
struct input_dev *input_allocate_device(void)
{
struct input_dev *dev;
Expand All @@ -928,20 +919,6 @@ struct input_dev *input_allocate_device(void)
}
EXPORT_SYMBOL(input_allocate_device);

/**
* input_free_device - free memory occupied by input_dev structure
* @dev: input device to free
*
* This function should only be used if input_register_device()
* was not called yet or if it failed. Once device was registered
* use input_unregister_device() and memory will be freed once last
* refrence to the device is dropped.
*
* Device should be allocated by input_allocate_device().
*
* NOTE: If there are references to the input device then memory
* will not be freed until last reference is dropped.
*/
void input_free_device(struct input_dev *dev)
{
if (dev) {
Expand Down
10 changes: 1 addition & 9 deletions trunk/drivers/input/joystick/adi.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,19 +521,11 @@ static int adi_connect(struct gameport *gameport, struct gameport_driver *drv)
for (i = 0; i < 2; i++)
if (port->adi[i].length > 0) {
adi_init_center(port->adi + i);
err = input_register_device(port->adi[i].dev);
if (err)
goto fail3;
input_register_device(port->adi[i].dev);
}

return 0;

fail3: while (--i >= 0) {
if (port->adi[i].length > 0) {
input_unregister_device(port->adi[i].dev);
port->adi[i].dev = NULL;
}
}
fail2: for (i = 0; i < 2; i++)
if (port->adi[i].dev)
input_free_device(port->adi[i].dev);
Expand Down
6 changes: 1 addition & 5 deletions trunk/drivers/input/joystick/amijoy.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,7 @@ static int __init amijoy_init(void)
amijoy_dev[i]->absmax[ABS_X + j] = 1;
}

err = input_register_device(amijoy_dev[i]);
if (err) {
input_free_device(amijoy_dev[i]);
goto fail;
}
input_register_device(amijoy_dev[i]);
}
return 0;

Expand Down
10 changes: 2 additions & 8 deletions trunk/drivers/input/joystick/analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,6 @@ static int analog_init_device(struct analog_port *port, struct analog *analog, i
{
struct input_dev *input_dev;
int i, j, t, v, w, x, y, z;
int error;

analog_name(analog);
snprintf(analog->phys, sizeof(analog->phys),
Expand Down Expand Up @@ -506,11 +505,7 @@ static int analog_init_device(struct analog_port *port, struct analog *analog, i

analog_decode(analog, port->axes, port->initial, port->buttons);

error = input_register_device(analog->dev);
if (error) {
input_free_device(analog->dev);
return error;
}
input_register_device(analog->dev);

return 0;
}
Expand Down Expand Up @@ -673,8 +668,7 @@ static int analog_connect(struct gameport *gameport, struct gameport_driver *drv
return 0;

fail3: while (--i >= 0)
if (port->analog[i].mask)
input_unregister_device(port->analog[i].dev);
input_unregister_device(port->analog[i].dev);
fail2: gameport_close(gameport);
fail1: gameport_set_drvdata(gameport, NULL);
kfree(port);
Expand Down
7 changes: 2 additions & 5 deletions trunk/drivers/input/joystick/cobra.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,12 @@ static int cobra_connect(struct gameport *gameport, struct gameport_driver *drv)
for (j = 0; cobra_btn[j]; j++)
set_bit(cobra_btn[j], input_dev->keybit);

err = input_register_device(cobra->dev[i]);
if (err)
goto fail4;
input_register_device(cobra->dev[i]);
}

return 0;

fail4: input_free_device(cobra->dev[i]);
fail3: while (--i >= 0)
fail3: for (i = 0; i < 2; i++)
if (cobra->dev[i])
input_unregister_device(cobra->dev[i]);
fail2: gameport_close(gameport);
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/input/joystick/gf2k.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,7 @@ static int gf2k_connect(struct gameport *gameport, struct gameport_driver *drv)
input_dev->absflat[gf2k_abs[i]] = (i < 2) ? 24 : 0;
}

err = input_register_device(gf2k->dev);
if (err)
goto fail2;
input_register_device(gf2k->dev);

return 0;

Expand Down
13 changes: 2 additions & 11 deletions trunk/drivers/input/joystick/grip_mp.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,10 +423,7 @@ static int get_and_decode_packet(struct grip_mp *grip, int flags)

if (!port->registered) {
dbg("New Grip pad in multiport slot %d.\n", slot);
if (register_slot(slot, grip)) {
port->mode = GRIP_MODE_RESET;
port->dirty = 0;
}
register_slot(slot, grip);
}
return flags;
}
Expand Down Expand Up @@ -588,7 +585,6 @@ static int register_slot(int slot, struct grip_mp *grip)
struct grip_port *port = grip->port[slot];
struct input_dev *input_dev;
int j, t;
int err;

port->dev = input_dev = input_allocate_device();
if (!input_dev)
Expand All @@ -614,12 +610,7 @@ static int register_slot(int slot, struct grip_mp *grip)
if (t > 0)
set_bit(t, input_dev->keybit);

err = input_register_device(port->dev);
if (err) {
input_free_device(port->dev);
return err;
}

input_register_device(port->dev);
port->registered = 1;

if (port->dirty) /* report initial state, if any */
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/input/joystick/guillemot.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,7 @@ static int guillemot_connect(struct gameport *gameport, struct gameport_driver *
for (i = 0; (t = guillemot->type->btn[i]) >= 0; i++)
set_bit(t, input_dev->keybit);

err = input_register_device(guillemot->dev);
if (err)
goto fail2;
input_register_device(guillemot->dev);

return 0;

Expand Down
Loading

0 comments on commit 7cfc87a

Please sign in to comment.