lkml.org 
[lkml]   [2008]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 34/46] Driver core: make bus_find_device_by_name() more robust
    Date
    From: Peter Korsgaard <jacmet@sunsite.dk>

    Use sysfs_streq() in bus_find_device_by_name() so trailing newlines
    are ignored (E.G. in bind/unbind).

    Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    ---
    drivers/base/bus.c | 4 +---
    1 files changed, 1 insertions(+), 3 deletions(-)

    diff --git a/drivers/base/bus.c b/drivers/base/bus.c
    index ef522ae..39b9b58 100644
    --- a/drivers/base/bus.c
    +++ b/drivers/base/bus.c
    @@ -333,9 +333,7 @@ static int match_name(struct device *dev, void *data)
    {
    const char *name = data;

    - if (strcmp(name, dev->bus_id) == 0)
    - return 1;
    - return 0;
    + return sysfs_streq(name, dev->bus_id);
    }

    /**
    --
    1.6.0.2


    \
     
     \ /
      Last update: 2008-10-16 19:31    [W:0.049 / U:149.884 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site