Return an error code instead of a devfs_handle_t. The handle isn't
useful for anything and the !CONFIG_DEVFS_FS stub in fact returned
NULL which made it entirely useless. Thus only one driver is actually
checking the retval in the current tree..
Alexander Viro [Wed, 23 Apr 2003 11:19:54 +0000 (04:19 -0700)]
[PATCH] tty cleanups (12/12)
* we allow tty_driver to cover more than 256 devices
* pty.c cleaned up - now we only one driver for UNIX98 masters and
only one driver for UNIX98 slaves, so a lot of ugliness can be killed.
* get_tty_driver() became an analog of get_gendisk() - it does
a lookup by device number and gives (pointer to tty_driver,index).
* registration/unregistration of tty_driver updated
* /proc/tty/drivers code updated (now one structure can be responsible
for several lines)
Alexander Viro [Wed, 23 Apr 2003 11:19:46 +0000 (04:19 -0700)]
[PATCH] tty cleanups (11/12)
tty->device switched to dev_t
There are very few uses of tty->device left by now; most of
them actually want dev_t (process accounting, proc/<pid>/stat, several
ioctls, slip.c logics, etc.) and the rest will go away shortly.
Alexander Viro [Wed, 23 Apr 2003 11:19:36 +0000 (04:19 -0700)]
[PATCH] tty cleanups (10/12)
Preparations to cleanup:
* call of get_tty_driver() moved from init_dev() to its callers
* instead of kdev_t dev we pass struct tty_struct *driver and int index
Alexander Viro [Wed, 23 Apr 2003 11:19:27 +0000 (04:19 -0700)]
[PATCH] tty cleanups (9/12)
* drivers/char/rio/* supports up to 4 boards, each with up to 128
lines. It used to share termios for 1st/3rd and 2nd/4th boards, Fixed.
* cleanups and kdev_t removals - we pass tty instead of tty->device
in a couple of helper functions and instead of comparisons on major(tty->device)
we check where does tty->driver point to.
Alexander Viro [Wed, 23 Apr 2003 11:18:59 +0000 (04:18 -0700)]
[PATCH] tty cleanups (6/12)
tty->tty_index added; we initialize it with minor(tty->device) -
tty->driver->minor_start. Majority of remaining tty->device uses had
that form and are switched to use of tty->index.
Alexander Viro [Wed, 23 Apr 2003 11:18:48 +0000 (04:18 -0700)]
[PATCH] tty cleanups (5/12)
new field - tty->tty_name;
initialized to <driver->name><tty index+driver->base_name>
when we allocate tty_struct. Drivers code switched to use of that
beast (in debugging printks, mostly). Large, but trivial.
Alexander Viro [Wed, 23 Apr 2003 11:18:37 +0000 (04:18 -0700)]
[PATCH] tty cleanups (4/12)
Instead of registering "drivers" for /dev/tty, /dev/vc/0, /dev/ptmx
and /dev/console (they are never looked up since tty_open() special-cases
them and they should not be looked up - these devices are remapped on open)
we register corresponding chrdev ranges and devfs nodes directly.
/proc/tty/drivers code updated to keep the contents unchanged
Ben Collins [Wed, 23 Apr 2003 10:50:15 +0000 (03:50 -0700)]
[PATCH] IEEE1394/Firewire updates
- Workaround possible reset loop trying to get IRM sanity
- Logical Unit DIrectory (LUN) support for sbp2(scsi) devices.
- Fix hostnum allocation.
- Whitespace and formatting sync with 2.4 branch.
- Make pcilynx return IRQ_NONE for no interrupts to handle.
Russell King [Wed, 23 Apr 2003 23:04:13 +0000 (00:04 +0100)]
[PCMCIA] Make cb_release_cis_mem() local to cardbus.c
The cardbus CIS parsing code does not use the PCMCIA resource
subsystem, so there isn't any point in freeing its memory when
we remove PCMCIA memory resources. We also free CIS resources
immediately prior to calling cb_free(). We might as well move
the function call into cb_free(), thereby making all references
to cb_release_cis_mem() local to cardbus.c
Russell King [Wed, 23 Apr 2003 22:18:16 +0000 (23:18 +0100)]
[PCMCIA] Don't cache CIS bytes found to be invalid.
Several PCMCIA cards I have here do not work correctly over a
suspend/resume cycle; the PCMCIA code believes that the card has
been changed in the slot, and therefore performs a remove/insert
cycle.
This seems to be because the card returns more or less random data
when reading memory space, leading to the CIS cache mismatching
the card data. This in turn is caused because we try to read CIS
data from both the attribute and memory spaces, and we add the result
to the CIS cache whether or not the returned data was valid.
We therefore convert the CIS cache to use a linked list, and provide
a way to remove cached data from that list. We also replace the
"s->cis_used=0;" construct with a function "destroy_cis_cache(s)"
which clearly describes what we're doing.
Pavel Roskin [Wed, 23 Apr 2003 21:59:33 +0000 (22:59 +0100)]
[PCMCIA] Fix oops in validate_mem when CONFIG_PCMCIA_PROBE=n
If I compile a recent 2.5.x kernel without CONFIG_ISA defined, I get
an oops in validate_mem(). Stack trace contains 0x6b6b6b6 - a clear
sign that freed memory is being accessed.
It's the second validate_mem() in drivers/pcmcia/rsrc_mgr.c - the one
used when CONFIG_PCMCIA_PROBE is not defined. It turns out the memory
is freed in do_mem_probe() when it's called from validate_mem().
The solution is to use the same trick as in the first validate_mem().
This problem is quite serious and it's not specific to the plx9052
driver. I see it with yenta_socket as well.
David Brownell [Wed, 23 Apr 2003 05:05:40 +0000 (22:05 -0700)]
[PATCH] usb: fix (rare?) disconnect
It's not good to dereference pointers before checking
them for null. Seen once on a faulty device init,
which I don't think I'd ever seen before "in the wild".
(Caused by some other 2.5.68 strangeness.)
David Brownell [Wed, 23 Apr 2003 05:05:10 +0000 (22:05 -0700)]
[PATCH] USB: hcd-pci.c catch up to dev_printk changes
The preceding patch to fix this was incomplete, since
it didn't work for the pure debug messages. And that
was because the DEBUG-vs-CONFIG_USB_DEBUG stuff changed
somewhere.
I had to move the rtnetlink_init and init_netlink calls to af_netlink init time, so that
the sk_alloc called down the rtnetlink_init callchain is done after the PF_NETLINK
net_proto_family is sock_registered, and because of that the af_netlink init function
call had to be moved to earlier by means of subsys_initcall (DaveM's suggestion).
This fixes a problem with drivers that have request on the stack for
some operations, like IDE. If we wake before releasing the request, the
stack may have already disappeared beneath us when the rest of
end_that_request_last() is run.