Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104712
b: refs/heads/master
c: e105b8b
h: refs/heads/master
v: v3
  • Loading branch information
Dan Williams authored and Greg Kroah-Hartman committed Jul 22, 2008
1 parent e5c9efa commit efe3812
Show file tree
Hide file tree
Showing 108 changed files with 8,053 additions and 9,033 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: f10140fbe5f97ecfeda986a12d0f1bad75642779
refs/heads/master: e105b8bfc769b0545b6f0f395179d1e43cbee822
20 changes: 20 additions & 0 deletions trunk/Documentation/ABI/testing/sysfs-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
What: /sys/dev
Date: April 2008
KernelVersion: 2.6.26
Contact: Dan Williams <dan.j.williams@intel.com>
Description: The /sys/dev tree provides a method to look up the sysfs
path for a device using the information returned from
stat(2). There are two directories, 'block' and 'char',
beneath /sys/dev containing symbolic links with names of
the form "<major>:<minor>". These links point to the
corresponding sysfs path for the given device.

Example:
$ readlink /sys/dev/block/8:32
../../block/sdc

Entries in /sys/dev/char and /sys/dev/block will be
dynamically created and destroyed as devices enter and
leave the system.

Users: mdadm <linux-raid@vger.kernel.org>
6 changes: 6 additions & 0 deletions trunk/Documentation/filesystems/sysfs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ The top level sysfs directory looks like:
block/
bus/
class/
dev/
devices/
firmware/
net/
Expand All @@ -274,6 +275,11 @@ fs/ contains a directory for some filesystems. Currently each
filesystem wanting to export attributes must create its own hierarchy
below fs/ (see ./fuse.txt for an example).

dev/ contains two directories char/ and block/. Inside these two
directories there are symlinks named <major>:<minor>. These symlinks
point to the sysfs directory for the given device. /sys/dev provides a
quick way to lookup the sysfs interface for a device from the result of
a stat(2) operation.

More information can driver-model specific features can be found in
Documentation/driver-model/.
Expand Down
8 changes: 5 additions & 3 deletions trunk/Documentation/specialix.txt
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ The pinout of the connectors on the IO8+ is:
Hardware handshaking issues.
============================

The driver can be told to operate in two different ways. The default
behaviour is specialix.sx_rtscts = 0 where the pin behaves as DTR when
The driver can be compiled in two different ways. The default
("Specialix DTR/RTS pin is RTS" is off) the pin behaves as DTR when
hardware handshaking is off. It behaves as the RTS hardware
handshaking signal when hardware handshaking is selected.

Expand All @@ -280,7 +280,7 @@ cable will either be compatible with hardware handshaking or with
software handshaking. So switching on the fly is not really an
option.

I actually prefer to use the "specialix.sx_rtscts=1" option.
I actually prefer to use the "Specialix DTR/RTS pin is RTS" option.
This makes the DTR/RTS pin always an RTS pin, and ioctls to
change DTR are always ignored. I have a cable that is configured
for this.
Expand Down Expand Up @@ -379,5 +379,7 @@ it doesn't fit in your computer, bring back the card.
You have to WRITE to the address register to even
read-probe a CD186x register. Disable autodetection?
-- Specialix: any suggestions?
- Arbitrary baud rates are not implemented yet.
If you need this, bug me about it.


7 changes: 3 additions & 4 deletions trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -4047,10 +4047,9 @@ W: http://www.buzzard.org.uk/toshiba/
S: Maintained

TPM DEVICE DRIVER
P: Debora Velarde
M: debora@linux.vnet.ibm.com
P: Rajiv Andrade
M: srajiv@linux.vnet.ibm.com
P: Debora Velarde
P: Rajiv Andrade
M: tpmdd-devel@lists.sourceforge.net
W: http://tpmdd.sourceforge.net
P: Marcel Selhorst
M: tpm@selhorst.net
Expand Down
3 changes: 1 addition & 2 deletions trunk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1148,8 +1148,7 @@ clean: archclean $(clean-dirs)
@find . $(RCS_FIND_IGNORE) \
\( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
-o -name '*.symtypes' -o -name 'modules.order' \
-o -name 'Module.markers' \) \
-o -name '*.symtypes' -o -name 'modules.order' \) \
-type f -print | xargs rm -f

