[GIT PATCH] driver core patches for your 2.6-git tree - Kernel

This is a discussion on [GIT PATCH] driver core patches for your 2.6-git tree - Kernel ; Here is the driver core patchset for your 2.6-git tree. Highlights include: - device_create_drvdata is finally removed as it's no longer used, device_create is all that is needed. This went through a 2 kernel release cycle to flush everything out ...

+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 20 of 42

Thread: [GIT PATCH] driver core patches for your 2.6-git tree

  1. [GIT PATCH] driver core patches for your 2.6-git tree

    Here is the driver core patchset for your 2.6-git tree.

    Highlights include:
    - device_create_drvdata is finally removed as it's no longer
    used, device_create is all that is needed. This went through
    a 2 kernel release cycle to flush everything out properly.
    - dynamic dev_printk() patch, allows debugging to be turned on
    the fly, instead of at build time. This is very good and has
    been in the opensuse beta releases already with much success.
    - the usb gadget drivers had to be reworked to fix linker errors
    that the dynamic dev_printk() patches exposed. They are in
    this tree as the dev_printk() patches require them in order to
    not break the build.
    - uio cleanups and a new uio driver
    - sysfs field added to oops messages from Andrew. This has been
    in the -mm tree for years and in the SuSE kernel releases for
    almost the same ammount of time and has been very helpful.
    - minor bugfixes all over the place

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

    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/kernel-parameters.txt | 5 +
    Documentation/kobject.txt | 4 +
    arch/mips/kernel/rtlx.c | 4 +-
    arch/mips/sibyte/common/sb_tbprof.c | 3 +-
    arch/x86/kernel/cpuid.c | 4 +-
    arch/x86/kernel/dumpstack_32.c | 2 +
    arch/x86/kernel/dumpstack_64.c | 2 +
    arch/x86/kernel/msr.c | 4 +-
    block/bsg.c | 3 +-
    drivers/base/bus.c | 54 +++-
    drivers/base/core.c | 30 ++-
    drivers/base/dd.c | 3 +
    drivers/base/platform.c | 49 +++-
    drivers/base/power/main.c | 2 +-
    drivers/block/aoe/aoechr.c | 6 +-
    drivers/block/paride/pg.c | 5 +-
    drivers/block/paride/pt.c | 10 +-
    drivers/block/pktcdvd.c | 5 +-
    drivers/char/bsr.c | 5 +-
    drivers/char/dsp56k.c | 4 +-
    drivers/char/ip2/ip2main.c | 12 +-
    drivers/char/ipmi/ipmi_devintf.c | 2 +-
    drivers/char/istallion.c | 5 +-
    drivers/char/lp.c | 4 +-
    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 | 4 +-
    drivers/char/stallion.c | 4 +-
    drivers/char/tty_io.c | 2 +-
    drivers/char/vc_screen.c | 12 +-
    drivers/char/viotape.c | 8 +-
    drivers/char/xilinx_hwicap/xilinx_hwicap.c | 3 +-
    drivers/dca/dca-sysfs.c | 8 +-
    drivers/firmware/iscsi_ibft.c | 18 +-
    drivers/hid/hidraw.c | 5 +-
    drivers/hwmon/hwmon.c | 4 +-
    drivers/i2c/i2c-dev.c | 6 +-
    drivers/ide/ide-probe.c | 4 +-
    drivers/ide/ide-tape.c | 11 +-
    drivers/ieee1394/dv1394.c | 8 +-
    drivers/ieee1394/raw1394.c | 8 +-
    drivers/ieee1394/video1394.c | 5 +-
    drivers/infiniband/core/cm.c | 6 +-
    drivers/infiniband/core/user_mad.c | 12 +-
    drivers/infiniband/core/uverbs_main.c | 9 +-
    drivers/infiniband/hw/ipath/ipath_file_ops.c | 2 +-
    drivers/isdn/capi/capi.c | 3 +-
    drivers/leds/led-class.c | 4 +-
    drivers/macintosh/adb.c | 3 +-
    drivers/media/dvb/dvb-core/dvbdev.c | 2 +-
    drivers/misc/phantom.c | 6 +-
    drivers/mtd/mtdchar.c | 10 +-
    drivers/net/phy/phy_device.c | 8 +-
    drivers/net/ppp_generic.c | 4 +-
    drivers/net/wan/cosa.c | 4 +-
    drivers/net/wireless/mac80211_hwsim.c | 6 +-
    drivers/pci/probe.c | 50 +---
    drivers/pnp/base.h | 2 +-
    drivers/pnp/core.c | 10 +-
    drivers/pnp/driver.c | 1 +
    drivers/pnp/interface.c | 37 +--
    drivers/power/power_supply_core.c | 4 +-
    drivers/s390/char/raw3270.c | 14 +-
    drivers/s390/char/tape_class.c | 6 +-
    drivers/s390/char/vmlogrdr.c | 8 +-
    drivers/s390/char/vmur.c | 5 +-
    drivers/scsi/ch.c | 6 +-
    drivers/scsi/dpt_i2o.c | 2 +-
    drivers/scsi/osst.c | 3 +-
    drivers/scsi/sg.c | 10 +-
    drivers/scsi/st.c | 11 +-
    drivers/spi/spidev.c | 7 +-
    drivers/uio/Kconfig | 13 +
    drivers/uio/Makefile | 1 +
    drivers/uio/uio.c | 26 ++-
    drivers/uio/uio_pdrv.c | 2 +-
    drivers/uio/uio_sercos3.c | 243 +++++++++++++++
    drivers/usb/core/devio.c | 6 +-
    drivers/usb/core/file.c | 6 +-
    drivers/usb/core/hcd.c | 5 +-
    drivers/usb/gadget/Makefile | 23 +-
    drivers/usb/gadget/cdc2.c | 25 ++-
    drivers/usb/gadget/ether.c | 28 ++-
    drivers/usb/gadget/f_ecm.c | 108 ++++----
    drivers/usb/gadget/f_loopback.c | 34 ++-
    drivers/usb/gadget/f_subset.c | 44 ++--
    drivers/usb/gadget/file_storage.c | 12 +
    drivers/usb/gadget/gmidi.c | 15 +
    drivers/usb/gadget/printer.c | 18 +-
    drivers/usb/gadget/rndis.c | 115 ++++----
    drivers/usb/gadget/serial.c | 18 ++
    drivers/usb/gadget/u_ether.c | 4 +-
    drivers/usb/gadget/zero.c | 17 +
    drivers/usb/host/uhci-q.c | 24 +-
    drivers/usb/misc/phidgetkit.c | 5 +-
    drivers/usb/misc/phidgetmotorcontrol.c | 5 +-
    drivers/usb/misc/phidgetservo.c | 5 +-
    drivers/usb/mon/mon_bin.c | 6 +-
    drivers/video/console/fbcon.c | 4 +-
    drivers/video/display/display-sysfs.c | 9 +-
    drivers/video/fbmem.c | 5 +-
    fs/coda/psdev.c | 5 +-
    fs/sysfs/bin.c | 42 ++-
    fs/sysfs/dir.c | 24 +-
    fs/sysfs/file.c | 46 ++-
    fs/sysfs/mount.c | 15 +
    fs/sysfs/sysfs.h | 6 +-
    include/asm-generic/vmlinux.lds.h | 10 +-
    include/linux/device.h | 18 +-
    include/linux/dynamic_printk.h | 93 ++++++
    include/linux/kernel.h | 7 +-
    include/linux/module.h | 1 -
    include/linux/platform_device.h | 2 +
    include/linux/sysfs.h | 36 ++-
    kernel/module.c | 33 ++-
    lib/Kconfig.debug | 55 ++++
    lib/Makefile | 2 +
    lib/dynamic_printk.c | 418 ++++++++++++++++++++++++++
    lib/kobject.c | 35 ++-
    net/netfilter/nf_conntrack_pptp.c | 2 +-
    scripts/Makefile.lib | 11 +-
    scripts/basic/Makefile | 2 +-
    scripts/basic/hash.c | 64 ++++
    sound/core/init.c | 6 +-
    sound/core/sound.c | 5 +-
    sound/oss/soundcard.c | 15 +-
    sound/sound_core.c | 5 +-
    131 files changed, 1786 insertions(+), 617 deletions(-)
    create mode 100644 drivers/uio/uio_sercos3.c
    create mode 100644 include/linux/dynamic_printk.h
    create mode 100644 lib/dynamic_printk.c
    create mode 100644 scripts/basic/hash.c

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

    Adrian Bunk (2):
    driver core: make struct platform_pm_ops static
    drivers/firmware/iscsi_ibft.c: make 3 functions static

    Alexey Dobriyan (1):
    modules: fix module "notes" kobject leak

    Andrew G. Harvey (1):
    UIO: Fix mapping of logical and virtual memory

    Andrew Morton (1):
    sysfs: crash debugging

    Arjan van de Ven (4):
    device model: Do a quickcheck for driver binding before doing an expensive check
    debug: Introduce a dev_WARN() function
    debug: use dev_WARN() rather than WARN_ON() in device_pm_add()
    usb: turn dev_warn+WARN_ON combos into dev_WARN

    Cornelia Huck (2):
    Driver core: Clarify device cleanup.
    Driver core: Fix cleanup in device_create_vargs().

    David Brownell (7):
    usb gadget: link fixes for serial gadget
    usb gadget: link fixes for gadget zero
    usb gadget: link fixes for MIDI gadget
    usb gadget: link fixes for printer gadget
    usb gadget: link fixes for storage gadget
    usb gadget: link fixes for cdc composite gadget
    usb gadget: link fixes for network gadget

    Dmitry Baryshkov (1):
    platform: add new device registration helper

    Drew Moseley (1):
    PNP: create device attributes via default device attributes

    Eric W. Biederman (2):
    kobject: Fix kobject_rename and !CONFIG_SYSFS
    kobject: Cleanup kobject_rename and !CONFIG_SYSFS

    Greg Kroah-Hartman (15):
    device create: block: convert device_create_drvdata to device_create
    device create: char: convert device_create_drvdata to device_create
    device create: ieee1394: convert device_create_drvdata to device_create
    device create: infiniband: convert device_create_drvdata to device_create
    device create: misc: convert device_create_drvdata to device_create
    device create: net: convert device_create_drvdata to device_create
    device create: s390: convert device_create_drvdata to device_create
    device create: scsi: convert device_create_drvdata to device_create
    device create: sound: convert device_create_drvdata to device_create
    device create: usb: convert device_create_drvdata to device_create
    device create: video: convert device_create_drvdata to device_create
    device create: ide: convert device_create_drvdata to device_create
    device create: remove device_create_drvdata
    NET: convert the phy_device file to use bus_find_device_by_name
    Driver core: add bus_sort_breadthfirst() function

    Hans J. Koch (2):
    UIO: Add alignment warnings for uio-mem
    UIO: Change driver name of uio_pdrv

    Jason Baron (1):
    driver core: basic infrastructure for per-module dynamic debug messages

    John Ogness (1):
    UIO: add automata sercos3 pci card support

    Neil Brown (1):
    sysfs: Support sysfs_notify from atomic context with new sysfs_notify_dirent

    Nick Piggin (1):
    sysfs: fix deadlock

    Peter Korsgaard (1):
    Driver core: make bus_find_device_by_name() more robust

    Tejun Heo (1):
    sysfs: use ilookup5() instead of ilookup5_nowait()

    Trent Piepho (1):
    sysfs: Make dir and name args to sysfs_notify() const

    --
    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 10/46] device create: scsi: convert device_create_drvdata to device_create

    Now that device_create() has been audited, rename things back to the
    original call to be sane.

    Cc: James E.J. Bottomley
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/scsi/ch.c | 6 +++---
    drivers/scsi/dpt_i2o.c | 2 +-
    drivers/scsi/osst.c | 3 ++-
    drivers/scsi/sg.c | 10 ++++------
    drivers/scsi/st.c | 11 ++++-------
    5 files changed, 14 insertions(+), 18 deletions(-)

    diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c
    index 3c257fe..88ecf94 100644
    --- a/drivers/scsi/ch.c
    +++ b/drivers/scsi/ch.c
    @@ -914,9 +914,9 @@ static int ch_probe(struct device *dev)
    ch->minor = minor;
    sprintf(ch->name,"ch%d",ch->minor);

    - class_dev = device_create_drvdata(ch_sysfs_class, dev,
    - MKDEV(SCSI_CHANGER_MAJOR, ch->minor),
    - ch, "s%s", ch->name);
    + class_dev = device_create(ch_sysfs_class, dev,
    + MKDEV(SCSI_CHANGER_MAJOR, ch->minor), ch,
    + "s%s", ch->name);
    if (IS_ERR(class_dev)) {
    printk(KERN_WARNING "ch%d: device_create failed\n",
    ch->minor);
    diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
    index 1fe0901..8aba4fd 100644
    --- a/drivers/scsi/dpt_i2o.c
    +++ b/drivers/scsi/dpt_i2o.c
    @@ -271,7 +271,7 @@ rebuild_sys_tab:
    pHba->initialized = TRUE;
    pHba->state &= ~DPTI_STATE_RESET;
    if (adpt_sysfs_class) {
    - struct device *dev = device_create_drvdata(adpt_sysfs_class,
    + struct device *dev = device_create(adpt_sysfs_class,
    NULL, MKDEV(DPTI_I2O_MAJOR, pHba->unit), NULL,
    "dpti%d", pHba->unit);
    if (IS_ERR(dev)) {
    diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c
    index 1c79f97..0ea78d9 100644
    --- a/drivers/scsi/osst.c
    +++ b/drivers/scsi/osst.c
    @@ -5708,7 +5708,8 @@ static int osst_sysfs_add(dev_t dev, struct device *device, struct osst_tape * S
    struct device *osst_member;
    int err;

    - osst_member = device_create_drvdata(osst_sysfs_class, device, dev, STp, "%s", name);
    + osst_member = device_create(osst_sysfs_class, device, dev, STp,
    + "%s", name);
    if (IS_ERR(osst_member)) {
    printk(KERN_WARNING "osst :W: Unable to add sysfs class member %s\n", name);
    return PTR_ERR(osst_member);
    diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
    index ba9b9bb..93bd59a 100644
    --- a/drivers/scsi/sg.c
    +++ b/drivers/scsi/sg.c
    @@ -1450,12 +1450,10 @@ sg_add(struct device *cl_dev, struct class_interface *cl_intf)
    if (sg_sysfs_valid) {
    struct device *sg_class_member;

    - sg_class_member = device_create_drvdata(sg_sysfs_class,
    - cl_dev->parent,
    - MKDEV(SCSI_GENERIC_MAJOR,
    - sdp->index),
    - sdp,
    - "%s", disk->disk_name);
    + sg_class_member = device_create(sg_sysfs_class, cl_dev->parent,
    + MKDEV(SCSI_GENERIC_MAJOR,
    + sdp->index),
    + sdp, "%s", disk->disk_name);
    if (IS_ERR(sg_class_member)) {
    printk(KERN_ERR "sg_add: "
    "device_create failed\n");
    diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
    index c2bb53e..5c28d08 100644
    --- a/drivers/scsi/st.c
    +++ b/drivers/scsi/st.c
    @@ -4428,13 +4428,10 @@ static int do_create_class_files(struct scsi_tape *STp, int dev_num, int mode)
    snprintf(name, 10, "%s%s%s", rew ? "n" : "",
    STp->disk->disk_name, st_formats[i]);
    st_class_member =
    - device_create_drvdata(st_sysfs_class,
    - &STp->device->sdev_gendev,
    - MKDEV(SCSI_TAPE_MAJOR,
    - TAPE_MINOR(dev_num,
    - mode, rew)),
    - &STp->modes[mode],
    - "%s", name);
    + device_create(st_sysfs_class, &STp->device->sdev_gendev,
    + MKDEV(SCSI_TAPE_MAJOR,
    + TAPE_MINOR(dev_num, mode, rew)),
    + &STp->modes[mode], "%s", name);
    if (IS_ERR(st_class_member)) {
    printk(KERN_WARNING "st%d: device_create failed\n",
    dev_num);
    --
    1.6.0.2

    --
    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 38/46] sysfs: Make dir and name args to sysfs_notify() const

    From: Trent Piepho

    Because they can be, and because code like this produces a warning if
    they're not:

    struct device_attribute dev_attr;

    sysfs_notify(&kobj, NULL, dev_attr.attr.name);

    Signed-off-by: Trent Piepho
    CC: Neil Brown
    Signed-off-by: Greg Kroah-Hartman
    ---
    fs/sysfs/file.c | 2 +-
    include/linux/sysfs.h | 5 +++--
    2 files changed, 4 insertions(+), 3 deletions(-)

    diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
    index d0d79e6..1f4a3f8 100644
    --- a/fs/sysfs/file.c
    +++ b/fs/sysfs/file.c
    @@ -469,7 +469,7 @@ void sysfs_notify_dirent(struct sysfs_dirent *sd)
    }
    EXPORT_SYMBOL_GPL(sysfs_notify_dirent);

    -void sysfs_notify(struct kobject *k, char *dir, char *attr)
    +void sysfs_notify(struct kobject *k, const char *dir, const char *attr)
    {
    struct sysfs_dirent *sd = k->sd;

    diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
    index d8e0230..b330e28 100644
    --- a/include/linux/sysfs.h
    +++ b/include/linux/sysfs.h
    @@ -119,7 +119,7 @@ int sysfs_add_file_to_group(struct kobject *kobj,
    void sysfs_remove_file_from_group(struct kobject *kobj,
    const struct attribute *attr, const char *group);

    -void sysfs_notify(struct kobject *kobj, char *dir, char *attr);
    +void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr);
    void sysfs_notify_dirent(struct sysfs_dirent *sd);
    struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd,
    const unsigned char *name);
    @@ -229,7 +229,8 @@ static inline void sysfs_remove_file_from_group(struct kobject *kobj,
    {
    }

    -static inline void sysfs_notify(struct kobject *kobj, char *dir, char *attr)
    +static inline void sysfs_notify(struct kobject *kobj, const char *dir,
    + const char *attr)
    {
    }
    static inline void sysfs_notify_dirent(struct sysfs_dirent *sd)
    --
    1.6.0.2

    --
    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 25/46] sysfs: Support sysfs_notify from atomic context with new sysfs_notify_dirent

    From: Neil Brown

    Support sysfs_notify from atomic context with new sysfs_notify_dirent

    sysfs_notify currently takes sysfs_mutex.
    This means that it cannot be called in atomic context.
    sysfs_mutex is sometimes held over a malloc (sysfs_rename_dir)
    so it can block on low memory.

    In md I want to be able to notify on a sysfs attribute from
    atomic context, and I don't want to block on low memory because I
    could be in the writeout path for freeing memory.

    So:
    - export the "sysfs_dirent" structure along with sysfs_get, sysfs_put
    and sysfs_get_dirent so I can get the sysfs_dirent that I want to
    notify on and hold it in an md structure.
    - split sysfs_notify_dirent out of sysfs_notify so the sysfs_dirent
    can be notified on with no blocking (just a spinlock).

    Signed-off-by: Neil Brown
    Acked-by: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman
    ---
    fs/sysfs/dir.c | 1 +
    fs/sysfs/file.c | 31 ++++++++++++++++++-------------
    fs/sysfs/mount.c | 15 +++++++++++++++
    fs/sysfs/sysfs.h | 6 ++++--
    include/linux/sysfs.h | 27 ++++++++++++++++++++++++---
    5 files changed, 62 insertions(+), 18 deletions(-)

    diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
    index aedaeba..53bc7fc 100644
    --- a/fs/sysfs/dir.c
    +++ b/fs/sysfs/dir.c
    @@ -636,6 +636,7 @@ struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd,

    return sd;
    }
    +EXPORT_SYMBOL_GPL(sysfs_get_dirent);

    static int create_dir(struct kobject *kobj, struct sysfs_dirent *parent_sd,
    const char *name, struct sysfs_dirent **p_sd)
    diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
    index ce8339c..d0d79e6 100644
    --- a/fs/sysfs/file.c
    +++ b/fs/sysfs/file.c
    @@ -453,6 +453,22 @@ static unsigned int sysfs_poll(struct file *filp, poll_table *wait)
    return POLLERR|POLLPRI;
    }

    +void sysfs_notify_dirent(struct sysfs_dirent *sd)
    +{
    + struct sysfs_open_dirent *od;
    +
    + spin_lock(&sysfs_open_dirent_lock);
    +
    + od = sd->s_attr.open;
    + if (od) {
    + atomic_inc(&od->event);
    + wake_up_interruptible(&od->poll);
    + }
    +
    + spin_unlock(&sysfs_open_dirent_lock);
    +}
    +EXPORT_SYMBOL_GPL(sysfs_notify_dirent);
    +
    void sysfs_notify(struct kobject *k, char *dir, char *attr)
    {
    struct sysfs_dirent *sd = k->sd;
    @@ -463,19 +479,8 @@ void sysfs_notify(struct kobject *k, char *dir, char *attr)
    sd = sysfs_find_dirent(sd, dir);
    if (sd && attr)
    sd = sysfs_find_dirent(sd, attr);
    - if (sd) {
    - struct sysfs_open_dirent *od;
    -
    - spin_lock(&sysfs_open_dirent_lock);
    -
    - od = sd->s_attr.open;
    - if (od) {
    - atomic_inc(&od->event);
    - wake_up_interruptible(&od->poll);
    - }
    -
    - spin_unlock(&sysfs_open_dirent_lock);
    - }
    + if (sd)
    + sysfs_notify_dirent(sd);

    mutex_unlock(&sysfs_mutex);
    }
    diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
    index 14f0023..ab343e3 100644
    --- a/fs/sysfs/mount.c
    +++ b/fs/sysfs/mount.c
    @@ -16,6 +16,7 @@
    #include
    #include
    #include
    +#include

    #include "sysfs.h"

    @@ -115,3 +116,17 @@ out_err:
    sysfs_dir_cachep = NULL;
    goto out;
    }
    +
    +#undef sysfs_get
    +struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd)
    +{
    + return __sysfs_get(sd);
    +}
    +EXPORT_SYMBOL_GPL(sysfs_get);
    +
    +#undef sysfs_put
    +void sysfs_put(struct sysfs_dirent *sd)
    +{
    + __sysfs_put(sd);
    +}
    +EXPORT_SYMBOL_GPL(sysfs_put);
    diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
    index a5db496..93c6d6b 100644
    --- a/fs/sysfs/sysfs.h
    +++ b/fs/sysfs/sysfs.h
    @@ -124,7 +124,7 @@ int sysfs_create_subdir(struct kobject *kobj, const char *name,
    struct sysfs_dirent **p_sd);
    void sysfs_remove_subdir(struct sysfs_dirent *sd);

    -static inline struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd)
    +static inline struct sysfs_dirent *__sysfs_get(struct sysfs_dirent *sd)
    {
    if (sd) {
    WARN_ON(!atomic_read(&sd->s_count));
    @@ -132,12 +132,14 @@ static inline struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd)
    }
    return sd;
    }
    +#define sysfs_get(sd) __sysfs_get(sd)

    -static inline void sysfs_put(struct sysfs_dirent *sd)
    +static inline void __sysfs_put(struct sysfs_dirent *sd)
    {
    if (sd && atomic_dec_and_test(&sd->s_count))
    release_sysfs_dirent(sd);
    }
    +#define sysfs_put(sd) __sysfs_put(sd)

    /*
    * inode.c
    diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
    index 8ec406a..d8e0230 100644
    --- a/include/linux/sysfs.h
    +++ b/include/linux/sysfs.h
    @@ -78,6 +78,8 @@ struct sysfs_ops {
    ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
    };

    +struct sysfs_dirent;
    +
    #ifdef CONFIG_SYSFS

    int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *),
    @@ -118,10 +120,13 @@ void sysfs_remove_file_from_group(struct kobject *kobj,
    const struct attribute *attr, const char *group);

    void sysfs_notify(struct kobject *kobj, char *dir, char *attr);
    -
    +void sysfs_notify_dirent(struct sysfs_dirent *sd);
    +struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd,
    + const unsigned char *name);
    +struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd);
    +void sysfs_put(struct sysfs_dirent *sd);
    void sysfs_printk_last_file(void);
    -
    -extern int __must_check sysfs_init(void);
    +int __must_check sysfs_init(void);

    #else /* CONFIG_SYSFS */

    @@ -227,6 +232,22 @@ static inline void sysfs_remove_file_from_group(struct kobject *kobj,
    static inline void sysfs_notify(struct kobject *kobj, char *dir, char *attr)
    {
    }
    +static inline void sysfs_notify_dirent(struct sysfs_dirent *sd)
    +{
    +}
    +static inline
    +struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd,
    + const unsigned char *name)
    +{
    + return NULL;
    +}
    +static inline struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd)
    +{
    + return NULL;
    +}
    +static inline void sysfs_put(struct sysfs_dirent *sd)
    +{
    +}

    static inline int __must_check sysfs_init(void)
    {
    --
    1.6.0.2

    --
    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 36/46] sysfs: use ilookup5() instead of ilookup5_nowait()

    From: Tejun Heo

    As inode creation is protected by sysfs_mutex, ilookup5_nowait()
    always either fails to find at all or finds one which is fully
    initialized, so using ilookup5_nowait() or ilookup5() doesn't make any
    difference. Switch to ilookup5() as it's planned to be removed. This
    change also makes lookup return value handling a bit simpler.

    This change was suggested by Al Viro.

    Signed-off-by: Tejun Heo
    Cc: Al Viro
    Signed-off-by: Greg Kroah-Hartman
    ---
    fs/sysfs/dir.c | 17 ++++++++---------
    1 files changed, 8 insertions(+), 9 deletions(-)

    diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
    index 53bc7fc..c183426 100644
    --- a/fs/sysfs/dir.c
    +++ b/fs/sysfs/dir.c
    @@ -370,17 +370,17 @@ void sysfs_addrm_start(struct sysfs_addrm_cxt *acxt,
    memset(acxt, 0, sizeof(*acxt));
    acxt->parent_sd = parent_sd;

    - /* Lookup parent inode. inode initialization and I_NEW
    - * clearing are protected by sysfs_mutex. By grabbing it and
    - * looking up with _nowait variant, inode state can be
    - * determined reliably.
    + /* Lookup parent inode. inode initialization is protected by
    + * sysfs_mutex, so inode existence can be determined by
    + * looking up inode while holding sysfs_mutex.
    */
    mutex_lock(&sysfs_mutex);

    - inode = ilookup5_nowait(sysfs_sb, parent_sd->s_ino, sysfs_ilookup_test,
    - parent_sd);
    + inode = ilookup5(sysfs_sb, parent_sd->s_ino, sysfs_ilookup_test,
    + parent_sd);
    + if (inode) {
    + WARN_ON(inode->i_state & I_NEW);

    - if (inode && !(inode->i_state & I_NEW)) {
    /* parent inode available */
    acxt->parent_inode = inode;

    @@ -393,8 +393,7 @@ void sysfs_addrm_start(struct sysfs_addrm_cxt *acxt,
    mutex_lock(&inode->i_mutex);
    mutex_lock(&sysfs_mutex);
    }
    - } else
    - iput(inode);
    + }
    }

    /**
    --
    1.6.0.2

    --
    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 11/46] device create: sound: convert device_create_drvdata to device_create

    Now that device_create() has been audited, rename things back to the
    original call to be sane.

    Cc: Jaroslav Kysela
    Signed-off-by: Greg Kroah-Hartman
    ---
    sound/core/init.c | 6 +++---
    sound/core/sound.c | 5 ++---
    sound/oss/soundcard.c | 15 +++++++--------
    sound/sound_core.c | 5 ++---
    4 files changed, 14 insertions(+), 17 deletions(-)

    diff --git a/sound/core/init.c b/sound/core/init.c
    index 8af467d..ef2352c 100644
    --- a/sound/core/init.c
    +++ b/sound/core/init.c
    @@ -549,9 +549,9 @@ int snd_card_register(struct snd_card *card)
    return -EINVAL;
    #ifndef CONFIG_SYSFS_DEPRECATED
    if (!card->card_dev) {
    - card->card_dev = device_create_drvdata(sound_class, card->dev,
    - MKDEV(0, 0), NULL,
    - "card%i", card->number);
    + card->card_dev = device_create(sound_class, card->dev,
    + MKDEV(0, 0), NULL,
    + "card%i", card->number);
    if (IS_ERR(card->card_dev))
    card->card_dev = NULL;
    }
    diff --git a/sound/core/sound.c b/sound/core/sound.c
    index c0685e2..44a69bb 100644
    --- a/sound/core/sound.c
    +++ b/sound/core/sound.c
    @@ -274,9 +274,8 @@ int snd_register_device_for_dev(int type, struct snd_card *card, int dev,
    return minor;
    }
    snd_minors[minor] = preg;
    - preg->dev = device_create_drvdata(sound_class, device,
    - MKDEV(major, minor),
    - private_data, "%s", name);
    + preg->dev = device_create(sound_class, device, MKDEV(major, minor),
    + private_data, "%s", name);
    if (IS_ERR(preg->dev)) {
    snd_minors[minor] = NULL;
    mutex_unlock(&sound_mutex);
    diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c
    index 7d89c08..61aaeda 100644
    --- a/sound/oss/soundcard.c
    +++ b/sound/oss/soundcard.c
    @@ -560,19 +560,18 @@ static int __init oss_init(void)
    sound_dmap_flag = (dmabuf > 0 ? 1 : 0);

    for (i = 0; i < ARRAY_SIZE(dev_list); i++) {
    - device_create_drvdata(sound_class, NULL,
    - MKDEV(SOUND_MAJOR, dev_list[i].minor),
    - NULL, "%s", dev_list[i].name);
    + device_create(sound_class, NULL,
    + MKDEV(SOUND_MAJOR, dev_list[i].minor), NULL,
    + "%s", dev_list[i].name);

    if (!dev_list[i].num)
    continue;

    for (j = 1; j < *dev_list[i].num; j++)
    - device_create_drvdata(sound_class, NULL,
    - MKDEV(SOUND_MAJOR,
    - dev_list[i].minor + (j*0x10)),
    - NULL,
    - "%s%d", dev_list[i].name, j);
    + device_create(sound_class, NULL,
    + MKDEV(SOUND_MAJOR,
    + dev_list[i].minor + (j*0x10)),
    + NULL, "%s%d", dev_list[i].name, j);
    }

    if (sound_nblocks >= 1024)
    diff --git a/sound/sound_core.c b/sound/sound_core.c
    index 4ae07e2..faef87a 100644
    --- a/sound/sound_core.c
    +++ b/sound/sound_core.c
    @@ -220,9 +220,8 @@ static int sound_insert_unit(struct sound_unit **list, const struct file_operati
    else
    sprintf(s->name, "sound/%s%d", name, r / SOUND_STEP);

    - device_create_drvdata(sound_class, dev,
    - MKDEV(SOUND_MAJOR, s->unit_minor),
    - NULL, s->name+6);
    + device_create(sound_class, dev, MKDEV(SOUND_MAJOR, s->unit_minor),
    + NULL, s->name+6);
    return r;

    fail:
    --
    1.6.0.2

    --
    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 15/46] device create: remove device_create_drvdata

    Now that the tree is cleaned up, device_create_drvdata can be safely
    removed.

    Signed-off-by: Greg Kroah-Hartman
    ---
    include/linux/device.h | 1 -
    1 files changed, 0 insertions(+), 1 deletions(-)

    diff --git a/include/linux/device.h b/include/linux/device.h
    index 246937c..60f6456 100644
    --- a/include/linux/device.h
    +++ b/include/linux/device.h
    @@ -502,7 +502,6 @@ extern struct device *device_create(struct class *cls, struct device *parent,
    dev_t devt, void *drvdata,
    const char *fmt, ...)
    __attribute__((format(printf, 5, 6)));
    -#define device_create_drvdata device_create
    extern void device_destroy(struct class *cls, dev_t devt);

    /*
    --
    1.6.0.2

    --
    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 19/46] usb gadget: link fixes for printer gadget

    From: David Brownell

    Change how the printer gadget driver builds: don't use
    separate compilation, since it works poorly when key parts
    are library code (with init sections etc). Instead be as
    close as we can to "gcc --combine ...".

    Signed-off-by: David Brownell
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/usb/gadget/Makefile | 3 +--
    drivers/usb/gadget/printer.c | 14 ++++++++++++++
    2 files changed, 15 insertions(+), 2 deletions(-)

    diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
    index c47204f..99956b7 100644
    --- a/drivers/usb/gadget/Makefile
    +++ b/drivers/usb/gadget/Makefile
    @@ -31,8 +31,7 @@ g_midi-objs := gmidi.o
    gadgetfs-objs := inode.o
    g_file_storage-objs := file_storage.o usbstring.o config.o \
    epautoconf.o
    -g_printer-objs := printer.o usbstring.o config.o \
    - epautoconf.o
    +g_printer-objs := printer.o
    g_cdc-objs := cdc2.o u_ether.o f_ecm.o \
    u_serial.o f_acm.o $(C_UTILS)

    diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c
    index 7a8d4a1..2b3b9e1 100644
    --- a/drivers/usb/gadget/printer.c
    +++ b/drivers/usb/gadget/printer.c
    @@ -53,6 +53,20 @@

    #include "gadget_chips.h"

    +
    +/*
    + * Kbuild is not very cooperative with respect to linking separately
    + * compiled library objects into one module. So for now we won't use
    + * separate compilation ... ensuring init/exit sections work to shrink
    + * the runtime footprint, and giving us at least some parts of what
    + * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
    + */
    +#include "usbstring.c"
    +#include "config.c"
    +#include "epautoconf.c"
    +
    +/*-------------------------------------------------------------------------*/
    +
    #define DRIVER_DESC "Printer Gadget"
    #define DRIVER_VERSION "2007 OCT 06"

    --
    1.6.0.2

    --
    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 35/46] PNP: create device attributes via default device attributes

    From: Drew Moseley

    This creates the attributes before the uevent is sent.

    Signed-off-by: Drew Moseley
    Acked-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/pnp/base.h | 2 +-
    drivers/pnp/core.c | 10 +---------
    drivers/pnp/driver.c | 1 +
    drivers/pnp/interface.c | 37 ++++++++-----------------------------
    4 files changed, 11 insertions(+), 39 deletions(-)

    diff --git a/drivers/pnp/base.h b/drivers/pnp/base.h
    index 9fd7bb9..3532984 100644
    --- a/drivers/pnp/base.h
    +++ b/drivers/pnp/base.h
    @@ -4,6 +4,7 @@
    */

    extern spinlock_t pnp_lock;
    +extern struct device_attribute pnp_interface_attrs[];
    void *pnp_alloc(long size);

    int pnp_register_protocol(struct pnp_protocol *protocol);
    @@ -16,7 +17,6 @@ struct pnp_card *pnp_alloc_card(struct pnp_protocol *, int id, char *pnpid);

    int pnp_add_device(struct pnp_dev *dev);
    struct pnp_id *pnp_add_id(struct pnp_dev *dev, char *id);
    -int pnp_interface_attach_device(struct pnp_dev *dev);

    int pnp_add_card(struct pnp_card *card);
    void pnp_remove_card(struct pnp_card *card);
    diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c
    index a411582..7d65da8 100644
    --- a/drivers/pnp/core.c
    +++ b/drivers/pnp/core.c
    @@ -159,21 +159,13 @@ struct pnp_dev *pnp_alloc_dev(struct pnp_protocol *protocol, int id, char *pnpid

    int __pnp_add_device(struct pnp_dev *dev)
    {
    - int ret;
    -
    pnp_fixup_device(dev);
    dev->status = PNP_READY;
    spin_lock(&pnp_lock);
    list_add_tail(&dev->global_list, &pnp_global);
    list_add_tail(&dev->protocol_list, &dev->protocol->devices);
    spin_unlock(&pnp_lock);
    -
    - ret = device_register(&dev->dev);
    - if (ret)
    - return ret;
    -
    - pnp_interface_attach_device(dev);
    - return 0;
    + return device_register(&dev->dev);
    }

    /*
    diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c
    index d3f869e..e3f7e89 100644
    --- a/drivers/pnp/driver.c
    +++ b/drivers/pnp/driver.c
    @@ -206,6 +206,7 @@ struct bus_type pnp_bus_type = {
    .remove = pnp_device_remove,
    .suspend = pnp_bus_suspend,
    .resume = pnp_bus_resume,
    + .dev_attrs = pnp_interface_attrs,
    };

    int pnp_register_driver(struct pnp_driver *drv)
    diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c
    index a876ecf..478a4a7 100644
    --- a/drivers/pnp/interface.c
    +++ b/drivers/pnp/interface.c
    @@ -243,8 +243,6 @@ static ssize_t pnp_show_options(struct device *dmdev,
    return ret;
    }

    -static DEVICE_ATTR(options, S_IRUGO, pnp_show_options, NULL);
    -
    static ssize_t pnp_show_current_resources(struct device *dmdev,
    struct device_attribute *attr,
    char *buf)
    @@ -420,9 +418,6 @@ done:
    return count;
    }

    -static DEVICE_ATTR(resources, S_IRUGO | S_IWUSR,
    - pnp_show_current_resources, pnp_set_current_resources);
    -
    static ssize_t pnp_show_current_ids(struct device *dmdev,
    struct device_attribute *attr, char *buf)
    {
    @@ -437,27 +432,11 @@ static ssize_t pnp_show_current_ids(struct device *dmdev,
    return (str - buf);
    }

    -static DEVICE_ATTR(id, S_IRUGO, pnp_show_current_ids, NULL);
    -
    -int pnp_interface_attach_device(struct pnp_dev *dev)
    -{
    - int rc = device_create_file(&dev->dev, &dev_attr_options);
    -
    - if (rc)
    - goto err;
    - rc = device_create_file(&dev->dev, &dev_attr_resources);
    - if (rc)
    - goto err_opt;
    - rc = device_create_file(&dev->dev, &dev_attr_id);
    - if (rc)
    - goto err_res;
    -
    - return 0;
    -
    -err_res:
    - device_remove_file(&dev->dev, &dev_attr_resources);
    -err_opt:
    - device_remove_file(&dev->dev, &dev_attr_options);
    -err:
    - return rc;
    -}
    +struct device_attribute pnp_interface_attrs[] = {
    + __ATTR(resources, S_IRUGO | S_IWUSR,
    + pnp_show_current_resources,
    + pnp_set_current_resources),
    + __ATTR(options, S_IRUGO, pnp_show_options, NULL),
    + __ATTR(id, S_IRUGO, pnp_show_current_ids, NULL),
    + __ATTR_NULL,
    +};
    --
    1.6.0.2

    --
    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 21/46] usb gadget: link fixes for cdc composite gadget

    From: David Brownell

    Change how the CDC Composite gadget driver builds: don't
    use separate compilation, since it works poorly when key
    parts are library code (with init sections etc). Instead
    be as close as we can to "gcc --combine ...".

    Signed-off-by: David Brownell
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/usb/gadget/Makefile | 3 +--
    drivers/usb/gadget/cdc2.c | 25 +++++++++++++++++++++++--
    drivers/usb/gadget/u_ether.c | 4 ++--
    3 files changed, 26 insertions(+), 6 deletions(-)

    diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
    index 736d58f..bfa0229 100644
    --- a/drivers/usb/gadget/Makefile
    +++ b/drivers/usb/gadget/Makefile
    @@ -31,8 +31,7 @@ g_midi-objs := gmidi.o
    gadgetfs-objs := inode.o
    g_file_storage-objs := file_storage.o
    g_printer-objs := printer.o
    -g_cdc-objs := cdc2.o u_ether.o f_ecm.o \
    - u_serial.o f_acm.o $(C_UTILS)
    +g_cdc-objs := cdc2.o

    ifeq ($(CONFIG_USB_ETH_RNDIS),y)
    g_ether-objs += f_rndis.o rndis.o
    diff --git a/drivers/usb/gadget/cdc2.c b/drivers/usb/gadget/cdc2.c
    index a39a4b9..a724fc1 100644
    --- a/drivers/usb/gadget/cdc2.c
    +++ b/drivers/usb/gadget/cdc2.c
    @@ -43,6 +43,25 @@

    /*-------------------------------------------------------------------------*/

    +/*
    + * Kbuild is not very cooperative with respect to linking separately
    + * compiled library objects into one module. So for now we won't use
    + * separate compilation ... ensuring init/exit sections work to shrink
    + * the runtime footprint, and giving us at least some parts of what
    + * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
    + */
    +
    +#include "composite.c"
    +#include "usbstring.c"
    +#include "config.c"
    +#include "epautoconf.c"
    +#include "u_serial.c"
    +#include "f_acm.c"
    +#include "f_ecm.c"
    +#include "u_ether.c"
    +
    +/*-------------------------------------------------------------------------*/
    +
    static struct usb_device_descriptor device_desc = {
    .bLength = sizeof device_desc,
    .bDescriptorType = USB_DT_DEVICE,
    @@ -148,7 +167,8 @@ static int __init cdc_bind(struct usb_composite_dev *cdev)
    int status;

    if (!can_support_ecm(cdev->gadget)) {
    - ERROR(cdev, "controller '%s' not usable\n", gadget->name);
    + dev_err(&gadget->dev, "controller '%s' not usable\n",
    + gadget->name);
    return -EINVAL;
    }

    @@ -203,7 +223,8 @@ static int __init cdc_bind(struct usb_composite_dev *cdev)
    if (status < 0)
    goto fail1;

    - INFO(cdev, "%s, version: " DRIVER_VERSION "\n", DRIVER_DESC);
    + dev_info(&gadget->dev, "%s, version: " DRIVER_VERSION "\n",
    + DRIVER_DESC);

    return 0;

    diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
    index 3791e62..dbd575a 100644
    --- a/drivers/usb/gadget/u_ether.c
    +++ b/drivers/usb/gadget/u_ether.c
    @@ -52,7 +52,7 @@
    * this single "physical" link to be used by multiple virtual links.)
    */

    -#define DRIVER_VERSION "29-May-2008"
    +#define UETH__VERSION "29-May-2008"

    struct eth_dev {
    /* lock is held while accessing port_usb
    @@ -170,7 +170,7 @@ static void eth_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *p)
    struct eth_dev *dev = netdev_priv(net);

    strlcpy(p->driver, "g_ether", sizeof p->driver);
    - strlcpy(p->version, DRIVER_VERSION, sizeof p->version);
    + strlcpy(p->version, UETH__VERSION, sizeof p->version);
    strlcpy(p->fw_version, dev->gadget->name, sizeof p->fw_version);
    strlcpy(p->bus_info, dev_name(&dev->gadget->dev), sizeof p->bus_info);
    }
    --
    1.6.0.2

    --
    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 12/46] device create: usb: convert device_create_drvdata to device_create

    Now that device_create() has been audited, rename things back to the
    original call to be sane.

    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/usb/core/devio.c | 6 +++---
    drivers/usb/core/file.c | 6 +++---
    drivers/usb/core/hcd.c | 5 ++---
    drivers/usb/gadget/printer.c | 4 ++--
    drivers/usb/misc/phidgetkit.c | 5 ++---
    drivers/usb/misc/phidgetmotorcontrol.c | 5 ++---
    drivers/usb/misc/phidgetservo.c | 5 ++---
    drivers/usb/mon/mon_bin.c | 6 +++---
    8 files changed, 19 insertions(+), 23 deletions(-)

    diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
    index 20290c5..7a4fa79 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_drvdata(usb_classdev_class, &dev->dev,
    - dev->dev.devt, NULL, "usbdev%d.%d",
    - dev->bus->busnum, dev->devnum);
    + cldev = device_create(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 6b1b229..55f7f31 100644
    --- a/drivers/usb/core/file.c
    +++ b/drivers/usb/core/file.c
    @@ -196,9 +196,9 @@ int usb_register_dev(struct usb_interface *intf,
    ++temp;
    else
    temp = name;
    - intf->usb_dev = device_create_drvdata(usb_class->class, &intf->dev,
    - MKDEV(USB_MAJOR, minor), NULL,
    - "%s", temp);
    + intf->usb_dev = device_create(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/core/hcd.c b/drivers/usb/core/hcd.c
    index 8ab389d..c8035a8 100644
    --- a/drivers/usb/core/hcd.c
    +++ b/drivers/usb/core/hcd.c
    @@ -818,9 +818,8 @@ static int usb_register_bus(struct usb_bus *bus)
    set_bit (busnum, busmap.busmap);
    bus->busnum = busnum;

    - bus->dev = device_create_drvdata(usb_host_class, bus->controller,
    - MKDEV(0, 0), bus,
    - "usb_host%d", busnum);
    + bus->dev = device_create(usb_host_class, bus->controller, MKDEV(0, 0),
    + bus, "usb_host%d", busnum);
    result = PTR_ERR(bus->dev);
    if (IS_ERR(bus->dev))
    goto error_create_class_dev;
    diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c
    index e009008..7a8d4a1 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_drvdata(usb_gadget_class, NULL,
    - g_printer_devno, NULL, "g_printer");
    + dev->pdev = device_create(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/misc/phidgetkit.c b/drivers/usb/misc/phidgetkit.c
    index 4cfa25b..cc8e0a9 100644
    --- a/drivers/usb/misc/phidgetkit.c
    +++ b/drivers/usb/misc/phidgetkit.c
    @@ -595,9 +595,8 @@ static int interfacekit_probe(struct usb_interface *intf, const struct usb_devic
    } while(value);
    kit->dev_no = bit;

    - kit->dev = device_create_drvdata(phidget_class, &kit->udev->dev,
    - MKDEV(0, 0), kit,
    - "interfacekit%d", kit->dev_no);
    + kit->dev = device_create(phidget_class, &kit->udev->dev, MKDEV(0, 0),
    + kit, "interfacekit%d", kit->dev_no);
    if (IS_ERR(kit->dev)) {
    rc = PTR_ERR(kit->dev);
    kit->dev = NULL;
    diff --git a/drivers/usb/misc/phidgetmotorcontrol.c b/drivers/usb/misc/phidgetmotorcontrol.c
    index 9b4696f..38088b4 100644
    --- a/drivers/usb/misc/phidgetmotorcontrol.c
    +++ b/drivers/usb/misc/phidgetmotorcontrol.c
    @@ -365,9 +365,8 @@ static int motorcontrol_probe(struct usb_interface *intf, const struct usb_devic
    } while(value);
    mc->dev_no = bit;

    - mc->dev = device_create_drvdata(phidget_class, &mc->udev->dev,
    - MKDEV(0, 0), mc,
    - "motorcontrol%d", mc->dev_no);
    + mc->dev = device_create(phidget_class, &mc->udev->dev, MKDEV(0, 0), mc,
    + "motorcontrol%d", mc->dev_no);
    if (IS_ERR(mc->dev)) {
    rc = PTR_ERR(mc->dev);
    mc->dev = NULL;
    diff --git a/drivers/usb/misc/phidgetservo.c b/drivers/usb/misc/phidgetservo.c
    index 1ca7ddb..bef6fe1 100644
    --- a/drivers/usb/misc/phidgetservo.c
    +++ b/drivers/usb/misc/phidgetservo.c
    @@ -275,9 +275,8 @@ servo_probe(struct usb_interface *interface, const struct usb_device_id *id)
    } while (value);
    dev->dev_no = bit;

    - dev->dev = device_create_drvdata(phidget_class, &dev->udev->dev,
    - MKDEV(0, 0), dev,
    - "servo%d", dev->dev_no);
    + dev->dev = device_create(phidget_class, &dev->udev->dev, MKDEV(0, 0),
    + dev, "servo%d", dev->dev_no);
    if (IS_ERR(dev->dev)) {
    rc = PTR_ERR(dev->dev);
    dev->dev = NULL;
    diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
    index 6566fc0..c9de3f0 100644
    --- a/drivers/usb/mon/mon_bin.c
    +++ b/drivers/usb/mon/mon_bin.c
    @@ -1162,9 +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_drvdata(mon_bin_class, ubus? ubus->controller: NULL,
    - MKDEV(MAJOR(mon_bin_dev0), minor), NULL,
    - "usbmon%d", minor);
    + dev = device_create(mon_bin_class, ubus ? ubus->controller : NULL,
    + MKDEV(MAJOR(mon_bin_dev0), minor), NULL,
    + "usbmon%d", minor);
    if (IS_ERR(dev))
    return 0;

    --
    1.6.0.2

    --
    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 18/46] usb gadget: link fixes for MIDI gadget

    From: David Brownell

    Change how the MIDI gadget driver builds: don't use separate
    compilation, since it works poorly when key parts are library
    code (with init sections etc). Instead be as close as we can
    to "gcc --combine ...".

    Signed-off-by: David Brownell
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/usb/gadget/Makefile | 2 +-
    drivers/usb/gadget/gmidi.c | 15 +++++++++++++++
    2 files changed, 16 insertions(+), 1 deletions(-)

    diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
    index 55f5891..c47204f 100644
    --- a/drivers/usb/gadget/Makefile
    +++ b/drivers/usb/gadget/Makefile
    @@ -27,7 +27,7 @@ C_UTILS = composite.o usbstring.o config.o epautoconf.o
    g_zero-objs := zero.o
    g_ether-objs := ether.o u_ether.o f_subset.o f_ecm.o $(C_UTILS)
    g_serial-objs := serial.o
    -g_midi-objs := gmidi.o usbstring.o config.o epautoconf.o
    +g_midi-objs := gmidi.o
    gadgetfs-objs := inode.o
    g_file_storage-objs := file_storage.o usbstring.o config.o \
    epautoconf.o
    diff --git a/drivers/usb/gadget/gmidi.c b/drivers/usb/gadget/gmidi.c
    index ea8651e..6eee760 100644
    --- a/drivers/usb/gadget/gmidi.c
    +++ b/drivers/usb/gadget/gmidi.c
    @@ -35,6 +35,21 @@

    #include "gadget_chips.h"

    +
    +/*
    + * Kbuild is not very cooperative with respect to linking separately
    + * compiled library objects into one module. So for now we won't use
    + * separate compilation ... ensuring init/exit sections work to shrink
    + * the runtime footprint, and giving us at least some parts of what
    + * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
    + */
    +#include "usbstring.c"
    +#include "config.c"
    +#include "epautoconf.c"
    +
    +/*-------------------------------------------------------------------------*/
    +
    +
    MODULE_AUTHOR("Ben Williamson");
    MODULE_LICENSE("GPL v2");

    --
    1.6.0.2

    --
    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 14/46] device create: ide: convert device_create_drvdata to device_create

    Now that device_create() has been audited, rename things back to the
    original call to be sane.

    Cc: Bartlomiej Zolnierkiewicz
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/ide/ide-probe.c | 4 ++--
    drivers/ide/ide-tape.c | 11 +++++------
    2 files changed, 7 insertions(+), 8 deletions(-)

    diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
    index f27baa5..19f8c77 100644
    --- a/drivers/ide/ide-probe.c
    +++ b/drivers/ide/ide-probe.c
    @@ -657,8 +657,8 @@ static int ide_register_port(ide_hwif_t *hwif)
    goto out;
    }

    - hwif->portdev = device_create_drvdata(ide_port_class, &hwif->gendev,
    - MKDEV(0, 0), hwif, hwif->name);
    + hwif->portdev = device_create(ide_port_class, &hwif->gendev,
    + MKDEV(0, 0), hwif, hwif->name);
    if (IS_ERR(hwif->portdev)) {
    ret = PTR_ERR(hwif->portdev);
    device_unregister(&hwif->gendev);
    diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
    index 25ac60f..d879c77 100644
    --- a/drivers/ide/ide-tape.c
    +++ b/drivers/ide/ide-tape.c
    @@ -2420,12 +2420,11 @@ static int ide_tape_probe(ide_drive_t *drive)

    idetape_setup(drive, tape, minor);

    - device_create_drvdata(idetape_sysfs_class, &drive->gendev,
    - MKDEV(IDETAPE_MAJOR, minor), NULL,
    - "%s", tape->name);
    - device_create_drvdata(idetape_sysfs_class, &drive->gendev,
    - MKDEV(IDETAPE_MAJOR, minor + 128), NULL,
    - "n%s", tape->name);
    + device_create(idetape_sysfs_class, &drive->gendev,
    + MKDEV(IDETAPE_MAJOR, minor), NULL, "%s", tape->name);
    + device_create(idetape_sysfs_class, &drive->gendev,
    + MKDEV(IDETAPE_MAJOR, minor + 128), NULL,
    + "n%s", tape->name);

    g->fops = &idetape_block_ops;
    ide_register_region(g);
    --
    1.6.0.2

    --
    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 32/46] debug: use dev_WARN() rather than WARN_ON() in device_pm_add()

    From: Arjan van de Ven

    device_pm_add() has a WARN_ON that is showing relatively high on
    kerneloops.org, but unfortunately the WARN_ON is less than useful
    in that it doesn't print any information about what device is causing
    the issue.

    This patch fixes this by turning the WARN_ON() into the newly
    introduces dev_WARN() which will print information about the
    device in question.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/base/power/main.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
    index 273a944..b0eb6af 100644
    --- a/drivers/base/power/main.c
    +++ b/drivers/base/power/main.c
    @@ -83,7 +83,7 @@ void device_pm_add(struct device *dev)
    * transition is in progress in order to avoid leaving them
    * unhandled down the road
    */
    - WARN_ON(true);
    + dev_WARN(dev, "Parentless device registered during a PM transaction\n");
    }

    list_add_tail(&dev->power.entry, &dpm_list);
    --
    1.6.0.2

    --
    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 40/46] kobject: Cleanup kobject_rename and !CONFIG_SYSFS

    From: Eric W. Biederman

    It finally dawned on me what the clean fix to sysfs_rename_dir
    calling kobject_set_name is. Move the work into kobject_rename
    where it belongs. The callers serialize us anyway so this is
    safe.

    Signed-off-by: Eric W. Biederman
    Acked-by: Tejun Heo
    Signed-off-by: Greg Kroah-Hartman
    ---
    fs/sysfs/dir.c | 6 +-----
    include/linux/sysfs.h | 4 +---
    lib/kobject.c | 17 +++++++++++++++--
    3 files changed, 17 insertions(+), 10 deletions(-)

    diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
    index c183426..3a05a59 100644
    --- a/fs/sysfs/dir.c
    +++ b/fs/sysfs/dir.c
    @@ -829,16 +829,12 @@ int sysfs_rename_dir(struct kobject * kobj, const char *new_name)
    if (!new_dentry)
    goto out_unlock;

    - /* rename kobject and sysfs_dirent */
    + /* rename sysfs_dirent */
    error = -ENOMEM;
    new_name = dup_name = kstrdup(new_name, GFP_KERNEL);
    if (!new_name)
    goto out_unlock;

    - error = kobject_set_name(kobj, "%s", new_name);
    - if (error)
    - goto out_unlock;
    -
    dup_name = sd->s_name;
    sd->s_name = new_name;

    diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
    index 39924a9..b330e28 100644
    --- a/include/linux/sysfs.h
    +++ b/include/linux/sysfs.h
    @@ -20,8 +20,6 @@
    struct kobject;
    struct module;

    -extern int kobject_set_name(struct kobject *kobj, const char *name, ...)
    - __attribute__((format(printf, 2, 3)));
    /* FIXME
    * The *owner field is no longer used, but leave around
    * until the tree gets cleaned up fully.
    @@ -149,7 +147,7 @@ static inline void sysfs_remove_dir(struct kobject *kobj)

    static inline int sysfs_rename_dir(struct kobject *kobj, const char *new_name)
    {
    - return kobject_set_name(kobj, "%s", new_name);
    + return 0;
    }

    static inline int sysfs_move_dir(struct kobject *kobj,
    diff --git a/lib/kobject.c b/lib/kobject.c
    index ae6bb90..0487d1f 100644
    --- a/lib/kobject.c
    +++ b/lib/kobject.c
    @@ -397,6 +397,7 @@ int kobject_rename(struct kobject *kobj, const char *new_name)
    {
    int error = 0;
    const char *devpath = NULL;
    + const char *dup_name = NULL, *name;
    char *devpath_string = NULL;
    char *envp[2];

    @@ -420,15 +421,27 @@ int kobject_rename(struct kobject *kobj, const char *new_name)
    envp[0] = devpath_string;
    envp[1] = NULL;

    + name = dup_name = kstrdup(new_name, GFP_KERNEL);
    + if (!name) {
    + error = -ENOMEM;
    + goto out;
    + }
    +
    error = sysfs_rename_dir(kobj, new_name);
    + if (error)
    + goto out;
    +
    + /* Install the new kobject name */
    + dup_name = kobj->name;
    + kobj->name = name;

    /* This function is mostly/only used for network interface.
    * Some hotplug package track interfaces by their name and
    * therefore want to know when the name is changed by the user. */
    - if (!error)
    - kobject_uevent_env(kobj, KOBJ_MOVE, envp);
    + kobject_uevent_env(kobj, KOBJ_MOVE, envp);

    out:
    + kfree(dup_name);
    kfree(devpath_string);
    kfree(devpath);
    kobject_put(kobj);
    --
    1.6.0.2

    --
    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 24/46] driver core: make struct platform_pm_ops static

    From: Adrian Bunk

    This patch makes the needlessly global struct platform_pm_ops static.

    Signed-off-by: Adrian Bunk
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/base/platform.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/drivers/base/platform.c b/drivers/base/platform.c
    index 3f94039..e621dad 100644
    --- a/drivers/base/platform.c
    +++ b/drivers/base/platform.c
    @@ -862,7 +862,7 @@ static int platform_pm_restore_noirq(struct device *dev)

    #endif /* !CONFIG_HIBERNATION */

    -struct pm_ext_ops platform_pm_ops = {
    +static struct pm_ext_ops platform_pm_ops = {
    .base = {
    .prepare = platform_pm_prepare,
    .complete = platform_pm_complete,
    --
    1.6.0.2

    --
    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 31/46] debug: Introduce a dev_WARN() function

    From: Arjan van de Ven

    in the line of dev_printk(), this patch introduces a dev_WARN() function,
    that takes a struct device and then a printk format/args set of arguments.
    Unlike dev_printk(), the effect is that of WARN() in that a full warning
    message (including filename/line, module list, versions and a backtrace)
    is printed in addition to the device name and the arguments.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Greg Kroah-Hartman
    ---
    include/linux/device.h | 8 ++++++++
    1 files changed, 8 insertions(+), 0 deletions(-)

    diff --git a/include/linux/device.h b/include/linux/device.h
    index fb03446..ec90e79 100644
    --- a/include/linux/device.h
    +++ b/include/linux/device.h
    @@ -570,6 +570,14 @@ extern const char *dev_driver_string(const struct device *dev);
    ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; })
    #endif

    +/*
    + * dev_WARN() acts like dev_printk(), but with the key difference
    + * of using a WARN/WARN_ON to get the message out, including the
    + * file/line information and a backtrace.
    + */
    +#define dev_WARN(dev, format, arg...) \
    + WARN(1, "Device: %s\n" format, dev_driver_string(dev), ## arg);
    +
    /* Create alias, so I can be autoloaded. */
    #define MODULE_ALIAS_CHARDEV(major,minor) \
    MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor))
    --
    1.6.0.2

    --
    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 22/46] usb gadget: link fixes for network gadget

    From: David Brownell

    Change how the Ethernet/RNDIS gadget driver builds: don't
    use separate compilation, since it works poorly when key
    parts are library code (with init sections etc). Instead
    be as close as we can to "gcc --combine ...".

    This is a bit more complicated than most of the others
    because it had to resolve a few symbol collisions.

    Signed-off-by: David Brownell
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/usb/gadget/Makefile | 8 +---
    drivers/usb/gadget/ether.c | 28 +++++++++-
    drivers/usb/gadget/f_ecm.c | 108 +++++++++++++++++++-------------------
    drivers/usb/gadget/f_subset.c | 44 ++++++++--------
    drivers/usb/gadget/rndis.c | 115 +++++++++++++++++++---------------------
    5 files changed, 158 insertions(+), 145 deletions(-)

    diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
    index bfa0229..2267fa0 100644
    --- a/drivers/usb/gadget/Makefile
    +++ b/drivers/usb/gadget/Makefile
    @@ -22,10 +22,8 @@ obj-$(CONFIG_USB_M66592) += m66592-udc.o
    #
    # USB gadget drivers
    #
    -C_UTILS = composite.o usbstring.o config.o epautoconf.o
    -
    g_zero-objs := zero.o
    -g_ether-objs := ether.o u_ether.o f_subset.o f_ecm.o $(C_UTILS)
    +g_ether-objs := ether.o
    g_serial-objs := serial.o
    g_midi-objs := gmidi.o
    gadgetfs-objs := inode.o
    @@ -33,10 +31,6 @@ g_file_storage-objs := file_storage.o
    g_printer-objs := printer.o
    g_cdc-objs := cdc2.o

    -ifeq ($(CONFIG_USB_ETH_RNDIS),y)
    - g_ether-objs += f_rndis.o rndis.o
    -endif
    -
    obj-$(CONFIG_USB_ZERO) += g_zero.o
    obj-$(CONFIG_USB_ETH) += g_ether.o
    obj-$(CONFIG_USB_GADGETFS) += gadgetfs.o
    diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
    index bcac2e6..944c8e8 100644
    --- a/drivers/usb/gadget/ether.c
    +++ b/drivers/usb/gadget/ether.c
    @@ -96,6 +96,28 @@ static inline bool has_rndis(void)

    /*-------------------------------------------------------------------------*/

    +/*
    + * Kbuild is not very cooperative with respect to linking separately
    + * compiled library objects into one module. So for now we won't use
    + * separate compilation ... ensuring init/exit sections work to shrink
    + * the runtime footprint, and giving us at least some parts of what
    + * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
    + */
    +#include "composite.c"
    +#include "usbstring.c"
    +#include "config.c"
    +#include "epautoconf.c"
    +
    +#include "f_ecm.c"
    +#include "f_subset.c"
    +#ifdef CONFIG_USB_ETH_RNDIS
    +#include "f_rndis.c"
    +#include "rndis.c"
    +#endif
    +#include "u_ether.c"
    +
    +/*-------------------------------------------------------------------------*/
    +
    /* DO NOT REUSE THESE IDs with a protocol-incompatible driver!! Ever!!
    * Instead: allocate your own, using normal USB-IF procedures.
    */
    @@ -293,7 +315,8 @@ static int __init eth_bind(struct usb_composite_dev *cdev)
    * but if the controller isn't recognized at all then
    * that assumption is a bit more likely to be wrong.
    */
    - WARNING(cdev, "controller '%s' not recognized; trying %s\n",
    + dev_warn(&gadget->dev,
    + "controller '%s' not recognized; trying %s\n",
    gadget->name,
    eth_config_driver.label);
    device_desc.bcdDevice =
    @@ -332,7 +355,8 @@ static int __init eth_bind(struct usb_composite_dev *cdev)
    if (status < 0)
    goto fail;

    - INFO(cdev, "%s, version: " DRIVER_VERSION "\n", DRIVER_DESC);
    + dev_info(&gadget->dev, "%s, version: " DRIVER_VERSION "\n",
    + DRIVER_DESC);

    return 0;

    diff --git a/drivers/usb/gadget/f_ecm.c b/drivers/usb/gadget/f_ecm.c
    index a2b5c09..4ae5799 100644
    --- a/drivers/usb/gadget/f_ecm.c
    +++ b/drivers/usb/gadget/f_ecm.c
    @@ -83,7 +83,7 @@ static inline struct f_ecm *func_to_ecm(struct usb_function *f)
    }

    /* peak (theoretical) bulk transfer rate in bits-per-second */
    -static inline unsigned bitrate(struct usb_gadget *g)
    +static inline unsigned ecm_bitrate(struct usb_gadget *g)
    {
    if (gadget_is_dualspeed(g) && g->speed == USB_SPEED_HIGH)
    return 13 * 512 * 8 * 1000 * 8;
    @@ -107,7 +107,7 @@ static inline unsigned bitrate(struct usb_gadget *g)
    */

    #define LOG2_STATUS_INTERVAL_MSEC 5 /* 1 << 5 == 32 msec */
    -#define STATUS_BYTECOUNT 16 /* 8 byte header + data */
    +#define ECM_STATUS_BYTECOUNT 16 /* 8 byte header + data */


    /* interface descriptor: */
    @@ -125,8 +125,8 @@ static struct usb_interface_descriptor ecm_control_intf __initdata = {
    /* .iInterface = DYNAMIC */
    };

    -static struct usb_cdc_header_desc header_desc __initdata = {
    - .bLength = sizeof header_desc,
    +static struct usb_cdc_header_desc ecm_header_desc __initdata = {
    + .bLength = sizeof ecm_header_desc,
    .bDescriptorType = USB_DT_CS_INTERFACE,
    .bDescriptorSubType = USB_CDC_HEADER_TYPE,

    @@ -141,8 +141,8 @@ static struct usb_cdc_union_desc ecm_union_desc __initdata = {
    /* .bSlaveInterface0 = DYNAMIC */
    };

    -static struct usb_cdc_ether_desc ether_desc __initdata = {
    - .bLength = sizeof ether_desc,
    +static struct usb_cdc_ether_desc ecm_desc __initdata = {
    + .bLength = sizeof ecm_desc,
    .bDescriptorType = USB_DT_CS_INTERFACE,
    .bDescriptorSubType = USB_CDC_ETHERNET_TYPE,

    @@ -186,17 +186,17 @@ static struct usb_interface_descriptor ecm_data_intf __initdata = {

    /* full speed support: */

    -static struct usb_endpoint_descriptor fs_notify_desc __initdata = {
    +static struct usb_endpoint_descriptor fs_ecm_notify_desc __initdata = {
    .bLength = USB_DT_ENDPOINT_SIZE,
    .bDescriptorType = USB_DT_ENDPOINT,

    .bEndpointAddress = USB_DIR_IN,
    .bmAttributes = USB_ENDPOINT_XFER_INT,
    - .wMaxPacketSize = __constant_cpu_to_le16(STATUS_BYTECOUNT),
    + .wMaxPacketSize = __constant_cpu_to_le16(ECM_STATUS_BYTECOUNT),
    .bInterval = 1 << LOG2_STATUS_INTERVAL_MSEC,
    };

    -static struct usb_endpoint_descriptor fs_in_desc __initdata = {
    +static struct usb_endpoint_descriptor fs_ecm_in_desc __initdata = {
    .bLength = USB_DT_ENDPOINT_SIZE,
    .bDescriptorType = USB_DT_ENDPOINT,

    @@ -204,7 +204,7 @@ static struct usb_endpoint_descriptor fs_in_desc __initdata = {
    .bmAttributes = USB_ENDPOINT_XFER_BULK,
    };

    -static struct usb_endpoint_descriptor fs_out_desc __initdata = {
    +static struct usb_endpoint_descriptor fs_ecm_out_desc __initdata = {
    .bLength = USB_DT_ENDPOINT_SIZE,
    .bDescriptorType = USB_DT_ENDPOINT,

    @@ -212,34 +212,34 @@ static struct usb_endpoint_descriptor fs_out_desc __initdata = {
    .bmAttributes = USB_ENDPOINT_XFER_BULK,
    };

    -static struct usb_descriptor_header *eth_fs_function[] __initdata = {
    +static struct usb_descriptor_header *ecm_fs_function[] __initdata = {
    /* CDC ECM control descriptors */
    (struct usb_descriptor_header *) &ecm_control_intf,
    - (struct usb_descriptor_header *) &header_desc,
    + (struct usb_descriptor_header *) &ecm_header_desc,
    (struct usb_descriptor_header *) &ecm_union_desc,
    - (struct usb_descriptor_header *) &ether_desc,
    + (struct usb_descriptor_header *) &ecm_desc,
    /* NOTE: status endpoint might need to be removed */
    - (struct usb_descriptor_header *) &fs_notify_desc,
    + (struct usb_descriptor_header *) &fs_ecm_notify_desc,
    /* data interface, altsettings 0 and 1 */
    (struct usb_descriptor_header *) &ecm_data_nop_intf,
    (struct usb_descriptor_header *) &ecm_data_intf,
    - (struct usb_descriptor_header *) &fs_in_desc,
    - (struct usb_descriptor_header *) &fs_out_desc,
    + (struct usb_descriptor_header *) &fs_ecm_in_desc,
    + (struct usb_descriptor_header *) &fs_ecm_out_desc,
    NULL,
    };

    /* high speed support: */

    -static struct usb_endpoint_descriptor hs_notify_desc __initdata = {
    +static struct usb_endpoint_descriptor hs_ecm_notify_desc __initdata = {
    .bLength = USB_DT_ENDPOINT_SIZE,
    .bDescriptorType = USB_DT_ENDPOINT,

    .bEndpointAddress = USB_DIR_IN,
    .bmAttributes = USB_ENDPOINT_XFER_INT,
    - .wMaxPacketSize = __constant_cpu_to_le16(STATUS_BYTECOUNT),
    + .wMaxPacketSize = __constant_cpu_to_le16(ECM_STATUS_BYTECOUNT),
    .bInterval = LOG2_STATUS_INTERVAL_MSEC + 4,
    };
    -static struct usb_endpoint_descriptor hs_in_desc __initdata = {
    +static struct usb_endpoint_descriptor hs_ecm_in_desc __initdata = {
    .bLength = USB_DT_ENDPOINT_SIZE,
    .bDescriptorType = USB_DT_ENDPOINT,

    @@ -248,7 +248,7 @@ static struct usb_endpoint_descriptor hs_in_desc __initdata = {
    .wMaxPacketSize = __constant_cpu_to_le16(512),
    };

    -static struct usb_endpoint_descriptor hs_out_desc __initdata = {
    +static struct usb_endpoint_descriptor hs_ecm_out_desc __initdata = {
    .bLength = USB_DT_ENDPOINT_SIZE,
    .bDescriptorType = USB_DT_ENDPOINT,

    @@ -257,19 +257,19 @@ static struct usb_endpoint_descriptor hs_out_desc __initdata = {
    .wMaxPacketSize = __constant_cpu_to_le16(512),
    };

    -static struct usb_descriptor_header *eth_hs_function[] __initdata = {
    +static struct usb_descriptor_header *ecm_hs_function[] __initdata = {
    /* CDC ECM control descriptors */
    (struct usb_descriptor_header *) &ecm_control_intf,
    - (struct usb_descriptor_header *) &header_desc,
    + (struct usb_descriptor_header *) &ecm_header_desc,
    (struct usb_descriptor_header *) &ecm_union_desc,
    - (struct usb_descriptor_header *) &ether_desc,
    + (struct usb_descriptor_header *) &ecm_desc,
    /* NOTE: status endpoint might need to be removed */
    - (struct usb_descriptor_header *) &hs_notify_desc,
    + (struct usb_descriptor_header *) &hs_ecm_notify_desc,
    /* data interface, altsettings 0 and 1 */
    (struct usb_descriptor_header *) &ecm_data_nop_intf,
    (struct usb_descriptor_header *) &ecm_data_intf,
    - (struct usb_descriptor_header *) &hs_in_desc,
    - (struct usb_descriptor_header *) &hs_out_desc,
    + (struct usb_descriptor_header *) &hs_ecm_in_desc,
    + (struct usb_descriptor_header *) &hs_ecm_out_desc,
    NULL,
    };

    @@ -329,14 +329,14 @@ static void ecm_do_notify(struct f_ecm *ecm)
    event->bNotificationType = USB_CDC_NOTIFY_SPEED_CHANGE;
    event->wValue = cpu_to_le16(0);
    event->wLength = cpu_to_le16(8);
    - req->length = STATUS_BYTECOUNT;
    + req->length = ECM_STATUS_BYTECOUNT;

    /* SPEED_CHANGE data is up/down speeds in bits/sec */
    data = req->buf + sizeof *event;
    - data[0] = cpu_to_le32(bitrate(cdev->gadget));
    + data[0] = cpu_to_le32(ecm_bitrate(cdev->gadget));
    data[1] = data[0];

    - DBG(cdev, "notify speed %d\n", bitrate(cdev->gadget));
    + DBG(cdev, "notify speed %d\n", ecm_bitrate(cdev->gadget));
    ecm->notify_state = ECM_NOTIFY_NONE;
    break;
    }
    @@ -628,13 +628,13 @@ ecm_bind(struct usb_configuration *c, struct usb_function *f)
    status = -ENODEV;

    /* allocate instance-specific endpoints */
    - ep = usb_ep_autoconfig(cdev->gadget, &fs_in_desc);
    + ep = usb_ep_autoconfig(cdev->gadget, &fs_ecm_in_desc);
    if (!ep)
    goto fail;
    ecm->port.in_ep = ep;
    ep->driver_data = cdev; /* claim */

    - ep = usb_ep_autoconfig(cdev->gadget, &fs_out_desc);
    + ep = usb_ep_autoconfig(cdev->gadget, &fs_ecm_out_desc);
    if (!ep)
    goto fail;
    ecm->port.out_ep = ep;
    @@ -644,7 +644,7 @@ ecm_bind(struct usb_configuration *c, struct usb_function *f)
    * don't treat it that way. It's simpler, and some newer CDC
    * profiles (wireless handsets) no longer treat it as optional.
    */
    - ep = usb_ep_autoconfig(cdev->gadget, &fs_notify_desc);
    + ep = usb_ep_autoconfig(cdev->gadget, &fs_ecm_notify_desc);
    if (!ep)
    goto fail;
    ecm->notify = ep;
    @@ -656,47 +656,47 @@ ecm_bind(struct usb_configuration *c, struct usb_function *f)
    ecm->notify_req = usb_ep_alloc_request(ep, GFP_KERNEL);
    if (!ecm->notify_req)
    goto fail;
    - ecm->notify_req->buf = kmalloc(STATUS_BYTECOUNT, GFP_KERNEL);
    + ecm->notify_req->buf = kmalloc(ECM_STATUS_BYTECOUNT, GFP_KERNEL);
    if (!ecm->notify_req->buf)
    goto fail;
    ecm->notify_req->context = ecm;
    ecm->notify_req->complete = ecm_notify_complete;

    /* copy descriptors, and track endpoint copies */
    - f->descriptors = usb_copy_descriptors(eth_fs_function);
    + f->descriptors = usb_copy_descriptors(ecm_fs_function);
    if (!f->descriptors)
    goto fail;

    - ecm->fs.in = usb_find_endpoint(eth_fs_function,
    - f->descriptors, &fs_in_desc);
    - ecm->fs.out = usb_find_endpoint(eth_fs_function,
    - f->descriptors, &fs_out_desc);
    - ecm->fs.notify = usb_find_endpoint(eth_fs_function,
    - f->descriptors, &fs_notify_desc);
    + ecm->fs.in = usb_find_endpoint(ecm_fs_function,
    + f->descriptors, &fs_ecm_in_desc);
    + ecm->fs.out = usb_find_endpoint(ecm_fs_function,
    + f->descriptors, &fs_ecm_out_desc);
    + ecm->fs.notify = usb_find_endpoint(ecm_fs_function,
    + f->descriptors, &fs_ecm_notify_desc);

    /* support all relevant hardware speeds... we expect that when
    * hardware is dual speed, all bulk-capable endpoints work at
    * both speeds
    */
    if (gadget_is_dualspeed(c->cdev->gadget)) {
    - hs_in_desc.bEndpointAddress =
    - fs_in_desc.bEndpointAddress;
    - hs_out_desc.bEndpointAddress =
    - fs_out_desc.bEndpointAddress;
    - hs_notify_desc.bEndpointAddress =
    - fs_notify_desc.bEndpointAddress;
    + hs_ecm_in_desc.bEndpointAddress =
    + fs_ecm_in_desc.bEndpointAddress;
    + hs_ecm_out_desc.bEndpointAddress =
    + fs_ecm_out_desc.bEndpointAddress;
    + hs_ecm_notify_desc.bEndpointAddress =
    + fs_ecm_notify_desc.bEndpointAddress;

    /* copy descriptors, and track endpoint copies */
    - f->hs_descriptors = usb_copy_descriptors(eth_hs_function);
    + f->hs_descriptors = usb_copy_descriptors(ecm_hs_function);
    if (!f->hs_descriptors)
    goto fail;

    - ecm->hs.in = usb_find_endpoint(eth_hs_function,
    - f->hs_descriptors, &hs_in_desc);
    - ecm->hs.out = usb_find_endpoint(eth_hs_function,
    - f->hs_descriptors, &hs_out_desc);
    - ecm->hs.notify = usb_find_endpoint(eth_hs_function,
    - f->hs_descriptors, &hs_notify_desc);
    + ecm->hs.in = usb_find_endpoint(ecm_hs_function,
    + f->hs_descriptors, &hs_ecm_in_desc);
    + ecm->hs.out = usb_find_endpoint(ecm_hs_function,
    + f->hs_descriptors, &hs_ecm_out_desc);
    + ecm->hs.notify = usb_find_endpoint(ecm_hs_function,
    + f->hs_descriptors, &hs_ecm_notify_desc);
    }

    /* NOTE: all that is done without knowing or caring about
    @@ -795,7 +795,7 @@ int __init ecm_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN])
    if (status < 0)
    return status;
    ecm_string_defs[1].id = status;
    - ether_desc.iMACAddress = status;
    + ecm_desc.iMACAddress = status;
    }

    /* allocate and initialize one new instance */
    diff --git a/drivers/usb/gadget/f_subset.c b/drivers/usb/gadget/f_subset.c
    index acb8d23..fe18328 100644
    --- a/drivers/usb/gadget/f_subset.c
    +++ b/drivers/usb/gadget/f_subset.c
    @@ -103,8 +103,8 @@ static struct usb_interface_descriptor subset_data_intf __initdata = {
    /* .iInterface = DYNAMIC */
    };

    -static struct usb_cdc_header_desc header_desc __initdata = {
    - .bLength = sizeof header_desc,
    +static struct usb_cdc_header_desc mdlm_header_desc __initdata = {
    + .bLength = sizeof mdlm_header_desc,
    .bDescriptorType = USB_DT_CS_INTERFACE,
    .bDescriptorSubType = USB_CDC_HEADER_TYPE,

    @@ -152,7 +152,7 @@ static struct usb_cdc_ether_desc ether_desc __initdata = {

    /* full speed support: */

    -static struct usb_endpoint_descriptor fs_in_desc __initdata = {
    +static struct usb_endpoint_descriptor fs_subset_in_desc __initdata = {
    .bLength = USB_DT_ENDPOINT_SIZE,
    .bDescriptorType = USB_DT_ENDPOINT,

    @@ -160,7 +160,7 @@ static struct usb_endpoint_descriptor fs_in_desc __initdata = {
    .bmAttributes = USB_ENDPOINT_XFER_BULK,
    };

    -static struct usb_endpoint_descriptor fs_out_desc __initdata = {
    +static struct usb_endpoint_descriptor fs_subset_out_desc __initdata = {
    .bLength = USB_DT_ENDPOINT_SIZE,
    .bDescriptorType = USB_DT_ENDPOINT,

    @@ -170,18 +170,18 @@ static struct usb_endpoint_descriptor fs_out_desc __initdata = {

    static struct usb_descriptor_header *fs_eth_function[] __initdata = {
    (struct usb_descriptor_header *) &subset_data_intf,
    - (struct usb_descriptor_header *) &header_desc,
    + (struct usb_descriptor_header *) &mdlm_header_desc,
    (struct usb_descriptor_header *) &mdlm_desc,
    (struct usb_descriptor_header *) &mdlm_detail_desc,
    (struct usb_descriptor_header *) &ether_desc,
    - (struct usb_descriptor_header *) &fs_in_desc,
    - (struct usb_descriptor_header *) &fs_out_desc,
    + (struct usb_descriptor_header *) &fs_subset_in_desc,
    + (struct usb_descriptor_header *) &fs_subset_out_desc,
    NULL,
    };

    /* high speed support: */

    -static struct usb_endpoint_descriptor hs_in_desc __initdata = {
    +static struct usb_endpoint_descriptor hs_subset_in_desc __initdata = {
    .bLength = USB_DT_ENDPOINT_SIZE,
    .bDescriptorType = USB_DT_ENDPOINT,

    @@ -189,7 +189,7 @@ static struct usb_endpoint_descriptor hs_in_desc __initdata = {
    .wMaxPacketSize = __constant_cpu_to_le16(512),
    };

    -static struct usb_endpoint_descriptor hs_out_desc __initdata = {
    +static struct usb_endpoint_descriptor hs_subset_out_desc __initdata = {
    .bLength = USB_DT_ENDPOINT_SIZE,
    .bDescriptorType = USB_DT_ENDPOINT,

    @@ -199,12 +199,12 @@ static struct usb_endpoint_descriptor hs_out_desc __initdata = {

    static struct usb_descriptor_header *hs_eth_function[] __initdata = {
    (struct usb_descriptor_header *) &subset_data_intf,
    - (struct usb_descriptor_header *) &header_desc,
    + (struct usb_descriptor_header *) &mdlm_header_desc,
    (struct usb_descriptor_header *) &mdlm_desc,
    (struct usb_descriptor_header *) &mdlm_detail_desc,
    (struct usb_descriptor_header *) &ether_desc,
    - (struct usb_descriptor_header *) &hs_in_desc,
    - (struct usb_descriptor_header *) &hs_out_desc,
    + (struct usb_descriptor_header *) &hs_subset_in_desc,
    + (struct usb_descriptor_header *) &hs_subset_out_desc,
    NULL,
    };

    @@ -281,13 +281,13 @@ geth_bind(struct usb_configuration *c, struct usb_function *f)
    status = -ENODEV;

    /* allocate instance-specific endpoints */
    - ep = usb_ep_autoconfig(cdev->gadget, &fs_in_desc);
    + ep = usb_ep_autoconfig(cdev->gadget, &fs_subset_in_desc);
    if (!ep)
    goto fail;
    geth->port.in_ep = ep;
    ep->driver_data = cdev; /* claim */

    - ep = usb_ep_autoconfig(cdev->gadget, &fs_out_desc);
    + ep = usb_ep_autoconfig(cdev->gadget, &fs_subset_out_desc);
    if (!ep)
    goto fail;
    geth->port.out_ep = ep;
    @@ -297,9 +297,9 @@ geth_bind(struct usb_configuration *c, struct usb_function *f)
    f->descriptors = usb_copy_descriptors(fs_eth_function);

    geth->fs.in = usb_find_endpoint(fs_eth_function,
    - f->descriptors, &fs_in_desc);
    + f->descriptors, &fs_subset_in_desc);
    geth->fs.out = usb_find_endpoint(fs_eth_function,
    - f->descriptors, &fs_out_desc);
    + f->descriptors, &fs_subset_out_desc);


    /* support all relevant hardware speeds... we expect that when
    @@ -307,18 +307,18 @@ geth_bind(struct usb_configuration *c, struct usb_function *f)
    * both speeds
    */
    if (gadget_is_dualspeed(c->cdev->gadget)) {
    - hs_in_desc.bEndpointAddress =
    - fs_in_desc.bEndpointAddress;
    - hs_out_desc.bEndpointAddress =
    - fs_out_desc.bEndpointAddress;
    + hs_subset_in_desc.bEndpointAddress =
    + fs_subset_in_desc.bEndpointAddress;
    + hs_subset_out_desc.bEndpointAddress =
    + fs_subset_out_desc.bEndpointAddress;

    /* copy descriptors, and track endpoint copies */
    f->hs_descriptors = usb_copy_descriptors(hs_eth_function);

    geth->hs.in = usb_find_endpoint(hs_eth_function,
    - f->hs_descriptors, &hs_in_desc);
    + f->hs_descriptors, &hs_subset_in_desc);
    geth->hs.out = usb_find_endpoint(hs_eth_function,
    - f->hs_descriptors, &hs_out_desc);
    + f->hs_descriptors, &hs_subset_out_desc);
    }

    /* NOTE: all that is done without knowing or caring about
    diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
    index 7228e85..8c26f5e 100644
    --- a/drivers/usb/gadget/rndis.c
    +++ b/drivers/usb/gadget/rndis.c
    @@ -57,11 +57,6 @@ MODULE_PARM_DESC (rndis_debug, "enable debugging");
    #define rndis_debug 0
    #endif

    -#define DBG(str,args...) do { \
    - if (rndis_debug) \
    - pr_debug(str , ## args); \
    - } while (0)
    -
    #define RNDIS_MAX_CONFIGS 1


    @@ -183,9 +178,9 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
    if (!resp) return -ENOMEM;

    if (buf_len && rndis_debug > 1) {
    - DBG("query OID %08x value, len %d:\n", OID, buf_len);
    + pr_debug("query OID %08x value, len %d:\n", OID, buf_len);
    for (i = 0; i < buf_len; i += 16) {
    - DBG("%03d: %08x %08x %08x %08x\n", i,
    + pr_debug("%03d: %08x %08x %08x %08x\n", i,
    get_unaligned_le32(&buf[i]),
    get_unaligned_le32(&buf[i + 4]),
    get_unaligned_le32(&buf[i + 8]),
    @@ -209,7 +204,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,

    /* mandatory */
    case OID_GEN_SUPPORTED_LIST:
    - DBG("%s: OID_GEN_SUPPORTED_LIST\n", __func__);
    + pr_debug("%s: OID_GEN_SUPPORTED_LIST\n", __func__);
    length = sizeof (oid_supported_list);
    count = length / sizeof (u32);
    for (i = 0; i < count; i++)
    @@ -219,7 +214,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,

    /* mandatory */
    case OID_GEN_HARDWARE_STATUS:
    - DBG("%s: OID_GEN_HARDWARE_STATUS\n", __func__);
    + pr_debug("%s: OID_GEN_HARDWARE_STATUS\n", __func__);
    /* Bogus question!
    * Hardware must be ready to receive high level protocols.
    * BTW:
    @@ -232,14 +227,14 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,

    /* mandatory */
    case OID_GEN_MEDIA_SUPPORTED:
    - DBG("%s: OID_GEN_MEDIA_SUPPORTED\n", __func__);
    + pr_debug("%s: OID_GEN_MEDIA_SUPPORTED\n", __func__);
    *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr].medium);
    retval = 0;
    break;

    /* mandatory */
    case OID_GEN_MEDIA_IN_USE:
    - DBG("%s: OID_GEN_MEDIA_IN_USE\n", __func__);
    + pr_debug("%s: OID_GEN_MEDIA_IN_USE\n", __func__);
    /* one medium, one transport... (maybe you do it better) */
    *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr].medium);
    retval = 0;
    @@ -247,7 +242,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,

    /* mandatory */
    case OID_GEN_MAXIMUM_FRAME_SIZE:
    - DBG("%s: OID_GEN_MAXIMUM_FRAME_SIZE\n", __func__);
    + pr_debug("%s: OID_GEN_MAXIMUM_FRAME_SIZE\n", __func__);
    if (rndis_per_dev_params [configNr].dev) {
    *outbuf = cpu_to_le32 (
    rndis_per_dev_params [configNr].dev->mtu);
    @@ -258,7 +253,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
    /* mandatory */
    case OID_GEN_LINK_SPEED:
    if (rndis_debug > 1)
    - DBG("%s: OID_GEN_LINK_SPEED\n", __func__);
    + pr_debug("%s: OID_GEN_LINK_SPEED\n", __func__);
    if (rndis_per_dev_params [configNr].media_state
    == NDIS_MEDIA_STATE_DISCONNECTED)
    *outbuf = __constant_cpu_to_le32 (0);
    @@ -270,7 +265,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,

    /* mandatory */
    case OID_GEN_TRANSMIT_BLOCK_SIZE:
    - DBG("%s: OID_GEN_TRANSMIT_BLOCK_SIZE\n", __func__);
    + pr_debug("%s: OID_GEN_TRANSMIT_BLOCK_SIZE\n", __func__);
    if (rndis_per_dev_params [configNr].dev) {
    *outbuf = cpu_to_le32 (
    rndis_per_dev_params [configNr].dev->mtu);
    @@ -280,7 +275,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,

    /* mandatory */
    case OID_GEN_RECEIVE_BLOCK_SIZE:
    - DBG("%s: OID_GEN_RECEIVE_BLOCK_SIZE\n", __func__);
    + pr_debug("%s: OID_GEN_RECEIVE_BLOCK_SIZE\n", __func__);
    if (rndis_per_dev_params [configNr].dev) {
    *outbuf = cpu_to_le32 (
    rndis_per_dev_params [configNr].dev->mtu);
    @@ -290,7 +285,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,

    /* mandatory */
    case OID_GEN_VENDOR_ID:
    - DBG("%s: OID_GEN_VENDOR_ID\n", __func__);
    + pr_debug("%s: OID_GEN_VENDOR_ID\n", __func__);
    *outbuf = cpu_to_le32 (
    rndis_per_dev_params [configNr].vendorID);
    retval = 0;
    @@ -298,7 +293,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,

    /* mandatory */
    case OID_GEN_VENDOR_DESCRIPTION:
    - DBG("%s: OID_GEN_VENDOR_DESCRIPTION\n", __func__);
    + pr_debug("%s: OID_GEN_VENDOR_DESCRIPTION\n", __func__);
    length = strlen (rndis_per_dev_params [configNr].vendorDescr);
    memcpy (outbuf,
    rndis_per_dev_params [configNr].vendorDescr, length);
    @@ -306,7 +301,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
    break;

    case OID_GEN_VENDOR_DRIVER_VERSION:
    - DBG("%s: OID_GEN_VENDOR_DRIVER_VERSION\n", __func__);
    + pr_debug("%s: OID_GEN_VENDOR_DRIVER_VERSION\n", __func__);
    /* Created as LE */
    *outbuf = rndis_driver_version;
    retval = 0;
    @@ -314,14 +309,14 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,

    /* mandatory */
    case OID_GEN_CURRENT_PACKET_FILTER:
    - DBG("%s: OID_GEN_CURRENT_PACKET_FILTER\n", __func__);
    + pr_debug("%s: OID_GEN_CURRENT_PACKET_FILTER\n", __func__);
    *outbuf = cpu_to_le32 (*rndis_per_dev_params[configNr].filter);
    retval = 0;
    break;

    /* mandatory */
    case OID_GEN_MAXIMUM_TOTAL_SIZE:
    - DBG("%s: OID_GEN_MAXIMUM_TOTAL_SIZE\n", __func__);
    + pr_debug("%s: OID_GEN_MAXIMUM_TOTAL_SIZE\n", __func__);
    *outbuf = __constant_cpu_to_le32(RNDIS_MAX_TOTAL_SIZE);
    retval = 0;
    break;
    @@ -329,14 +324,14 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
    /* mandatory */
    case OID_GEN_MEDIA_CONNECT_STATUS:
    if (rndis_debug > 1)
    - DBG("%s: OID_GEN_MEDIA_CONNECT_STATUS\n", __func__);
    + pr_debug("%s: OID_GEN_MEDIA_CONNECT_STATUS\n", __func__);
    *outbuf = cpu_to_le32 (rndis_per_dev_params [configNr]
    .media_state);
    retval = 0;
    break;

    case OID_GEN_PHYSICAL_MEDIUM:
    - DBG("%s: OID_GEN_PHYSICAL_MEDIUM\n", __func__);
    + pr_debug("%s: OID_GEN_PHYSICAL_MEDIUM\n", __func__);
    *outbuf = __constant_cpu_to_le32 (0);
    retval = 0;
    break;
    @@ -346,7 +341,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
    * versions emit undefined RNDIS messages. DOCUMENT ALL THESE!
    */
    case OID_GEN_MAC_OPTIONS: /* from WinME */
    - DBG("%s: OID_GEN_MAC_OPTIONS\n", __func__);
    + pr_debug("%s: OID_GEN_MAC_OPTIONS\n", __func__);
    *outbuf = __constant_cpu_to_le32(
    NDIS_MAC_OPTION_RECEIVE_SERIALIZED
    | NDIS_MAC_OPTION_FULL_DUPLEX);
    @@ -358,7 +353,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
    /* mandatory */
    case OID_GEN_XMIT_OK:
    if (rndis_debug > 1)
    - DBG("%s: OID_GEN_XMIT_OK\n", __func__);
    + pr_debug("%s: OID_GEN_XMIT_OK\n", __func__);
    if (stats) {
    *outbuf = cpu_to_le32(stats->tx_packets
    - stats->tx_errors - stats->tx_dropped);
    @@ -369,7 +364,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
    /* mandatory */
    case OID_GEN_RCV_OK:
    if (rndis_debug > 1)
    - DBG("%s: OID_GEN_RCV_OK\n", __func__);
    + pr_debug("%s: OID_GEN_RCV_OK\n", __func__);
    if (stats) {
    *outbuf = cpu_to_le32(stats->rx_packets
    - stats->rx_errors - stats->rx_dropped);
    @@ -380,7 +375,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
    /* mandatory */
    case OID_GEN_XMIT_ERROR:
    if (rndis_debug > 1)
    - DBG("%s: OID_GEN_XMIT_ERROR\n", __func__);
    + pr_debug("%s: OID_GEN_XMIT_ERROR\n", __func__);
    if (stats) {
    *outbuf = cpu_to_le32(stats->tx_errors);
    retval = 0;
    @@ -390,7 +385,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
    /* mandatory */
    case OID_GEN_RCV_ERROR:
    if (rndis_debug > 1)
    - DBG("%s: OID_GEN_RCV_ERROR\n", __func__);
    + pr_debug("%s: OID_GEN_RCV_ERROR\n", __func__);
    if (stats) {
    *outbuf = cpu_to_le32(stats->rx_errors);
    retval = 0;
    @@ -399,7 +394,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,

    /* mandatory */
    case OID_GEN_RCV_NO_BUFFER:
    - DBG("%s: OID_GEN_RCV_NO_BUFFER\n", __func__);
    + pr_debug("%s: OID_GEN_RCV_NO_BUFFER\n", __func__);
    if (stats) {
    *outbuf = cpu_to_le32(stats->rx_dropped);
    retval = 0;
    @@ -410,7 +405,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,

    /* mandatory */
    case OID_802_3_PERMANENT_ADDRESS:
    - DBG("%s: OID_802_3_PERMANENT_ADDRESS\n", __func__);
    + pr_debug("%s: OID_802_3_PERMANENT_ADDRESS\n", __func__);
    if (rndis_per_dev_params [configNr].dev) {
    length = ETH_ALEN;
    memcpy (outbuf,
    @@ -422,7 +417,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,

    /* mandatory */
    case OID_802_3_CURRENT_ADDRESS:
    - DBG("%s: OID_802_3_CURRENT_ADDRESS\n", __func__);
    + pr_debug("%s: OID_802_3_CURRENT_ADDRESS\n", __func__);
    if (rndis_per_dev_params [configNr].dev) {
    length = ETH_ALEN;
    memcpy (outbuf,
    @@ -434,7 +429,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,

    /* mandatory */
    case OID_802_3_MULTICAST_LIST:
    - DBG("%s: OID_802_3_MULTICAST_LIST\n", __func__);
    + pr_debug("%s: OID_802_3_MULTICAST_LIST\n", __func__);
    /* Multicast base address only */
    *outbuf = __constant_cpu_to_le32 (0xE0000000);
    retval = 0;
    @@ -442,21 +437,21 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,

    /* mandatory */
    case OID_802_3_MAXIMUM_LIST_SIZE:
    - DBG("%s: OID_802_3_MAXIMUM_LIST_SIZE\n", __func__);
    + pr_debug("%s: OID_802_3_MAXIMUM_LIST_SIZE\n", __func__);
    /* Multicast base address only */
    *outbuf = __constant_cpu_to_le32 (1);
    retval = 0;
    break;

    case OID_802_3_MAC_OPTIONS:
    - DBG("%s: OID_802_3_MAC_OPTIONS\n", __func__);
    + pr_debug("%s: OID_802_3_MAC_OPTIONS\n", __func__);
    break;

    /* ieee802.3 statistics OIDs (table 4-4) */

    /* mandatory */
    case OID_802_3_RCV_ERROR_ALIGNMENT:
    - DBG("%s: OID_802_3_RCV_ERROR_ALIGNMENT\n", __func__);
    + pr_debug("%s: OID_802_3_RCV_ERROR_ALIGNMENT\n", __func__);
    if (stats) {
    *outbuf = cpu_to_le32(stats->rx_frame_errors);
    retval = 0;
    @@ -465,14 +460,14 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,

    /* mandatory */
    case OID_802_3_XMIT_ONE_COLLISION:
    - DBG("%s: OID_802_3_XMIT_ONE_COLLISION\n", __func__);
    + pr_debug("%s: OID_802_3_XMIT_ONE_COLLISION\n", __func__);
    *outbuf = __constant_cpu_to_le32 (0);
    retval = 0;
    break;

    /* mandatory */
    case OID_802_3_XMIT_MORE_COLLISIONS:
    - DBG("%s: OID_802_3_XMIT_MORE_COLLISIONS\n", __func__);
    + pr_debug("%s: OID_802_3_XMIT_MORE_COLLISIONS\n", __func__);
    *outbuf = __constant_cpu_to_le32 (0);
    retval = 0;
    break;
    @@ -504,9 +499,9 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len,
    return -ENOMEM;

    if (buf_len && rndis_debug > 1) {
    - DBG("set OID %08x value, len %d:\n", OID, buf_len);
    + pr_debug("set OID %08x value, len %d:\n", OID, buf_len);
    for (i = 0; i < buf_len; i += 16) {
    - DBG("%03d: %08x %08x %08x %08x\n", i,
    + pr_debug("%03d: %08x %08x %08x %08x\n", i,
    get_unaligned_le32(&buf[i]),
    get_unaligned_le32(&buf[i + 4]),
    get_unaligned_le32(&buf[i + 8]),
    @@ -525,7 +520,7 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len,
    * MULTICAST, ALL_MULTICAST, BROADCAST
    */
    *params->filter = (u16)get_unaligned_le32(buf);
    - DBG("%s: OID_GEN_CURRENT_PACKET_FILTER %08x\n",
    + pr_debug("%s: OID_GEN_CURRENT_PACKET_FILTER %08x\n",
    __func__, *params->filter);

    /* this call has a significant side effect: it's
    @@ -547,7 +542,7 @@ static int gen_ndis_set_resp (u8 configNr, u32 OID, u8 *buf, u32 buf_len,

    case OID_802_3_MULTICAST_LIST:
    /* I think we can ignore this */
    - DBG("%s: OID_802_3_MULTICAST_LIST\n", __func__);
    + pr_debug("%s: OID_802_3_MULTICAST_LIST\n", __func__);
    retval = 0;
    break;

    @@ -606,7 +601,7 @@ static int rndis_query_response (int configNr, rndis_query_msg_type *buf)
    rndis_resp_t *r;
    struct rndis_params *params = rndis_per_dev_params + configNr;

    - // DBG("%s: OID = %08X\n", __func__, cpu_to_le32(buf->OID));
    + /* pr_debug("%s: OID = %08X\n", __func__, cpu_to_le32(buf->OID)); */
    if (!params->dev)
    return -ENOTSUPP;

    @@ -659,15 +654,15 @@ static int rndis_set_response (int configNr, rndis_set_msg_type *buf)
    BufOffset = le32_to_cpu (buf->InformationBufferOffset);

    #ifdef VERBOSE_DEBUG
    - DBG("%s: Length: %d\n", __func__, BufLength);
    - DBG("%s: Offset: %d\n", __func__, BufOffset);
    - DBG("%s: InfoBuffer: ", __func__);
    + pr_debug("%s: Length: %d\n", __func__, BufLength);
    + pr_debug("%s: Offset: %d\n", __func__, BufOffset);
    + pr_debug("%s: InfoBuffer: ", __func__);

    for (i = 0; i < BufLength; i++) {
    - DBG("%02x ", *(((u8 *) buf) + i + 8 + BufOffset));
    + pr_debug("%02x ", *(((u8 *) buf) + i + 8 + BufOffset));
    }

    - DBG("\n");
    + pr_debug("\n");
    #endif

    resp->MessageType = __constant_cpu_to_le32 (REMOTE_NDIS_SET_CMPLT);
    @@ -821,14 +816,14 @@ int rndis_msg_parser (u8 configNr, u8 *buf)
    /* For USB: responses may take up to 10 seconds */
    switch (MsgType) {
    case REMOTE_NDIS_INITIALIZE_MSG:
    - DBG("%s: REMOTE_NDIS_INITIALIZE_MSG\n",
    + pr_debug("%s: REMOTE_NDIS_INITIALIZE_MSG\n",
    __func__ );
    params->state = RNDIS_INITIALIZED;
    return rndis_init_response (configNr,
    (rndis_init_msg_type *) buf);

    case REMOTE_NDIS_HALT_MSG:
    - DBG("%s: REMOTE_NDIS_HALT_MSG\n",
    + pr_debug("%s: REMOTE_NDIS_HALT_MSG\n",
    __func__ );
    params->state = RNDIS_UNINITIALIZED;
    if (params->dev) {
    @@ -846,7 +841,7 @@ int rndis_msg_parser (u8 configNr, u8 *buf)
    (rndis_set_msg_type *) buf);

    case REMOTE_NDIS_RESET_MSG:
    - DBG("%s: REMOTE_NDIS_RESET_MSG\n",
    + pr_debug("%s: REMOTE_NDIS_RESET_MSG\n",
    __func__ );
    return rndis_reset_response (configNr,
    (rndis_reset_msg_type *) buf);
    @@ -854,7 +849,7 @@ int rndis_msg_parser (u8 configNr, u8 *buf)
    case REMOTE_NDIS_KEEPALIVE_MSG:
    /* For USB: host does this every 5 seconds */
    if (rndis_debug > 1)
    - DBG("%s: REMOTE_NDIS_KEEPALIVE_MSG\n",
    + pr_debug("%s: REMOTE_NDIS_KEEPALIVE_MSG\n",
    __func__ );
    return rndis_keepalive_response (configNr,
    (rndis_keepalive_msg_type *)
    @@ -870,7 +865,7 @@ int rndis_msg_parser (u8 configNr, u8 *buf)
    {
    unsigned i;
    for (i = 0; i < MsgLength; i += 16) {
    - DBG("%03d: "
    + pr_debug("%03d: "
    " %02x %02x %02x %02x"
    " %02x %02x %02x %02x"
    " %02x %02x %02x %02x"
    @@ -905,18 +900,18 @@ int rndis_register(void (*resp_avail)(void *v), void *v)
    rndis_per_dev_params [i].used = 1;
    rndis_per_dev_params [i].resp_avail = resp_avail;
    rndis_per_dev_params [i].v = v;
    - DBG("%s: configNr = %d\n", __func__, i);
    + pr_debug("%s: configNr = %d\n", __func__, i);
    return i;
    }
    }
    - DBG("failed\n");
    + pr_debug("failed\n");

    return -ENODEV;
    }

    void rndis_deregister (int configNr)
    {
    - DBG("%s: \n", __func__ );
    + pr_debug("%s: \n", __func__);

    if (configNr >= RNDIS_MAX_CONFIGS) return;
    rndis_per_dev_params [configNr].used = 0;
    @@ -926,7 +921,7 @@ void rndis_deregister (int configNr)

    int rndis_set_param_dev(u8 configNr, struct net_device *dev, u16 *cdc_filter)
    {
    - DBG("%s:\n", __func__ );
    + pr_debug("%s:\n", __func__);
    if (!dev)
    return -EINVAL;
    if (configNr >= RNDIS_MAX_CONFIGS) return -1;
    @@ -939,7 +934,7 @@ int rndis_set_param_dev(u8 configNr, struct net_device *dev, u16 *cdc_filter)

    int rndis_set_param_vendor (u8 configNr, u32 vendorID, const char *vendorDescr)
    {
    - DBG("%s:\n", __func__ );
    + pr_debug("%s:\n", __func__);
    if (!vendorDescr) return -1;
    if (configNr >= RNDIS_MAX_CONFIGS) return -1;

    @@ -951,7 +946,7 @@ int rndis_set_param_vendor (u8 configNr, u32 vendorID, const char *vendorDescr)

    int rndis_set_param_medium (u8 configNr, u32 medium, u32 speed)
    {
    - DBG("%s: %u %u\n", __func__, medium, speed);
    + pr_debug("%s: %u %u\n", __func__, medium, speed);
    if (configNr >= RNDIS_MAX_CONFIGS) return -1;

    rndis_per_dev_params [configNr].medium = medium;
    @@ -1114,7 +1109,7 @@ static ssize_t rndis_proc_write(struct file *file, const char __user *buffer,
    break;
    default:
    if (fl_speed) p->speed = speed;
    - else DBG("%c is not valid\n", c);
    + else pr_debug("%c is not valid\n", c);
    break;
    }

    @@ -1159,12 +1154,12 @@ int __init rndis_init (void)
    &rndis_proc_fops,
    (void *)(rndis_per_dev_params + i))))
    {
    - DBG("%s :remove entries", __func__);
    + pr_debug("%s :remove entries", __func__);
    while (i) {
    sprintf (name, NAME_TEMPLATE, --i);
    remove_proc_entry (name, NULL);
    }
    - DBG("\n");
    + pr_debug("\n");
    return -EIO;
    }
    #endif
    --
    1.6.0.2

    --
    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 29/46] device model: Do a quickcheck for driver binding before doing an expensive check

    From: Arjan van de Ven

    This patch adds a quick check for the driver<->device match before
    taking the locks and doin gthe expensive checks. Taking the lock hurts
    in asynchronous boot context where the device lock gets hit; one of the
    init functions takes the lock and goes to do an expensive hardware init;
    the other init functions walk the same PCI list and get stuck on the
    lock as a result.

    For the common case, we can know there's no chance whatsoever of a match
    if the device isn't in the drivers ID table... so this patch does that
    check as a best-effort-avoid-the-lock approach.

    Bootcharts for before and after can be seen at
    http://www.fenrus.org/before.svg
    http://www.fenrus.org/after.svg

    Note the long time "agp_ali_init" takes in the first graph; my laptop
    doesn't even have an ALI chip in it! (the bootgraphs look a bit
    dissimilar, but that's the point, the first one has a bunch of arbitrary
    delays in it that cause it to look very different)

    This reduces my kernel boot time by about 20%

    Signed-off-by: Arjan van de Ven
    Cc: Alan Stern
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/base/dd.c | 3 +++
    1 files changed, 3 insertions(+), 0 deletions(-)

    diff --git a/drivers/base/dd.c b/drivers/base/dd.c
    index 3ac443b..20febc0 100644
    --- a/drivers/base/dd.c
    +++ b/drivers/base/dd.c
    @@ -257,6 +257,9 @@ static int __driver_attach(struct device *dev, void *data)
    * is an error.
    */

    + if (drv->bus->match && !drv->bus->match(dev, drv))
    + return 0;
    +
    if (dev->parent) /* Needed for USB */
    down(&dev->parent->sem);
    down(&dev->sem);
    --
    1.6.0.2

    --
    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 33/46] usb: turn dev_warn+WARN_ON combos into dev_WARN

    From: Arjan van de Ven

    dev_WARN is both compacter and gives better debug information
    than just a WARN_ON, since people and tools will copy the device
    information message together with the WARN_ON in bug reports.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Greg Kroah-Hartman
    ---
    drivers/usb/host/uhci-q.c | 24 ++++++++----------------
    1 files changed, 8 insertions(+), 16 deletions(-)

    diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c
    index db64593..1f0c2cf 100644
    --- a/drivers/usb/host/uhci-q.c
    +++ b/drivers/usb/host/uhci-q.c
    @@ -123,14 +123,10 @@ static struct uhci_td *uhci_alloc_td(struct uhci_hcd *uhci)

    static void uhci_free_td(struct uhci_hcd *uhci, struct uhci_td *td)
    {
    - if (!list_empty(&td->list)) {
    - dev_warn(uhci_dev(uhci), "td %p still in list!\n", td);
    - WARN_ON(1);
    - }
    - if (!list_empty(&td->fl_list)) {
    - dev_warn(uhci_dev(uhci), "td %p still in fl_list!\n", td);
    - WARN_ON(1);
    - }
    + if (!list_empty(&td->list))
    + dev_WARN(uhci_dev(uhci), "td %p still in list!\n", td);
    + if (!list_empty(&td->fl_list))
    + dev_WARN(uhci_dev(uhci), "td %p still in fl_list!\n", td);

    dma_pool_free(uhci->td_pool, td, td->dma_handle);
    }
    @@ -295,10 +291,8 @@ static struct uhci_qh *uhci_alloc_qh(struct uhci_hcd *uhci,
    static void uhci_free_qh(struct uhci_hcd *uhci, struct uhci_qh *qh)
    {
    WARN_ON(qh->state != QH_STATE_IDLE && qh->udev);
    - if (!list_empty(&qh->queue)) {
    - dev_warn(uhci_dev(uhci), "qh %p list not empty!\n", qh);
    - WARN_ON(1);
    - }
    + if (!list_empty(&qh->queue))
    + dev_WARN(uhci_dev(uhci), "qh %p list not empty!\n", qh);

    list_del(&qh->node);
    if (qh->udev) {
    @@ -746,11 +740,9 @@ static void uhci_free_urb_priv(struct uhci_hcd *uhci,
    {
    struct uhci_td *td, *tmp;

    - if (!list_empty(&urbp->node)) {
    - dev_warn(uhci_dev(uhci), "urb %p still on QH's list!\n",
    + if (!list_empty(&urbp->node))
    + dev_WARN(uhci_dev(uhci), "urb %p still on QH's list!\n",
    urbp->urb);
    - WARN_ON(1);
    - }

    list_for_each_entry_safe(td, tmp, &urbp->td_list, list) {
    uhci_remove_td_from_urbp(td);
    --
    1.6.0.2

    --
    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 3 1 2 3 LastLast