[GIT PATCH] driver core patches against 2.6.26 - Kernel

This is a discussion on [GIT PATCH] driver core patches against 2.6.26 - Kernel ; Here are a bunch of driver core patches against your 2.6.26-git tree. They do a variety of things: - class core cleanups - fixup for device_create() api - KOBJ_NAME_LEN fixes - bus_id removals - UIO driver updates - HP driver ...

+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast
Results 1 to 20 of 79

Thread: [GIT PATCH] driver core patches against 2.6.26

  1. [GIT PATCH] driver core patches against 2.6.26

    Here are a bunch of driver core patches against your 2.6.26-git tree.

    They do a variety of things:
    - class core cleanups
    - fixup for device_create() api
    - KOBJ_NAME_LEN fixes
    - bus_id removals
    - UIO driver updates
    - HP driver for service processors

    All of these have been in the -mm and -next trees for quite a while.

    Please pull from:
    master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-core-2.6.git/

    The patches will be sent as a follow-on to this message to lkml for people
    to see.

    thanks,

    greg k-h

    ------------

    Documentation/ABI/testing/sysfs-dev | 20 +
    Documentation/DocBook/uio-howto.tmpl | 63 ++-
    Documentation/HOWTO | 2 +-
    Documentation/filesystems/sysfs.txt | 6 +
    Documentation/sysfs-rules.txt | 5 +-
    arch/arm/common/dmabounce.c | 22 +-
    arch/arm/common/locomo.c | 2 +-
    arch/arm/common/sa1111.c | 10 +-
    arch/arm/common/scoop.c | 2 +-
    arch/arm/kernel/ecard.c | 5 +-
    arch/arm/kernel/time.c | 4 +-
    arch/arm/mach-integrator/impd1.c | 7 +-
    arch/arm/mach-integrator/lm.c | 6 +-
    arch/arm/plat-omap/mailbox.c | 2 +-
    arch/avr32/kernel/cpu.c | 38 +-
    arch/ia64/kernel/err_inject.c | 22 +-
    arch/mips/kernel/rtlx.c | 4 +-
    arch/mips/sibyte/common/sb_tbprof.c | 3 +-
    arch/powerpc/kernel/sysfs.c | 15 +-
    arch/powerpc/platforms/cell/cbe_thermal.c | 45 +-
    arch/powerpc/platforms/cell/spu_base.c | 3 +-
    arch/powerpc/platforms/chrp/pci.c | 2 +-
    arch/s390/kernel/smp.c | 36 +-
    arch/s390/kernel/time.c | 35 +-
    arch/sh/drivers/dma/dma-sysfs.c | 15 +-
    arch/sparc64/kernel/ebus.c | 4 +-
    arch/sparc64/kernel/of_device.c | 4 +-
    arch/sparc64/kernel/pci.c | 2 +-
    arch/sparc64/kernel/sysfs.c | 16 +-
    arch/sparc64/kernel/vio.c | 18 +-
    arch/x86/kernel/cpu/mcheck/mce_64.c | 18 +-
    arch/x86/kernel/cpu/mcheck/therm_throt.c | 1 +
    arch/x86/kernel/cpuid.c | 4 +-
    arch/x86/kernel/microcode.c | 10 +-
    arch/x86/kernel/msr.c | 4 +-
    arch/x86/kernel/pci-dma.c | 6 +-
    arch/x86/kernel/pci-gart_64.c | 4 +-
    block/bsg.c | 3 +-
    block/genhd.c | 205 +++---
    drivers/acpi/fan.c | 10 +-
    drivers/acpi/glue.c | 6 +-
    drivers/acpi/processor_core.c | 5 +-
    drivers/acpi/scan.c | 2 +-
    drivers/acpi/thermal.c | 4 +-
    drivers/acpi/video.c | 5 +-
    drivers/base/Kconfig | 3 +-
    drivers/base/base.h | 27 +
    drivers/base/class.c | 153 +++--
    drivers/base/core.c | 196 ++++--
    drivers/base/cpu.c | 10 +-
    drivers/base/memory.c | 12 +-
    drivers/base/node.c | 15 +-
    drivers/base/power/trace.c | 2 +-
    drivers/base/sys.c | 64 ++-
    drivers/base/topology.c | 17 +-
    drivers/block/aoe/aoechr.c | 5 +-
    drivers/block/paride/pg.c | 5 +-
    drivers/block/paride/pt.c | 10 +-
    drivers/block/pktcdvd.c | 4 +-
    drivers/char/dsp56k.c | 3 +-
    drivers/char/ip2/ip2main.c | 12 +-
    drivers/char/ipmi/ipmi_devintf.c | 2 +-
    drivers/char/istallion.c | 5 +-
    drivers/char/lp.c | 3 +-
    drivers/char/mem.c | 6 +-
    drivers/char/misc.c | 4 +-
    drivers/char/pcmcia/cm4000_cs.c | 2 +-
    drivers/char/pcmcia/cm4040_cs.c | 3 +-
    drivers/char/ppdev.c | 5 +-
    drivers/char/raw.c | 7 +-
    drivers/char/snsc.c | 3 +-
    drivers/char/stallion.c | 4 +-
    drivers/char/tty_io.c | 12 +-
    drivers/char/vc_screen.c | 12 +-
    drivers/char/viotape.c | 8 +-
    drivers/char/vt.c | 14 +-
    drivers/char/xilinx_hwicap/xilinx_hwicap.c | 5 +-
    drivers/cpuidle/sysfs.c | 10 +-
    drivers/dca/dca-sysfs.c | 8 +-
    drivers/eisa/Makefile | 2 +-
    drivers/eisa/eisa-bus.c | 4 +-
    drivers/hid/hidraw.c | 5 +-
    drivers/hwmon/hwmon.c | 3 +-
    drivers/i2c/i2c-core.c | 6 +-
    drivers/i2c/i2c-dev.c | 6 +-
    drivers/ide/ide-tape.c | 10 +-
    drivers/ieee1394/dv1394.c | 7 +-
    drivers/ieee1394/nodemgr.c | 23 +-
    drivers/ieee1394/raw1394.c | 4 +-
    drivers/ieee1394/video1394.c | 6 +-
    drivers/infiniband/core/cm.c | 72 +-
    drivers/infiniband/hw/ipath/ipath_file_ops.c | 2 +-
    drivers/isdn/capi/capi.c | 3 +-
    drivers/macintosh/adb.c | 3 +-
    drivers/mca/mca-bus.c | 2 +-
    drivers/media/dvb/dvb-core/dvbdev.c | 4 +-
    drivers/memstick/host/jmb38x_ms.c | 4 +-
    drivers/message/fusion/mptbase.c | 3 +-
    drivers/message/fusion/mptbase.h | 4 +-
    drivers/message/fusion/mptfc.c | 4 +-
    drivers/misc/Kconfig | 13 +
    drivers/misc/Makefile | 1 +
    drivers/misc/hpilo.c | 768 ++++++++++++++++++++
    drivers/misc/hpilo.h | 189 +++++
    drivers/misc/phantom.c | 5 +-
    drivers/mtd/devices/block2mtd.c | 8 +-
    drivers/mtd/mtdchar.c | 9 +-
    drivers/net/3c59x.c | 2 +-
    drivers/net/arm/at91_ether.c | 2 +-
    drivers/net/arm/ep93xx_eth.c | 2 +-
    drivers/net/arm/etherh.c | 6 +-
    drivers/net/ppp_generic.c | 3 +-
    drivers/net/wan/cosa.c | 6 +-
    drivers/pci/hotplug/acpiphp.h | 4 +-
    drivers/power/apm_power.c | 2 +-
    drivers/power/power_supply_core.c | 4 +-
    drivers/rtc/interface.c | 2 +-
    drivers/s390/char/raw3270.c | 14 +-
    drivers/s390/char/tape_class.c | 7 +-
    drivers/s390/char/vmur.c | 5 +-
    drivers/sbus/sbus.c | 6 +-
    drivers/scsi/dpt_i2o.c | 4 +-
    drivers/scsi/hosts.c | 7 +-
    drivers/scsi/scsi_transport_fc.c | 9 +-
    drivers/scsi/scsi_transport_iscsi.c | 8 +-
    drivers/spi/spi.c | 2 +-
    drivers/spi/spidev.c | 4 +-
    drivers/uio/Kconfig | 10 +-
    drivers/uio/Makefile | 1 +
    drivers/uio/uio.c | 26 +
    drivers/uio/uio_pdrv.c | 118 +++
    drivers/usb/core/devio.c | 11 +-
    drivers/usb/core/file.c | 5 +-
    drivers/usb/gadget/printer.c | 4 +-
    drivers/usb/mon/mon_bin.c | 5 +-
    drivers/video/aty/aty128fb.c | 2 +-
    drivers/video/aty/radeonfb.h | 2 +-
    drivers/video/console/fbcon.c | 3 +-
    drivers/video/fbmem.c | 5 +-
    drivers/xen/balloon.c | 1 +
    fs/coda/psdev.c | 5 +-
    fs/debugfs/inode.c | 114 +++-
    fs/partitions/check.c | 2 +-
    fs/sysfs/dir.c | 37 +-
    fs/sysfs/file.c | 5 +-
    fs/sysfs/symlink.c | 41 +-
    fs/sysfs/sysfs.h | 1 +
    include/linux/debugfs.h | 4 +
    include/linux/device.h | 58 +-
    include/linux/eisa.h | 2 +-
    include/linux/kobject.h | 3 +-
    include/linux/mtd/map.h | 2 +-
    include/linux/mtd/mtd.h | 2 +-
    include/linux/spi/spi.h | 2 +-
    include/linux/sysdev.h | 39 +-
    include/linux/sysfs.h | 10 +
    include/linux/uio_driver.h | 8 +-
    include/scsi/scsi_host.h | 2 +-
    include/scsi/scsi_transport_fc.h | 4 +-
    include/scsi/scsi_transport_iscsi.h | 2 +-
    kernel/rtmutex-tester.c | 7 +-
    kernel/sched.c | 8 +-
    kernel/time/clocksource.c | 8 +-
    lib/Kconfig.debug | 3 +
    lib/kobject.c | 10 +-
    lib/kobject_uevent.c | 3 +-
    net/bluetooth/hci_sysfs.c | 7 -
    .../firmware_sample_firmware_class.c | 2 +-
    samples/kobject/kset-example.c | 2 +-
    scripts/mod/file2alias.c | 24 +-
    sound/core/init.c | 5 +-
    sound/oss/soundcard.c | 14 +-
    sound/sound_core.c | 5 +-
    173 files changed, 2508 insertions(+), 751 deletions(-)
    create mode 100644 Documentation/ABI/testing/sysfs-dev
    create mode 100644 drivers/misc/hpilo.c
    create mode 100644 drivers/misc/hpilo.h
    create mode 100644 drivers/uio/uio_pdrv.c

    ---------------

    Adrian Bunk (1):
    always enable FW_LOADER unless EMBEDDED=y

    Andi Kleen (3):
    sysdev: Pass the attribute to the low level sysdev show/store function
    sysdev: Add utility functions for simple int/ulong variable sysdev attributes
    sysdev: Convert the x86 mce tolerant sysdev attribute to generic attribute

    Ben Dooks (1):
    sysdev: fix debugging statements in registration code.

    Cornelia Huck (1):
    driver core: Suppress sysfs warnings for device_rename().

    Dan Williams (1):
    sysfs: add /sys/dev/{char,block} to lookup sysfs path by major:minor

    Dave Young (1):
    class: change internal semaphore to a mutex

    David Altobelli (1):
    HP iLO driver

    David Brownell (1):
    device create: spi: convert device_create to device_create_drvdata

    Greg Kroah-Hartman (48):
    Firmware: fix typo in example code
    device create: block: convert device_create to device_create_drvdata
    device create: char: convert device_create to device_create_drvdata
    device create: coda: convert device_create to device_create_drvdata
    device create: dca: convert device_create to device_create_drvdata
    device create: dvb: convert device_create to device_create_drvdata
    device create: framebuffer: convert device_create to device_create_drvdata
    device create: hid: convert device_create to device_create_drvdata
    device create: hwmon: convert device_create to device_create_drvdata
    device create: i2c: convert device_create to device_create_drvdata
    device create: ide: convert device_create to device_create_drvdata
    device create: ieee1394: convert device_create to device_create_drvdata
    device create: infiniband: convert device_create to device_create_drvdata
    device create: isdn: convert device_create to device_create_drvdata
    device create: macintosh: convert device_create to device_create_drvdata
    device create: mips: convert device_create to device_create_drvdata
    device create: misc: convert device_create to device_create_drvdata
    device create: mtd: convert device_create to device_create_drvdata
    device create: net: convert device_create to device_create_drvdata
    device create: s390: convert device_create to device_create_drvdata
    device create: scsi: convert device_create to device_create_drvdata
    device create: sound: convert device_create to device_create_drvdata
    device create: usb: convert device_create to device_create_drvdata
    device create: x86: convert device_create to device_create_drvdata
    driver core: remove device_create()
    device create: convert device_create_drvdata to device_create
    Driver Core: add ability for class_for_each_device to start in middle of list
    Driver Core: add ability for class_find_device to start in middle of list
    block: fix compiler warning in genhd.c
    block: make printk_partition use the class iterator function
    block: make blk_lookup_devt use the class iterator function
    block: make proc files seq_start use the class_find_device()
    block: move header for /proc/partitions to seq_start
    block: make /proc/partitions and /proc/diskstats use class_find_device()
    infiniband: rename "device" to "ib_device" in cm_device
    infiniband: make cm_device use a struct device and not a kobject.
    bluetooth: remove improper bluetooth class symlinks.
    class: move driver core specific parts to a private structure
    class: rename "devices" to "class_devices" in internal class structure
    class: rename "interfaces" to "class_interfaces" in internal class structure
    class: rename "subsys" to "class_subsys" in internal class structure
    class: rename "sem" to "class_sem" in internal class structure
    class: fix docbook comments for class_private structure
    driver core: remove DEVICE_ID_SIZE define
    driver core: fix a lot of printk usages of bus_id
    MTD: handle pci_name() being const
    3c59x: handle pci_name() being const
    sparc64: fix up bus_id changes in sparc core code

    Haavard Skinnemoen (1):
    debugfs: Implement debugfs_remove_recursive()

    Hans J. Koch (1):
    UIO: Add write function to allow irq masking

    Kay Sievers (5):
    kobject: replace '/' with '!' in name
    driver core: remove KOBJ_NAME_LEN define
    driver core: remove DEVICE_NAME_SIZE define
    pnp: add acpi:* modalias entries
    arm: bus_id -> dev_name() and dev_set_name() conversions

    Li Zefan (1):
    kobject: should use kobject_put() in kset-example

    Matthew Wilcox (1):
    class: add lockdep infrastructure

    Mike Frysinger (2):
    uio-howto.tmpl: use standard copyright/legal markings
    uio-howto.tmpl: use unique output names

    Miklos Szeredi (1):
    sysfs: don't call notify_change

    Nathan Lynch (1):
    sysfs-rules.txt: reword API stability statement

    Randy Dunlap (1):
    block: make /proc/diskstats only build if CONFIG_PROC_FS is enabled

    Richard Kennedy (1):
    kobject: reorder kobject to save space on 64 bit builds

    Robert P. J. Day (1):
    debugfs: Add a reference to the debugfs API documentation.

    Tsugikazu Shibata (1):
    HOWTO: change email addresses of James in HOWTO

    Uwe Kleine-König (3):
    UIO: fix UIO Kconfig dependencies
    UIO: add generic UIO platform driver
    UIO: minor style and comment fixes

    Wang Chen (1):
    kobject: Transmit return value of call_usermodehelper() to caller

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. [PATCH 22/79] device create: net: convert device_create to device_create_drvdata

    device_create() is race-prone, so use the race-free
    device_create_drvdata() instead as device_create() is going away.

    Cc: Jeff Garzik
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/net/ppp_generic.c | 3 ++-
    drivers/net/wan/cosa.c | 6 +++---
    2 files changed, 5 insertions(+), 4 deletions(-)

    diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
    index 6b1d7a8..739b3ab 100644
    --- a/drivers/net/ppp_generic.c
    +++ b/drivers/net/ppp_generic.c
    @@ -866,7 +866,8 @@ static int __init ppp_init(void)
    err = PTR_ERR(ppp_class);
    goto out_chrdev;
    }
    - device_create(ppp_class, NULL, MKDEV(PPP_MAJOR, 0), "ppp");
    + device_create_drvdata(ppp_class, NULL, MKDEV(PPP_MAJOR, 0),
    + NULL, "ppp");
    }

    out:
    diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
    index 5827324..f7d3349 100644
    --- a/drivers/net/wan/cosa.c
    +++ b/drivers/net/wan/cosa.c
    @@ -397,9 +397,9 @@ static int __init cosa_init(void)
    err = PTR_ERR(cosa_class);
    goto out_chrdev;
    }
    - for (i=0; i - device_create(cosa_class, NULL, MKDEV(cosa_major, i), "cosa%d", i);
    - }
    + for (i = 0; i < nr_cards; i++)
    + device_create_drvdata(cosa_class, NULL, MKDEV(cosa_major, i),
    + NULL, "cosa%d", i);
    err = 0;
    goto out;

    --
    1.5.6.3

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  3. [PATCH 09/79] device create: dvb: convert device_create to device_create_drvdata

    device_create() is race-prone, so use the race-free
    device_create_drvdata() instead as device_create() is going away.

    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/media/dvb/dvb-core/dvbdev.c | 4 ++--
    1 files changed, 2 insertions(+), 2 deletions(-)

    diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
    index e208a60..e713277 100644
    --- a/drivers/media/dvb/dvb-core/dvbdev.c
    +++ b/drivers/media/dvb/dvb-core/dvbdev.c
    @@ -233,9 +233,9 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,

    mutex_unlock(&dvbdev_register_lock);

    - clsdev = device_create(dvb_class, adap->device,
    + clsdev = device_create_drvdata(dvb_class, adap->device,
    MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)),
    - "dvb%d.%s%d", adap->num, dnames[type], id);
    + NULL, "dvb%d.%s%d", adap->num, dnames[type], id);
    if (IS_ERR(clsdev)) {
    printk(KERN_ERR "%s: failed to create device dvb%d.%s%d (%ld)\n",
    __func__, adap->num, dnames[type], id, PTR_ERR(clsdev));
    --
    1.5.6.3

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  4. [PATCH 20/79] device create: misc: convert device_create to device_create_drvdata

    device_create() is race-prone, so use the race-free
    device_create_drvdata() instead as device_create() is going away.

    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/misc/phantom.c | 5 +++--
    1 files changed, 3 insertions(+), 2 deletions(-)

    diff --git a/drivers/misc/phantom.c b/drivers/misc/phantom.c
    index 1861624..4ce3bdc 100644
    --- a/drivers/misc/phantom.c
    +++ b/drivers/misc/phantom.c
    @@ -399,8 +399,9 @@ static int __devinit phantom_probe(struct pci_dev *pdev,
    goto err_irq;
    }

    - if (IS_ERR(device_create(phantom_class, &pdev->dev, MKDEV(phantom_major,
    - minor), "phantom%u", minor)))
    + if (IS_ERR(device_create_drvdata(phantom_class, &pdev->dev,
    + MKDEV(phantom_major, minor),
    + NULL, "phantom%u", minor)))
    dev_err(&pdev->dev, "can't create device\n");

    pci_set_drvdata(pdev, pht);
    --
    1.5.6.3

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  5. [PATCH 17/79] device create: isdn: convert device_create to device_create_drvdata

    device_create() is race-prone, so use the race-free
    device_create_drvdata() instead as device_create() is going away.

    Cc: Karsten Keil
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/isdn/capi/capi.c | 3 ++-
    1 files changed, 2 insertions(+), 1 deletions(-)

    diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
    index 8a35029..0dcfbfb 100644
    --- a/drivers/isdn/capi/capi.c
    +++ b/drivers/isdn/capi/capi.c
    @@ -1552,7 +1552,8 @@ static int __init capi_init(void)
    return PTR_ERR(capi_class);
    }

    - device_create(capi_class, NULL, MKDEV(capi_major, 0), "capi");
    + device_create_drvdata(capi_class, NULL, MKDEV(capi_major, 0), NULL,
    + "capi");

    #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
    if (capinc_tty_init() < 0) {
    --
    1.5.6.3

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  6. [PATCH 01/79] sysfs: add /sys/dev/{char,block} to lookup sysfs path by major:minor

    From: Dan Williams

    Why?:
    There are occasions where userspace would like to access sysfs
    attributes for a device but it may not know how sysfs has named the
    device or the path. For example what is the sysfs path for
    /dev/disk/by-id/ata-ST3160827AS_5MT004CK? With this change a call to
    stat(2) returns the major:minor then userspace can see that
    /sys/dev/block/8:32 links to /sys/block/sdc.

    What are the alternatives?:
    1/ Add an ioctl to return the path: Doable, but sysfs is meant to reduce
    the need to proliferate ioctl interfaces into the kernel, so this
    seems counter productive.

    2/ Use udev to create these symlinks: Also doable, but it adds a
    udev dependency to utilities that might be running in a limited
    environment like an initramfs.

    3/ Do a full-tree search of sysfs.

    [kay.sievers@vrfy.org: fix duplicate registrations]
    [kay.sievers@vrfy.org: cleanup suggestions]

    Cc: Neil Brown
    Cc: Tejun Heo
    Acked-by: Kay Sievers
    Reviewed-by: SL Baur
    Acked-by: Kay Sievers
    Acked-by: Mark Lord
    Acked-by: H. Peter Anvin
    Signed-off-by: Dan Williams
    Signed-off-by: Greg Kroah-Hartman
    ---
    Documentation/ABI/testing/sysfs-dev | 20 ++++++++
    Documentation/filesystems/sysfs.txt | 6 +++
    block/genhd.c | 5 ++-
    drivers/base/class.c | 4 ++
    drivers/base/core.c | 83 ++++++++++++++++++++++++++++++++++-
    drivers/usb/core/devio.c | 5 ++
    include/linux/device.h | 3 +
    7 files changed, 124 insertions(+), 2 deletions(-)
    create mode 100644 Documentation/ABI/testing/sysfs-dev

    diff --git a/Documentation/ABI/testing/sysfs-dev b/Documentation/ABI/testing/sysfs-dev
    new file mode 100644
    index 0000000..a9f2b8b
    --- /dev/null
    +++ b/Documentation/ABI/testing/sysfs-dev
    @@ -0,0 +1,20 @@
    +What: /sys/dev
    +Date: April 2008
    +KernelVersion: 2.6.26
    +Contact: Dan Williams
    +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 ":". 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
    diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
    index 7f27b8f..9e9c348 100644
    --- a/Documentation/filesystems/sysfs.txt
    +++ b/Documentation/filesystems/sysfs.txt
    @@ -248,6 +248,7 @@ The top level sysfs directory looks like:
    block/
    bus/
    class/
    +dev/
    devices/
    firmware/
    net/
    @@ -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 :. 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/.
    diff --git a/block/genhd.c b/block/genhd.c
    index 9074f38..24e3fc9 100644
    --- a/block/genhd.c
    +++ b/block/genhd.c
    @@ -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);
    diff --git a/drivers/base/class.c b/drivers/base/class.c
    index e085af0..71ce3ff 100644
    --- a/drivers/base/class.c
    +++ b/drivers/base/class.c
    @@ -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)
    diff --git a/drivers/base/core.c b/drivers/base/core.c
    index ee0a51a..be9aba4 100644
    --- a/drivers/base/core.c
    +++ b/drivers/base/core.c
    @@ -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)
    @@ -776,6 +779,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.
    *
    @@ -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);
    @@ -873,6 +928,9 @@ int device_add(struct device *dev)
    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:
    device_remove_file(dev, &uevent_attr);
    @@ -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);

    @@ -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);
    @@ -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);
    }
    diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
    index 54a350c..6fbc8f5 100644
    --- a/drivers/usb/core/devio.c
    +++ b/drivers/usb/core/devio.c
    @@ -1792,6 +1792,11 @@ int __init usb_devio_init(void)
    usb_classdev_class = NULL;
    goto out;
    }
    + /* devices of this class shadow the major:minor of their parent
    + * device, so clear ->dev_kobj to prevent adding duplicate entries
    + * to /sys/dev
    + */
    + usb_classdev_class->dev_kobj = NULL;

    usb_register_notify(&usbdev_nb);
    #endif
    diff --git a/include/linux/device.h b/include/linux/device.h
    index f71a78d..e49aa74 100644
    --- a/include/linux/device.h
    +++ b/include/linux/device.h
    @@ -193,6 +193,7 @@ struct class {
    struct semaphore sem; /* locks children, devices, interfaces */
    struct class_attribute *class_attrs;
    struct device_attribute *dev_attrs;
    + struct kobject *dev_kobj;

    int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env);

    @@ -205,6 +206,8 @@ struct class {
    struct pm_ops *pm;
    };

    +extern struct kobject *sysfs_dev_block_kobj;
    +extern struct kobject *sysfs_dev_char_kobj;
    extern int __must_check class_register(struct class *class);
    extern void class_unregister(struct class *class);
    extern int class_for_each_device(struct class *class, void *data,
    --
    1.5.6.3

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  7. [PATCH 04/79] Firmware: fix typo in example code

    It's not like this stuff even builds right now, but this will make
    Randy's scripts happy


    Cc: Randy Dunlap
    Signed-off-by: Greg Kroah-Hartman
    ---
    .../firmware_sample_firmware_class.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/samples/firmware_class/firmware_sample_firmware_class.c b/samples/firmware_class/firmware_sample_firmware_class.c
    index 9392116..e6cf7a4 100644
    --- a/samples/firmware_class/firmware_sample_firmware_class.c
    +++ b/samples/firmware_class/firmware_sample_firmware_class.c
    @@ -124,7 +124,7 @@ static int fw_setup_class_device(struct class_device *class_dev,
    class_dev->class_id[BUS_ID_SIZE-1] = '\0';
    class_dev->dev = device;

    - class_dev->class = &firmware_class,
    + class_dev->class = &firmware_class;
    class_set_devdata(class_dev, fw_priv);
    retval = class_device_register(class_dev);
    if (retval) {
    --
    1.5.6.3

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  8. [PATCH 48/79] class: fix docbook comments for class_private structure

    Removes a field that has been deleted, and adds a description fo the
    class_dirs field which was previously undocumented.

    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/base/base.h | 3 +--
    1 files changed, 1 insertions(+), 2 deletions(-)

    diff --git a/drivers/base/base.h b/drivers/base/base.h
    index 4435732..c035dc2 100644
    --- a/drivers/base/base.h
    +++ b/drivers/base/base.h
    @@ -41,10 +41,9 @@ struct driver_private {
    * struct class_private - structure to hold the private to the driver core portions of the class structure.
    *
    * @class_subsys - the struct kset that defines this class. This is the main kobject
    - * @children - list of class_devices associated with this class
    * @class_devices - list of devices associated with this class
    * @class_interfaces - list of class_interfaces associated with this class
    - * @class_dirs -
    + * @class_dirs - "glue" directory for virtual devices associated with this class
    * @class_sem - semaphore to protect the children, devices, and interfaces lists.
    * @class - pointer back to the struct class that this structure is associated
    * with.
    --
    1.5.6.3

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  9. [PATCH 24/79] device create: scsi: convert device_create to device_create_drvdata

    device_create() is race-prone, so use the race-free
    device_create_drvdata() instead as device_create() is going away.

    Cc: James E.J. Bottomley
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/scsi/dpt_i2o.c | 4 ++--
    1 files changed, 2 insertions(+), 2 deletions(-)

    diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
    index 2bc30e3..1fe0901 100644
    --- a/drivers/scsi/dpt_i2o.c
    +++ b/drivers/scsi/dpt_i2o.c
    @@ -271,8 +271,8 @@ rebuild_sys_tab:
    pHba->initialized = TRUE;
    pHba->state &= ~DPTI_STATE_RESET;
    if (adpt_sysfs_class) {
    - struct device *dev = device_create(adpt_sysfs_class,
    - NULL, MKDEV(DPTI_I2O_MAJOR, pHba->unit),
    + struct device *dev = device_create_drvdata(adpt_sysfs_class,
    + NULL, MKDEV(DPTI_I2O_MAJOR, pHba->unit), NULL,
    "dpti%d", pHba->unit);
    if (IS_ERR(dev)) {
    printk(KERN_WARNING"dpti%d: unable to "
    --
    1.5.6.3

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  10. [PATCH 27/79] device create: usb: convert device_create to device_create_drvdata

    device_create() is race-prone, so use the race-free
    device_create_drvdata() instead as device_create() is going away.

    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/usb/core/devio.c | 6 +++---
    drivers/usb/core/file.c | 5 +++--
    drivers/usb/gadget/printer.c | 4 ++--
    drivers/usb/mon/mon_bin.c | 5 +++--
    4 files changed, 11 insertions(+), 9 deletions(-)

    diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
    index 6fbc8f5..20290c5 100644
    --- a/drivers/usb/core/devio.c
    +++ b/drivers/usb/core/devio.c
    @@ -1729,9 +1729,9 @@ static int usb_classdev_add(struct usb_device *dev)
    {
    struct device *cldev;

    - cldev = device_create(usb_classdev_class, &dev->dev, dev->dev.devt,
    - "usbdev%d.%d", dev->bus->busnum,
    - dev->devnum);
    + cldev = device_create_drvdata(usb_classdev_class, &dev->dev,
    + dev->dev.devt, NULL, "usbdev%d.%d",
    + dev->bus->busnum, dev->devnum);
    if (IS_ERR(cldev))
    return PTR_ERR(cldev);
    dev->usb_classdev = cldev;
    diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c
    index 913fb86..6b1b229 100644
    --- a/drivers/usb/core/file.c
    +++ b/drivers/usb/core/file.c
    @@ -196,8 +196,9 @@ int usb_register_dev(struct usb_interface *intf,
    ++temp;
    else
    temp = name;
    - intf->usb_dev = device_create(usb_class->class, &intf->dev,
    - MKDEV(USB_MAJOR, minor), "%s", temp);
    + intf->usb_dev = device_create_drvdata(usb_class->class, &intf->dev,
    + MKDEV(USB_MAJOR, minor), NULL,
    + "%s", temp);
    if (IS_ERR(intf->usb_dev)) {
    down_write(&minor_rwsem);
    usb_minors[intf->minor] = NULL;
    diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c
    index 9caaec3..49cd9e1 100644
    --- a/drivers/usb/gadget/printer.c
    +++ b/drivers/usb/gadget/printer.c
    @@ -1360,8 +1360,8 @@ printer_bind(struct usb_gadget *gadget)


    /* Setup the sysfs files for the printer gadget. */
    - dev->pdev = device_create(usb_gadget_class, NULL, g_printer_devno,
    - "g_printer");
    + dev->pdev = device_create_drvdata(usb_gadget_class, NULL,
    + g_printer_devno, NULL, "g_printer");
    if (IS_ERR(dev->pdev)) {
    ERROR(dev, "Failed to create device: g_printer\n");
    goto fail;
    diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
    index 293a462..6566fc0 100644
    --- a/drivers/usb/mon/mon_bin.c
    +++ b/drivers/usb/mon/mon_bin.c
    @@ -1162,8 +1162,9 @@ int mon_bin_add(struct mon_bus *mbus, const struct usb_bus *ubus)
    if (minor >= MON_BIN_MAX_MINOR)
    return 0;

    - dev = device_create(mon_bin_class, ubus? ubus->controller: NULL,
    - MKDEV(MAJOR(mon_bin_dev0), minor), "usbmon%d", minor);
    + dev = device_create_drvdata(mon_bin_class, ubus? ubus->controller: NULL,
    + MKDEV(MAJOR(mon_bin_dev0), minor), NULL,
    + "usbmon%d", minor);
    if (IS_ERR(dev))
    return 0;

    --
    1.5.6.3

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  11. [PATCH 53/79] driver core: remove DEVICE_ID_SIZE define

    There is no such thing as a "device id size" in the driver core, so
    remove the define and fix up any users of this odd define in the rest of
    the kernel.

    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/memstick/host/jmb38x_ms.c | 4 ++--
    include/linux/device.h | 1 -
    2 files changed, 2 insertions(+), 3 deletions(-)

    diff --git a/drivers/memstick/host/jmb38x_ms.c b/drivers/memstick/host/jmb38x_ms.c
    index a054668..4e3bfbc 100644
    --- a/drivers/memstick/host/jmb38x_ms.c
    +++ b/drivers/memstick/host/jmb38x_ms.c
    @@ -51,7 +51,7 @@ struct jmb38x_ms_host {
    void __iomem *addr;
    spinlock_t lock;
    int id;
    - char host_id[DEVICE_ID_SIZE];
    + char host_id[32];
    int irq;
    unsigned int block_pos;
    unsigned long timeout_jiffies;
    @@ -781,7 +781,7 @@ static struct memstick_host *jmb38x_ms_alloc_host(struct jmb38x_ms *jm, int cnt)

    spin_lock_init(&host->lock);
    host->id = cnt;
    - snprintf(host->host_id, DEVICE_ID_SIZE, DRIVER_NAME ":slot%d",
    + snprintf(host->host_id, sizeof(host->host_id), DRIVER_NAME ":slot%d",
    host->id);
    host->irq = jm->pdev->irq;
    host->timeout_jiffies = msecs_to_jiffies(1000);
    diff --git a/include/linux/device.h b/include/linux/device.h
    index 894fdb2..d24a47f 100644
    --- a/include/linux/device.h
    +++ b/include/linux/device.h
    @@ -25,7 +25,6 @@
    #include
    #include

    -#define DEVICE_ID_SIZE 32
    #define BUS_ID_SIZE 20

    struct device;
    --
    1.5.6.3

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  12. [PATCH 54/79] driver core: fix a lot of printk usages of bus_id

    We have the dev_printk() variants for this kind of thing, use them
    instead of directly trying to access the bus_id field of struct device.

    This is done in order to remove bus_id entirely.

    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman
    ---
    arch/arm/common/dmabounce.c | 22 +++++++++-------------
    arch/arm/common/sa1111.c | 3 ++-
    arch/arm/kernel/ecard.c | 3 +--
    arch/arm/mach-integrator/impd1.c | 3 +--
    arch/powerpc/platforms/chrp/pci.c | 2 +-
    arch/x86/kernel/pci-dma.c | 6 ++----
    arch/x86/kernel/pci-gart_64.c | 4 +---
    drivers/acpi/fan.c | 10 +++++-----
    drivers/acpi/glue.c | 6 ++----
    drivers/acpi/processor_core.c | 5 ++---
    drivers/acpi/scan.c | 2 +-
    drivers/acpi/thermal.c | 4 ++--
    drivers/acpi/video.c | 5 ++---
    drivers/base/power/trace.c | 2 +-
    14 files changed, 32 insertions(+), 45 deletions(-)

    diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
    index 2744673..dd29473 100644
    --- a/arch/arm/common/dmabounce.c
    +++ b/arch/arm/common/dmabounce.c
    @@ -554,9 +554,8 @@ dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,

    device_info = kmalloc(sizeof(struct dmabounce_device_info), GFP_ATOMIC);
    if (!device_info) {
    - printk(KERN_ERR
    - "Could not allocated dmabounce_device_info for %s",
    - dev->bus_id);
    + dev_err(dev,
    + "Could not allocated dmabounce_device_info\n");
    return -ENOMEM;
    }

    @@ -594,8 +593,7 @@ dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size,

    dev->archdata.dmabounce = device_info;

    - printk(KERN_INFO "dmabounce: registered device %s on %s bus\n",
    - dev->bus_id, dev->bus->name);
    + dev_info(dev, "dmabounce: registered device\n");

    return 0;

    @@ -614,16 +612,15 @@ dmabounce_unregister_dev(struct device *dev)
    dev->archdata.dmabounce = NULL;

    if (!device_info) {
    - printk(KERN_WARNING
    - "%s: Never registered with dmabounce but attempting" \
    - "to unregister!\n", dev->bus_id);
    + dev_warn(dev,
    + "Never registered with dmabounce but attempting"
    + "to unregister!\n");
    return;
    }

    if (!list_empty(&device_info->safe_buffers)) {
    - printk(KERN_ERR
    - "%s: Removing from dmabounce with pending buffers!\n",
    - dev->bus_id);
    + dev_err(dev,
    + "Removing from dmabounce with pending buffers!\n");
    BUG();
    }

    @@ -639,8 +636,7 @@ dmabounce_unregister_dev(struct device *dev)

    kfree(device_info);

    - printk(KERN_INFO "dmabounce: device %s on %s bus unregistered\n",
    - dev->bus_id, dev->bus->name);
    + dev_info(dev, "dmabounce: device unregistered\n");
    }


    diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
    index eb06d0b..2048ae0 100644
    --- a/arch/arm/common/sa1111.c
    +++ b/arch/arm/common/sa1111.c
    @@ -593,7 +593,8 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
    if (dev->dma_mask != 0xffffffffUL) {
    ret = dmabounce_register_dev(&dev->dev, 1024, 4096);
    if (ret) {
    - printk("SA1111: Failed to register %s with dmabounce", dev->dev.bus_id);
    + dev_err(&dev->dev, "SA1111: Failed to register"
    + " with dmabounce\n");
    device_unregister(&dev->dev);
    }
    }
    diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
    index 8bfd299..2de425f 100644
    --- a/arch/arm/kernel/ecard.c
    +++ b/arch/arm/kernel/ecard.c
    @@ -853,8 +853,7 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot)
    for (i = 0; i < ECARD_NUM_RESOURCES; i++) {
    if (ec->resource[i].flags &&
    request_resource(&iomem_resource, &ec->resource[i])) {
    - printk(KERN_ERR "%s: resource(s) not available\n",
    - ec->dev.bus_id);
    + dev_err(&ec->dev, "resource(s) not available\n");
    ec->resource[i].end -= ec->resource[i].start;
    ec->resource[i].start = 0;
    ec->resource[i].flags = 0;
    diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c
    index 62e653a..619d05e 100644
    --- a/arch/arm/mach-integrator/impd1.c
    +++ b/arch/arm/mach-integrator/impd1.c
    @@ -407,8 +407,7 @@ static int impd1_probe(struct lm_device *dev)

    ret = amba_device_register(d, &dev->resource);
    if (ret) {
    - printk("unable to register device %s: %d\n",
    - d->dev.bus_id, ret);
    + dev_err(&d->dev, "unable to register device: %d\n");
    kfree(d);
    }
    }
    diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
    index 609c46d..768c262 100644
    --- a/arch/powerpc/platforms/chrp/pci.c
    +++ b/arch/powerpc/platforms/chrp/pci.c
    @@ -367,7 +367,7 @@ static void chrp_pci_fixup_vt8231_ata(struct pci_dev *viaide)
    viaisa = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231, NULL);
    if (!viaisa)
    return;
    - printk("Fixing VIA IDE, force legacy mode on '%s'\n", viaide->dev.bus_id);
    + dev_info(&viaide->dev, "Fixing VIA IDE, force legacy mode on\n");

    pci_read_config_byte(viaide, PCI_CLASS_PROG, &progif);
    pci_write_config_byte(viaide, PCI_CLASS_PROG, progif & ~0x5);
    diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
    index a4213c0..cbecb05 100644
    --- a/arch/x86/kernel/pci-dma.c
    +++ b/arch/x86/kernel/pci-dma.c
    @@ -314,8 +314,7 @@ int dma_supported(struct device *dev, u64 mask)
    {
    #ifdef CONFIG_PCI
    if (mask > 0xffffffff && forbid_dac > 0) {
    - printk(KERN_INFO "PCI: Disallowing DAC for device %s\n",
    - dev->bus_id);
    + dev_info(dev, "PCI: Disallowing DAC for device\n");
    return 0;
    }
    #endif
    @@ -342,8 +341,7 @@ int dma_supported(struct device *dev, u64 mask)
    type. Normally this doesn't make any difference, but gives
    more gentle handling of IOMMU overflow. */
    if (iommu_sac_force && (mask >= DMA_40BIT_MASK)) {
    - printk(KERN_INFO "%s: Force SAC with mask %Lx\n",
    - dev->bus_id, mask);
    + dev_info(dev, "Force SAC with mask %Lx\n", mask);
    return 0;
    }

    diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
    index be60961..df5f142 100644
    --- a/arch/x86/kernel/pci-gart_64.c
    +++ b/arch/x86/kernel/pci-gart_64.c
    @@ -198,9 +198,7 @@ static void iommu_full(struct device *dev, size_t size, int dir)
    * out. Hopefully no network devices use single mappings that big.
    */

    - printk(KERN_ERR
    - "PCI-DMA: Out of IOMMU space for %lu bytes at device %s\n",
    - size, dev->bus_id);
    + dev_err(dev, "PCI-DMA: Out of IOMMU space for %lu bytes\n", size);

    if (size > PAGE_SIZE*EMERGENCY_PAGES) {
    if (dir == PCI_DMA_FROMDEVICE || dir == PCI_DMA_BIDIRECTIONAL)
    diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
    index 55c17af..2655bc1 100644
    --- a/drivers/acpi/fan.c
    +++ b/drivers/acpi/fan.c
    @@ -263,22 +263,22 @@ static int acpi_fan_add(struct acpi_device *device)
    goto end;
    }

    - printk(KERN_INFO PREFIX
    - "%s is registered as cooling_device%d\n",
    - device->dev.bus_id, cdev->id);
    + dev_info(&device->dev, "registered as cooling_device%d\n", cdev->id);

    acpi_driver_data(device) = cdev;
    result = sysfs_create_link(&device->dev.kobj,
    &cdev->device.kobj,
    "thermal_cooling");
    if (result)
    - printk(KERN_ERR PREFIX "Create sysfs link\n");
    + dev_err(&device->dev, "Failed to create sysfs link "
    + "'thermal_cooling'\n");

    result = sysfs_create_link(&cdev->device.kobj,
    &device->dev.kobj,
    "device");
    if (result)
    - printk(KERN_ERR PREFIX "Create sysfs link\n");
    + dev_err(&device->dev, "Failed to create sysfs link "
    + "'device'\n");

    result = acpi_fan_add_fs(device);
    if (result)
    diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
    index 2f173e8..0841095 100644
    --- a/drivers/acpi/glue.c
    +++ b/drivers/acpi/glue.c
    @@ -146,8 +146,7 @@ static int acpi_bind_one(struct device *dev, acpi_handle handle)
    acpi_status status;

    if (dev->archdata.acpi_handle) {
    - printk(KERN_WARNING PREFIX
    - "Drivers changed 'acpi_handle' for %s\n", dev->bus_id);
    + dev_warn(dev, "Drivers changed 'acpi_handle'\n");
    return -EINVAL;
    }
    get_device(dev);
    @@ -195,8 +194,7 @@ static int acpi_unbind_one(struct device *dev)
    /* acpi_bind_one increase refcnt by one */
    put_device(dev);
    } else {
    - printk(KERN_ERR PREFIX
    - "Oops, 'acpi_handle' corrupt for %s\n", dev->bus_id);
    + dev_err(dev, "Oops, 'acpi_handle' corrupt\n");
    }
    return 0;
    }
    diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
    index ec0f2d5..e36422a 100644
    --- a/drivers/acpi/processor_core.c
    +++ b/drivers/acpi/processor_core.c
    @@ -714,9 +714,8 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
    goto end;
    }

    - printk(KERN_INFO PREFIX
    - "%s is registered as cooling_device%d\n",
    - device->dev.bus_id, pr->cdev->id);
    + dev_info(&device->dev, "registered as cooling_device%d\n",
    + pr->cdev->id);

    result = sysfs_create_link(&device->dev.kobj,
    &pr->cdev->device.kobj,
    diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
    index f3132aa..f6f52c1 100644
    --- a/drivers/acpi/scan.c
    +++ b/drivers/acpi/scan.c
    @@ -471,7 +471,7 @@ static int acpi_device_register(struct acpi_device *device,
    device->dev.release = &acpi_device_release;
    result = device_add(&device->dev);
    if(result) {
    - printk(KERN_ERR PREFIX "Error adding device %s", device->dev.bus_id);
    + dev_err(&device->dev, "Error adding device\n");
    goto end;
    }

    diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
    index 84c795f..30a3413 100644
    --- a/drivers/acpi/thermal.c
    +++ b/drivers/acpi/thermal.c
    @@ -1179,8 +1179,8 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)

    tz->tz_enabled = 1;

    - printk(KERN_INFO PREFIX "%s is registered as thermal_zone%d\n",
    - tz->device->dev.bus_id, tz->thermal_zone->id);
    + dev_info(&tz->device->dev, "registered as thermal_zone%d\n",
    + tz->thermal_zone->id);
    return 0;
    }

    diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
    index 64c8893..37b9e16 100644
    --- a/drivers/acpi/video.c
    +++ b/drivers/acpi/video.c
    @@ -762,9 +762,8 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
    if (IS_ERR(device->cdev))
    return;

    - printk(KERN_INFO PREFIX
    - "%s is registered as cooling_device%d\n",
    - device->dev->dev.bus_id, device->cdev->id);
    + dev_info(&device->dev->dev, "registered as cooling_device%d\n",
    + device->cdev->id);
    result = sysfs_create_link(&device->dev->dev.kobj,
    &device->cdev->device.kobj,
    "thermal_cooling");
    diff --git a/drivers/base/power/trace.c b/drivers/base/power/trace.c
    index 9b1b20b..2aa6e8f 100644
    --- a/drivers/base/power/trace.c
    +++ b/drivers/base/power/trace.c
    @@ -194,7 +194,7 @@ static int show_dev_hash(unsigned int value)
    struct device * dev = to_device(entry);
    unsigned int hash = hash_string(DEVSEED, dev->bus_id, DEVHASH);
    if (hash == value) {
    - printk(" hash matches device %s\n", dev->bus_id);
    + dev_info(dev, "hash matches\n");
    match++;
    }
    entry = entry->prev;
    --
    1.5.6.3

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  13. [PATCH 45/79] class: rename "interfaces" to "class_interfaces" in internal class structure

    This renames the struct class "interfaces" field to be
    "class_interfaces" to make things easier when struct bus_type and struct
    class merge in the future. It also makes grepping for fields easier as
    well.

    Based on an idea from Kay.

    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/base/base.h | 4 ++--
    drivers/base/class.c | 4 ++--
    drivers/base/core.c | 8 ++++----
    3 files changed, 8 insertions(+), 8 deletions(-)

    diff --git a/drivers/base/base.h b/drivers/base/base.h
    index 586c4ca..670b95a 100644
    --- a/drivers/base/base.h
    +++ b/drivers/base/base.h
    @@ -43,7 +43,7 @@ struct driver_private {
    * @subsys - the struct kset that defines this class. This is the main kobject
    * @children - list of class_devices associated with this class
    * @class_devices - list of devices associated with this class
    - * @interfaces - list of class_interfaces associated with this class
    + * @class_interfaces - list of class_interfaces associated with this class
    * @class_dirs -
    * @sem - semaphore to protect the children, devices, and interfaces lists.
    * @class - pointer back to the struct class that this structure is associated
    @@ -56,7 +56,7 @@ struct driver_private {
    struct class_private {
    struct kset subsys;
    struct list_head class_devices;
    - struct list_head interfaces;
    + struct list_head class_interfaces;
    struct kset class_dirs;
    struct semaphore sem;
    struct class *class;
    diff --git a/drivers/base/class.c b/drivers/base/class.c
    index 9947560..48b518e 100644
    --- a/drivers/base/class.c
    +++ b/drivers/base/class.c
    @@ -144,7 +144,7 @@ int class_register(struct class *cls)
    if (!cp)
    return -ENOMEM;
    INIT_LIST_HEAD(&cp->class_devices);
    - INIT_LIST_HEAD(&cp->interfaces);
    + INIT_LIST_HEAD(&cp->class_interfaces);
    kset_init(&cp->class_dirs);
    init_MUTEX(&cp->sem);
    error = kobject_set_name(&cp->subsys.kobj, "%s", cls->name);
    @@ -372,7 +372,7 @@ int class_interface_register(struct class_interface *class_intf)
    return -EINVAL;

    down(&parent->p->sem);
    - list_add_tail(&class_intf->node, &parent->p->interfaces);
    + list_add_tail(&class_intf->node, &parent->p->class_interfaces);
    if (class_intf->add_dev) {
    list_for_each_entry(dev, &parent->p->class_devices, node)
    class_intf->add_dev(dev, class_intf);
    diff --git a/drivers/base/core.c b/drivers/base/core.c
    index 52d1e71..76fdd41 100644
    --- a/drivers/base/core.c
    +++ b/drivers/base/core.c
    @@ -909,8 +909,8 @@ int device_add(struct device *dev)
    list_add_tail(&dev->node, &dev->class->p->class_devices);

    /* notify any interfaces that the device is here */
    - list_for_each_entry(class_intf, &dev->class->p->interfaces,
    - node)
    + list_for_each_entry(class_intf,
    + &dev->class->p->class_interfaces, node)
    if (class_intf->add_dev)
    class_intf->add_dev(dev, class_intf);
    up(&dev->class->p->sem);
    @@ -1016,8 +1016,8 @@ void device_del(struct device *dev)

    down(&dev->class->p->sem);
    /* notify any interfaces that the device is now gone */
    - list_for_each_entry(class_intf, &dev->class->p->interfaces,
    - node)
    + list_for_each_entry(class_intf,
    + &dev->class->p->class_interfaces, node)
    if (class_intf->remove_dev)
    class_intf->remove_dev(dev, class_intf);
    /* remove the device from the class list */
    --
    1.5.6.3

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  14. [PATCH 31/79] Driver Core: add ability for class_for_each_device to start in middle of list

    This mirrors the functionality that driver_for_each_device has as well.

    We add a start variable, and all callers of the function are fixed up at
    the same time.

    The block layer will be using this new functionality in a follow-on
    patch.


    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/base/class.c | 21 +++++++++++++--------
    drivers/i2c/i2c-core.c | 6 ++++--
    drivers/ieee1394/nodemgr.c | 14 +++++++++-----
    drivers/power/apm_power.c | 2 +-
    drivers/power/power_supply_core.c | 4 ++--
    include/linux/device.h | 3 ++-
    6 files changed, 31 insertions(+), 19 deletions(-)

    diff --git a/drivers/base/class.c b/drivers/base/class.c
    index 71ce3ff..2eb7048 100644
    --- a/drivers/base/class.c
    +++ b/drivers/base/class.c
    @@ -256,11 +256,14 @@ char *make_class_name(const char *name, struct kobject *kobj)
    /**
    * class_for_each_device - device iterator
    * @class: the class we're iterating
    + * @start: the device to start with in the list, if any.
    * @data: data for the callback
    * @fn: function to be called for each device
    *
    * Iterate over @class's list of devices, and call @fn for each,
    - * passing it @data.
    + * passing it @data. If @start is set, the list iteration will start
    + * there, otherwise if it is NULL, the iteration starts at the
    + * beginning of the list.
    *
    * We check the return of @fn each time. If it returns anything
    * other than 0, we break out and return that value.
    @@ -269,8 +272,8 @@ char *make_class_name(const char *name, struct kobject *kobj)
    * re-acquired in @fn, otherwise it will self-deadlocking. For
    * example, calls to add or remove class members would be verboten.
    */
    -int class_for_each_device(struct class *class, void *data,
    - int (*fn)(struct device *, void *))
    +int class_for_each_device(struct class *class, struct device *start,
    + void *data, int (*fn)(struct device *, void *))
    {
    struct device *dev;
    int error = 0;
    @@ -279,12 +282,14 @@ int class_for_each_device(struct class *class, void *data,
    return -EINVAL;
    down(&class->sem);
    list_for_each_entry(dev, &class->devices, node) {
    + if (start) {
    + if (start == dev)
    + start = NULL;
    + continue;
    + }
    dev = get_device(dev);
    - if (dev) {
    - error = fn(dev, data);
    - put_device(dev);
    - } else
    - error = -ENODEV;
    + error = fn(dev, data);
    + put_device(dev);
    if (error)
    break;
    }
    diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
    index 7608df8..7bf38c4 100644
    --- a/drivers/i2c/i2c-core.c
    +++ b/drivers/i2c/i2c-core.c
    @@ -722,7 +722,8 @@ int i2c_register_driver(struct module *owner, struct i2c_driver *driver)

    INIT_LIST_HEAD(&driver->clients);
    /* Walk the adapters that are already present */
    - class_for_each_device(&i2c_adapter_class, driver, __attach_adapter);
    + class_for_each_device(&i2c_adapter_class, NULL, driver,
    + __attach_adapter);

    mutex_unlock(&core_lock);
    return 0;
    @@ -782,7 +783,8 @@ void i2c_del_driver(struct i2c_driver *driver)
    {
    mutex_lock(&core_lock);

    - class_for_each_device(&i2c_adapter_class, driver, __detach_adapter);
    + class_for_each_device(&i2c_adapter_class, NULL, driver,
    + __detach_adapter);

    driver_unregister(&driver->driver);
    pr_debug("i2c-core: driver [%s] unregistered\n", driver->driver.name);
    diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
    index 05710c7..47c0d85 100644
    --- a/drivers/ieee1394/nodemgr.c
    +++ b/drivers/ieee1394/nodemgr.c
    @@ -1453,7 +1453,8 @@ static void nodemgr_suspend_ne(struct node_entry *ne)
    ne->in_limbo = 1;
    WARN_ON(device_create_file(&ne->device, &dev_attr_ne_in_limbo));

    - class_for_each_device(&nodemgr_ud_class, ne, __nodemgr_driver_suspend);
    + class_for_each_device(&nodemgr_ud_class, NULL, ne,
    + __nodemgr_driver_suspend);
    }


    @@ -1462,7 +1463,8 @@ static void nodemgr_resume_ne(struct node_entry *ne)
    ne->in_limbo = 0;
    device_remove_file(&ne->device, &dev_attr_ne_in_limbo);

    - class_for_each_device(&nodemgr_ud_class, ne, __nodemgr_driver_resume);
    + class_for_each_device(&nodemgr_ud_class, NULL, ne,
    + __nodemgr_driver_resume);
    HPSB_DEBUG("Node resumed: ID:BUS[" NODE_BUS_FMT "] GUID[%016Lx]",
    NODE_BUS_ARGS(ne->host, ne->nodeid), (unsigned long long)ne->guid);
    }
    @@ -1498,7 +1500,8 @@ static int __nodemgr_update_pdrv(struct device *dev, void *data)

    static void nodemgr_update_pdrv(struct node_entry *ne)
    {
    - class_for_each_device(&nodemgr_ud_class, ne, __nodemgr_update_pdrv);
    + class_for_each_device(&nodemgr_ud_class, NULL, ne,
    + __nodemgr_update_pdrv);
    }


    @@ -1591,7 +1594,8 @@ static void nodemgr_node_probe(struct host_info *hi, int generation)
    * while probes are time-consuming. (Well, those probes need some
    * improvement...) */

    - class_for_each_device(&nodemgr_ne_class, &param, __nodemgr_node_probe);
    + class_for_each_device(&nodemgr_ne_class, NULL, &param,
    + __nodemgr_node_probe);

    /* If we had a bus reset while we were scanning the bus, it is
    * possible that we did not probe all nodes. In that case, we
    @@ -1826,7 +1830,7 @@ int nodemgr_for_each_host(void *data, int (*cb)(struct hpsb_host *, void *))

    hip.cb = cb;
    hip.data = data;
    - error = class_for_each_device(&hpsb_host_class, &hip,
    + error = class_for_each_device(&hpsb_host_class, NULL, &hip,
    __nodemgr_for_each_host);

    return error;
    diff --git a/drivers/power/apm_power.c b/drivers/power/apm_power.c
    index a489227..936bae5 100644
    --- a/drivers/power/apm_power.c
    +++ b/drivers/power/apm_power.c
    @@ -78,7 +78,7 @@ static void find_main_battery(void)
    main_battery = NULL;
    bp.main = main_battery;

    - error = class_for_each_device(power_supply_class, &bp,
    + error = class_for_each_device(power_supply_class, NULL, &bp,
    __find_main_battery);
    if (error) {
    main_battery = bp.main;
    diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
    index af1633e..cb1ccb4 100644
    --- a/drivers/power/power_supply_core.c
    +++ b/drivers/power/power_supply_core.c
    @@ -41,7 +41,7 @@ static void power_supply_changed_work(struct work_struct *work)

    dev_dbg(psy->dev, "%s\n", __func__);

    - class_for_each_device(power_supply_class, psy,
    + class_for_each_device(power_supply_class, NULL, psy,
    __power_supply_changed_work);

    power_supply_update_leds(psy);
    @@ -79,7 +79,7 @@ int power_supply_am_i_supplied(struct power_supply *psy)
    {
    int error;

    - error = class_for_each_device(power_supply_class, psy,
    + error = class_for_each_device(power_supply_class, NULL, psy,
    __power_supply_am_i_supplied);

    dev_dbg(psy->dev, "%s %d\n", __func__, error);
    diff --git a/include/linux/device.h b/include/linux/device.h
    index de17871..6d5b351 100644
    --- a/include/linux/device.h
    +++ b/include/linux/device.h
    @@ -210,7 +210,8 @@ extern struct kobject *sysfs_dev_block_kobj;
    extern struct kobject *sysfs_dev_char_kobj;
    extern int __must_check class_register(struct class *class);
    extern void class_unregister(struct class *class);
    -extern int class_for_each_device(struct class *class, void *data,
    +extern int class_for_each_device(struct class *class, struct device *start,
    + void *data,
    int (*fn)(struct device *dev, void *data));
    extern struct device *class_find_device(struct class *class, void *data,
    int (*match)(struct device *, void *));
    --
    1.5.6.3

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  15. [PATCH 34/79] block: make printk_partition use the class iterator function

    Use the proper class iterator function instead of mucking around in the
    internals of the class structures.

    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman
    ---
    block/genhd.c | 95 ++++++++++++++++++++++++++++++--------------------------
    1 files changed, 51 insertions(+), 44 deletions(-)

    diff --git a/block/genhd.c b/block/genhd.c
    index 3ccf5c0..10b9ac4 100644
    --- a/block/genhd.c
    +++ b/block/genhd.c
    @@ -227,58 +227,65 @@ struct gendisk *get_gendisk(dev_t devt, int *part)
    }

    /*
    - * print a full list of all partitions - intended for places where the root
    - * filesystem can't be mounted and thus to give the victim some idea of what
    - * went wrong
    + * print a partitions - intended for places where the root filesystem can't be
    + * mounted and thus to give the victim some idea of what went wrong
    */
    -void __init printk_all_partitions(void)
    +static int printk_partition(struct device *dev, void *data)
    {
    - struct device *dev;
    struct gendisk *sgp;
    char buf[BDEVNAME_SIZE];
    int n;

    - mutex_lock(&block_class_lock);
    - /* For each block device... */
    - list_for_each_entry(dev, &block_class.devices, node) {
    - if (dev->type != &disk_type)
    - continue;
    - sgp = dev_to_disk(dev);
    - /*
    - * Don't show empty devices or things that have been surpressed
    - */
    - if (get_capacity(sgp) == 0 ||
    - (sgp->flags & GENHD_FL_SUPPRESS_PARTITION_INFO))
    - continue;
    + if (dev->type != &disk_type)
    + goto exit;

    - /*
    - * Note, unlike /proc/partitions, I am showing the numbers in
    - * hex - the same format as the root= option takes.
    - */
    - printk("%02x%02x %10llu %s",
    - sgp->major, sgp->first_minor,
    - (unsigned long long)get_capacity(sgp) >> 1,
    - disk_name(sgp, 0, buf));
    - if (sgp->driverfs_dev != NULL &&
    - sgp->driverfs_dev->driver != NULL)
    - printk(" driver: %s\n",
    - sgp->driverfs_dev->driver->name);
    - else
    - printk(" (driver?)\n");
    -
    - /* now show the partitions */
    - for (n = 0; n < sgp->minors - 1; ++n) {
    - if (sgp->part[n] == NULL)
    - continue;
    - if (sgp->part[n]->nr_sects == 0)
    - continue;
    - printk(" %02x%02x %10llu %s\n",
    - sgp->major, n + 1 + sgp->first_minor,
    - (unsigned long long)sgp->part[n]->nr_sects >> 1,
    - disk_name(sgp, n + 1, buf));
    - }
    + sgp = dev_to_disk(dev);
    + /*
    + * Don't show empty devices or things that have been surpressed
    + */
    + if (get_capacity(sgp) == 0 ||
    + (sgp->flags & GENHD_FL_SUPPRESS_PARTITION_INFO))
    + goto exit;
    +
    + /*
    + * Note, unlike /proc/partitions, I am showing the numbers in
    + * hex - the same format as the root= option takes.
    + */
    + printk("%02x%02x %10llu %s",
    + sgp->major, sgp->first_minor,
    + (unsigned long long)get_capacity(sgp) >> 1,
    + disk_name(sgp, 0, buf));
    + if (sgp->driverfs_dev != NULL &&
    + sgp->driverfs_dev->driver != NULL)
    + printk(" driver: %s\n",
    + sgp->driverfs_dev->driver->name);
    + else
    + printk(" (driver?)\n");
    +
    + /* now show the partitions */
    + for (n = 0; n < sgp->minors - 1; ++n) {
    + if (sgp->part[n] == NULL)
    + goto exit;
    + if (sgp->part[n]->nr_sects == 0)
    + goto exit;
    + printk(" %02x%02x %10llu %s\n",
    + sgp->major, n + 1 + sgp->first_minor,
    + (unsigned long long)sgp->part[n]->nr_sects >> 1,
    + disk_name(sgp, n + 1, buf));
    }
    +exit:
    + return 0;
    +}

    +/*
    + * print a full list of all partitions - intended for places where the root
    + * filesystem can't be mounted and thus to give the victim some idea of what
    + * went wrong
    + */
    +void __init printk_all_partitions(void)
    +{
    + mutex_lock(&block_class_lock);
    + class_for_each_device(&block_class, NULL, NULL, printk_partition);
    mutex_unlock(&block_class_lock);
    }

    --
    1.5.6.3

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  16. [PATCH 35/79] block: make blk_lookup_devt use the class iterator function

    Use the proper class iterator function instead of mucking around in the
    internals of the class structures.

    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman
    ---
    block/genhd.c | 38 ++++++++++++++++++++++++++------------
    1 files changed, 26 insertions(+), 12 deletions(-)

    diff --git a/block/genhd.c b/block/genhd.c
    index 10b9ac4..e8c42bf 100644
    --- a/block/genhd.c
    +++ b/block/genhd.c
    @@ -677,24 +677,38 @@ void genhd_media_change_notify(struct gendisk *disk)
    EXPORT_SYMBOL_GPL(genhd_media_change_notify);
    #endif /* 0 */

    +struct find_block {
    + const char *name;
    + int part;
    +};
    +
    +static int match_id(struct device *dev, void *data)
    +{
    + struct find_block *find = data;
    +
    + if (dev->type != &disk_type)
    + return 0;
    + if (strcmp(dev->bus_id, find->name) == 0) {
    + struct gendisk *disk = dev_to_disk(dev);
    + if (find->part < disk->minors)
    + return 1;
    + }
    + return 0;
    +}
    +
    dev_t blk_lookup_devt(const char *name, int part)
    {
    struct device *dev;
    dev_t devt = MKDEV(0, 0);
    + struct find_block find;

    mutex_lock(&block_class_lock);
    - list_for_each_entry(dev, &block_class.devices, node) {
    - if (dev->type != &disk_type)
    - continue;
    - if (strcmp(dev->bus_id, name) == 0) {
    - struct gendisk *disk = dev_to_disk(dev);
    -
    - if (part < disk->minors)
    - devt = MKDEV(MAJOR(dev->devt),
    - MINOR(dev->devt) + part);
    - break;
    - }
    - }
    + find.name = name;
    + find.part = part;
    + dev = class_find_device(&block_class, NULL, (void *)&find, match_id);
    + if (dev)
    + devt = MKDEV(MAJOR(dev->devt),
    + MINOR(dev->devt) + part);
    mutex_unlock(&block_class_lock);

    return devt;
    --
    1.5.6.3

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  17. [PATCH 28/79] device create: x86: convert device_create to device_create_drvdata

    device_create() is race-prone, so use the race-free
    device_create_drvdata() instead as device_create() is going away.

    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: H. Peter Anvin
    Signed-off-by: Greg Kroah-Hartman
    ---
    arch/x86/kernel/cpuid.c | 4 ++--
    arch/x86/kernel/msr.c | 4 ++--
    2 files changed, 4 insertions(+), 4 deletions(-)

    diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
    index 2de5fa2..14b11b3 100644
    --- a/arch/x86/kernel/cpuid.c
    +++ b/arch/x86/kernel/cpuid.c
    @@ -141,8 +141,8 @@ static __cpuinit int cpuid_device_create(int cpu)
    {
    struct device *dev;

    - dev = device_create(cpuid_class, NULL, MKDEV(CPUID_MAJOR, cpu),
    - "cpu%d", cpu);
    + dev = device_create_drvdata(cpuid_class, NULL, MKDEV(CPUID_MAJOR, cpu),
    + NULL, "cpu%d", cpu);
    return IS_ERR(dev) ? PTR_ERR(dev) : 0;
    }

    diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
    index a153b39..9fd8095 100644
    --- a/arch/x86/kernel/msr.c
    +++ b/arch/x86/kernel/msr.c
    @@ -149,8 +149,8 @@ static int __cpuinit msr_device_create(int cpu)
    {
    struct device *dev;

    - dev = device_create(msr_class, NULL, MKDEV(MSR_MAJOR, cpu),
    - "msr%d", cpu);
    + dev = device_create_drvdata(msr_class, NULL, MKDEV(MSR_MAJOR, cpu),
    + NULL, "msr%d", cpu);
    return IS_ERR(dev) ? PTR_ERR(dev) : 0;
    }

    --
    1.5.6.3

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  18. [PATCH 44/79] class: rename "devices" to "class_devices" in internal class structure

    This renames the struct class "devices" field to be "class_devices" to
    make things easier when struct bus_type and struct class merge in the
    future. It also makes grepping for fields easier as well.

    Based on an idea from Kay.

    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/base/base.h | 4 ++--
    drivers/base/class.c | 10 +++++-----
    drivers/base/core.c | 2 +-
    3 files changed, 8 insertions(+), 8 deletions(-)

    diff --git a/drivers/base/base.h b/drivers/base/base.h
    index 0ec372a..586c4ca 100644
    --- a/drivers/base/base.h
    +++ b/drivers/base/base.h
    @@ -42,7 +42,7 @@ struct driver_private {
    *
    * @subsys - the struct kset that defines this class. This is the main kobject
    * @children - list of class_devices associated with this class
    - * @devices - list of devices associated with this class
    + * @class_devices - list of devices associated with this class
    * @interfaces - list of class_interfaces associated with this class
    * @class_dirs -
    * @sem - semaphore to protect the children, devices, and interfaces lists.
    @@ -55,7 +55,7 @@ struct driver_private {
    */
    struct class_private {
    struct kset subsys;
    - struct list_head devices;
    + struct list_head class_devices;
    struct list_head interfaces;
    struct kset class_dirs;
    struct semaphore sem;
    diff --git a/drivers/base/class.c b/drivers/base/class.c
    index 06f09c9..9947560 100644
    --- a/drivers/base/class.c
    +++ b/drivers/base/class.c
    @@ -143,7 +143,7 @@ int class_register(struct class *cls)
    cp = kzalloc(sizeof(*cp), GFP_KERNEL);
    if (!cp)
    return -ENOMEM;
    - INIT_LIST_HEAD(&cp->devices);
    + INIT_LIST_HEAD(&cp->class_devices);
    INIT_LIST_HEAD(&cp->interfaces);
    kset_init(&cp->class_dirs);
    init_MUTEX(&cp->sem);
    @@ -290,7 +290,7 @@ int class_for_each_device(struct class *class, struct device *start,
    if (!class)
    return -EINVAL;
    down(&class->p->sem);
    - list_for_each_entry(dev, &class->p->devices, node) {
    + list_for_each_entry(dev, &class->p->class_devices, node) {
    if (start) {
    if (start == dev)
    start = NULL;
    @@ -340,7 +340,7 @@ struct device *class_find_device(struct class *class, struct device *start,
    return NULL;

    down(&class->p->sem);
    - list_for_each_entry(dev, &class->p->devices, node) {
    + list_for_each_entry(dev, &class->p->class_devices, node) {
    if (start) {
    if (start == dev)
    start = NULL;
    @@ -374,7 +374,7 @@ int class_interface_register(struct class_interface *class_intf)
    down(&parent->p->sem);
    list_add_tail(&class_intf->node, &parent->p->interfaces);
    if (class_intf->add_dev) {
    - list_for_each_entry(dev, &parent->p->devices, node)
    + list_for_each_entry(dev, &parent->p->class_devices, node)
    class_intf->add_dev(dev, class_intf);
    }
    up(&parent->p->sem);
    @@ -393,7 +393,7 @@ void class_interface_unregister(struct class_interface *class_intf)
    down(&parent->p->sem);
    list_del_init(&class_intf->node);
    if (class_intf->remove_dev) {
    - list_for_each_entry(dev, &parent->p->devices, node)
    + list_for_each_entry(dev, &parent->p->class_devices, node)
    class_intf->remove_dev(dev, class_intf);
    }
    up(&parent->p->sem);
    diff --git a/drivers/base/core.c b/drivers/base/core.c
    index 64c150b..52d1e71 100644
    --- a/drivers/base/core.c
    +++ b/drivers/base/core.c
    @@ -906,7 +906,7 @@ int device_add(struct device *dev)
    if (dev->class) {
    down(&dev->class->p->sem);
    /* tie the class to the device */
    - list_add_tail(&dev->node, &dev->class->p->devices);
    + list_add_tail(&dev->node, &dev->class->p->class_devices);

    /* notify any interfaces that the device is here */
    list_for_each_entry(class_intf, &dev->class->p->interfaces,
    --
    1.5.6.3

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  19. [PATCH 52/79] driver core: remove DEVICE_NAME_SIZE define

    From: Kay Sievers

    There is no such thing as a "device name size" in the driver core, so
    remove the define and fix up any users of this odd define in the rest of
    the kernel.

    Signed-off-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/eisa/Makefile | 2 +-
    drivers/eisa/eisa-bus.c | 4 ++--
    drivers/mca/mca-bus.c | 2 +-
    drivers/video/aty/aty128fb.c | 2 +-
    drivers/video/aty/radeonfb.h | 2 +-
    include/linux/device.h | 3 ---
    include/linux/eisa.h | 2 +-
    7 files changed, 7 insertions(+), 10 deletions(-)

    diff --git a/drivers/eisa/Makefile b/drivers/eisa/Makefile
    index 70abf93..5369ce9 100644
    --- a/drivers/eisa/Makefile
    +++ b/drivers/eisa/Makefile
    @@ -9,7 +9,7 @@ obj-${CONFIG_EISA_VIRTUAL_ROOT} += virtual_root.o


    # Ugly hack to get DEVICE_NAME_SIZE value...
    -DEVICE_NAME_SIZE =$(shell awk '$$1=="\#define" && $$2=="DEVICE_NAME_SIZE" {print $$3-1}' $(srctree)/include/linux/device.h)
    +DEVICE_NAME_SIZE = 50

    $(obj)/eisa-bus.o: $(obj)/devlist.h

    diff --git a/drivers/eisa/eisa-bus.c b/drivers/eisa/eisa-bus.c
    index 65dcf04..c950bf8 100644
    --- a/drivers/eisa/eisa-bus.c
    +++ b/drivers/eisa/eisa-bus.c
    @@ -22,7 +22,7 @@

    struct eisa_device_info {
    struct eisa_device_id id;
    - char name[DEVICE_NAME_SIZE];
    + char name[50];
    };

    #ifdef CONFIG_EISA_NAMES
    @@ -63,7 +63,7 @@ static void __init eisa_name_device (struct eisa_device *edev)
    if (!strcmp (edev->id.sig, eisa_table[i].id.sig)) {
    strlcpy (edev->pretty_name,
    eisa_table[i].name,
    - DEVICE_NAME_SIZE);
    + sizeof(edev->pretty_name));
    return;
    }
    }
    diff --git a/drivers/mca/mca-bus.c b/drivers/mca/mca-bus.c
    index 67b8e94..ef2dbfe 100644
    --- a/drivers/mca/mca-bus.c
    +++ b/drivers/mca/mca-bus.c
    @@ -40,7 +40,7 @@ static struct mca_bus *mca_root_busses[MAX_MCA_BUSSES];

    struct mca_device_info {
    short pos_id; /* the 2 byte pos id for this card */
    - char name[DEVICE_NAME_SIZE];
    + char name[50];
    };

    static int mca_bus_match (struct device *dev, struct device_driver *drv)
    diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
    index 24ee96c..07b6add 100644
    --- a/drivers/video/aty/aty128fb.c
    +++ b/drivers/video/aty/aty128fb.c
    @@ -1872,7 +1872,7 @@ static int __devinit aty128_init(struct pci_dev *pdev, const struct pci_device_i
    struct fb_info *info = pci_get_drvdata(pdev);
    struct aty128fb_par *par = info->par;
    struct fb_var_screeninfo var;
    - char video_card[DEVICE_NAME_SIZE];
    + char video_card[50];
    u8 chip_rev;
    u32 dac;

    diff --git a/drivers/video/aty/radeonfb.h b/drivers/video/aty/radeonfb.h
    index c347e38..ccbfffd 100644
    --- a/drivers/video/aty/radeonfb.h
    +++ b/drivers/video/aty/radeonfb.h
    @@ -289,7 +289,7 @@ struct radeonfb_info {
    struct radeon_regs state;
    struct radeon_regs init_state;

    - char name[DEVICE_NAME_SIZE];
    + char name[50];

    unsigned long mmio_base_phys;
    unsigned long fb_base_phys;
    diff --git a/include/linux/device.h b/include/linux/device.h
    index fba1bb0..894fdb2 100644
    --- a/include/linux/device.h
    +++ b/include/linux/device.h
    @@ -25,9 +25,6 @@
    #include
    #include

    -#define DEVICE_NAME_SIZE 50
    -/* DEVICE_NAME_HALF is really less than half to accommodate slop */
    -#define DEVICE_NAME_HALF __stringify(20)
    #define DEVICE_ID_SIZE 32
    #define BUS_ID_SIZE 20

    diff --git a/include/linux/eisa.h b/include/linux/eisa.h
    index fe806b6..e61c0be 100644
    --- a/include/linux/eisa.h
    +++ b/include/linux/eisa.h
    @@ -40,7 +40,7 @@ struct eisa_device {
    u64 dma_mask;
    struct device dev; /* generic device */
    #ifdef CONFIG_EISA_NAMES
    - char pretty_name[DEVICE_NAME_SIZE];
    + char pretty_name[50];
    #endif
    };

    --
    1.5.6.3

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  20. [PATCH 38/79] block: move header for /proc/partitions to seq_start

    The seq_start call is the better place for the header for the file, that
    way we don't have to be mucking in the class structure to try to figure
    out if this is the first partition or not.

    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman
    ---
    block/genhd.c | 7 ++++---
    1 files changed, 4 insertions(+), 3 deletions(-)

    diff --git a/block/genhd.c b/block/genhd.c
    index f03bdad..70f1d70 100644
    --- a/block/genhd.c
    +++ b/block/genhd.c
    @@ -305,6 +305,10 @@ static int find_start(struct device *dev, void *data)
    static void *part_start(struct seq_file *part, loff_t *pos)
    {
    struct device *dev;
    + loff_t n = *pos;
    +
    + if (!n)
    + seq_puts(part, "major minor #blocks name\n\n");

    mutex_lock(&block_class_lock);
    dev = class_find_device(&block_class, NULL, (void *)pos, find_start);
    @@ -338,9 +342,6 @@ static int show_partition(struct seq_file *part, void *v)
    int n;
    char buf[BDEVNAME_SIZE];

    - if (&sgp->dev.node == block_class.devices.next)
    - seq_puts(part, "major minor #blocks name\n\n");
    -
    /* Don't show non-partitionable removeable devices or empty devices */
    if (!get_capacity(sgp) ||
    (sgp->minors == 1 && (sgp->flags & GENHD_FL_REMOVABLE)))
    --
    1.5.6.3

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread
Page 1 of 4 1 2 3 ... LastLast