# mrproper - Delete all generated files, including .config
Expand Down
5 changes: 4 additions & 1 deletion trunk/block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,10 @@ static struct kobject *base_probe(dev_t devt, int *part, void *data)

static int __init genhd_device_init(void)
{
int error = class_register(&block_class);
int error;

block_class.dev_kobj = sysfs_dev_block_kobj;
error = class_register(&block_class);
if (unlikely(error))
return error;
bdev_map = kobj_map_init(base_probe, &block_class_lock);
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/base/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ int class_register(struct class *cls)
if (error)
return error;

/* set the default /sys/dev directory for devices of this class */
if (!cls->dev_kobj)
cls->dev_kobj = sysfs_dev_char_kobj;

#if defined(CONFIG_SYSFS_DEPRECATED) && defined(CONFIG_BLOCK)
/* let the block class directory show up in the root of sysfs */
if (cls != &block_class)
Expand Down
83 changes: 82 additions & 1 deletion trunk/drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@

int (*platform_notify)(struct device *dev) = NULL;
int (*platform_notify_remove)(struct device *dev) = NULL;
static struct kobject *dev_kobj;
struct kobject *sysfs_dev_char_kobj;
struct kobject *sysfs_dev_block_kobj;

#ifdef CONFIG_BLOCK
static inline int device_is_not_partition(struct device *dev)
Expand Down Expand Up @@ -775,6 +778,54 @@ int dev_set_name(struct device *dev, const char *fmt, ...)
}
EXPORT_SYMBOL_GPL(dev_set_name);

/**
* device_to_dev_kobj - select a /sys/dev/ directory for the device
* @dev: device
*
* By default we select char/ for new entries. Setting class->dev_obj
* to NULL prevents an entry from being created. class->dev_kobj must
* be set (or cleared) before any devices are registered to the class
* otherwise device_create_sys_dev_entry() and
* device_remove_sys_dev_entry() will disagree about the the presence
* of the link.
*/
static struct kobject *device_to_dev_kobj(struct device *dev)
{
struct kobject *kobj;

if (dev->class)
kobj = dev->class->dev_kobj;
else
kobj = sysfs_dev_char_kobj;

return kobj;
}

static int device_create_sys_dev_entry(struct device *dev)
{
struct kobject *kobj = device_to_dev_kobj(dev);
int error = 0;
char devt_str[15];

if (kobj) {
format_dev_t(devt_str, dev->devt);
error = sysfs_create_link(kobj, &dev->kobj, devt_str);
}

return error;
}

static void device_remove_sys_dev_entry(struct device *dev)
{
struct kobject *kobj = device_to_dev_kobj(dev);
char devt_str[15];

if (kobj) {
format_dev_t(devt_str, dev->devt);
sysfs_remove_link(kobj, devt_str);
}
}

/**
* device_add - add device to device hierarchy.
* @dev: device.
Expand Down Expand Up @@ -829,6 +880,10 @@ int device_add(struct device *dev)
error = device_create_file(dev, &devt_attr);
if (error)
goto ueventattrError;

error = device_create_sys_dev_entry(dev);
if (error)
goto devtattrError;
}

error = device_add_class_symlinks(dev);
Expand Down Expand Up @@ -872,6 +927,9 @@ int device_add(struct device *dev)
AttrsError:
device_remove_class_symlinks(dev);
SymlinkError:
if (MAJOR(dev->devt))
device_remove_sys_dev_entry(dev);
devtattrError:
if (MAJOR(dev->devt))
device_remove_file(dev, &devt_attr);
ueventattrError:
Expand Down Expand Up @@ -948,8 +1006,10 @@ void device_del(struct device *dev)
device_pm_remove(dev);
if (parent)
klist_del(&dev->knode_parent);
if (MAJOR(dev->devt))
if (MAJOR(dev->devt)) {
device_remove_sys_dev_entry(dev);
device_remove_file(dev, &devt_attr);
}
if (dev->class) {
device_remove_class_symlinks(dev);

Expand Down Expand Up @@ -1074,7 +1134,25 @@ int __init devices_init(void)
devices_kset = kset_create_and_add("devices", &device_uevent_ops, NULL);
if (!devices_kset)
return -ENOMEM;
dev_kobj = kobject_create_and_add("dev", NULL);
if (!dev_kobj)
goto dev_kobj_err;
sysfs_dev_block_kobj = kobject_create_and_add("block", dev_kobj);
if (!sysfs_dev_block_kobj)
goto block_kobj_err;
sysfs_dev_char_kobj = kobject_create_and_add("char", dev_kobj);
if (!sysfs_dev_char_kobj)
goto char_kobj_err;

return 0;

char_kobj_err:
kobject_put(sysfs_dev_block_kobj);
block_kobj_err:
kobject_put(dev_kobj);
dev_kobj_err:
kset_unregister(devices_kset);
return -ENOMEM;
}

EXPORT_SYMBOL_GPL(device_for_each_child);
Expand Down Expand Up @@ -1447,4 +1525,7 @@ void device_shutdown(void)
dev->driver->shutdown(dev);
}
}
kobject_put(sysfs_dev_char_kobj);
kobject_put(sysfs_dev_block_kobj);
kobject_put(dev_kobj);
}
10 changes: 10 additions & 0 deletions trunk/drivers/char/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,16 @@ config SPECIALIX
and compile this driver as kernel loadable module which will be
called specialix.

config SPECIALIX_RTSCTS
bool "Specialix DTR/RTS pin is RTS"
depends on SPECIALIX
help
The Specialix IO8+ card can only support either RTS or DTR. If you
say N here, the driver will use the pin as "DTR" when the tty is in
software handshake mode. If you say Y here or hardware handshake is
on, it will always be RTS. Read the file
<file:Documentation/specialix.txt> for more information.

config SX
tristate "Specialix SX (and SI) card support"
depends on SERIAL_NONSTANDARD && (PCI || EISA || ISA)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/char/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
FONTMAPFILE = cp437.uni

obj-y += mem.o random.o tty_io.o n_tty.o tty_ioctl.o tty_ldisc.o
obj-y += mem.o random.o tty_io.o n_tty.o tty_ioctl.o

obj-$(CONFIG_LEGACY_PTYS) += pty.o
obj-$(CONFIG_UNIX98_PTYS) += pty.o
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/char/amiserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ static int rs_tiocmset(struct tty_struct *tty, struct file *file,
/*
* rs_break() --- routine which turns the break handling on or off
*/
static int rs_break(struct tty_struct *tty, int break_state)
static void rs_break(struct tty_struct *tty, int break_state)
{
struct async_struct * info = (struct async_struct *)tty->driver_data;
unsigned long flags;
Expand All @@ -1263,7 +1263,6 @@ static int rs_break(struct tty_struct *tty, int break_state)
custom.adkcon = AC_UARTBRK;
mb();
local_irq_restore(flags);
return 0;
}


Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/char/cyclades.c
Original file line number Diff line number Diff line change
Expand Up @@ -3700,15 +3700,14 @@ cy_tiocmset(struct tty_struct *tty, struct file *file,
/*
* cy_break() --- routine which turns the break handling on or off
*/
static int cy_break(struct tty_struct *tty, int break_state)
static void cy_break(struct tty_struct *tty, int break_state)
{
struct cyclades_port *info = tty->driver_data;
struct cyclades_card *card;
unsigned long flags;
int retval = 0;

if (serial_paranoia_check(info, tty->name, "cy_break"))
return -EINVAL;
return;

card = info->card;

Expand Down Expand Up @@ -3737,6 +3736,8 @@ static int cy_break(struct tty_struct *tty, int break_state)
}
}
} else {
int retval;

if (break_state == -1) {
retval = cyz_issue_cmd(card,
info->line - card->first_line,
Expand All @@ -3757,7 +3758,6 @@ static int cy_break(struct tty_struct *tty, int break_state)
}
}
spin_unlock_irqrestore(&card->card_lock, flags);
return retval;
} /* cy_break */

static int get_mon_info(struct cyclades_port *info,
Expand Down
Loading

0 comments on commit efe3812

Please sign in to comment.