[PATCH] drivers: process failure of sysfs_create_group() - Kernel

This is a discussion on [PATCH] drivers: process failure of sysfs_create_group() - Kernel ; drivers: drivers/video/uvesafb.c: When fail to call sysfs_create_group(), it should recycle resources and return the error. This patch fix for processing failure of sysfs_create_group(). Signed-off-by: Jianjun Kong --- drivers/video/uvesafb.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: [PATCH] drivers: process failure of sysfs_create_group()

  1. [PATCH] drivers: process failure of sysfs_create_group()


    drivers: drivers/video/uvesafb.c:
    When fail to call sysfs_create_group(), it should recycle resources and return the error.
    This patch fix for processing failure of sysfs_create_group().

    Signed-off-by: Jianjun Kong
    ---
    drivers/video/uvesafb.c | 6 +++++-
    1 files changed, 5 insertions(+), 1 deletions(-)

    diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
    index 6c2d37f..a78d4d9 100644
    --- a/drivers/video/uvesafb.c
    +++ b/drivers/video/uvesafb.c
    @@ -1811,12 +1811,16 @@ static int __devinit uvesafb_probe(struct platform_device *dev)
    info->fix.id);

    err = sysfs_create_group(&dev->dev.kobj, &uvesafb_dev_attgrp);
    - if (err != 0)
    + if (err != 0) {
    printk(KERN_WARNING "fb%d: failed to register attributes\n",
    info->node);
    + goto out_frame;
    + }

    return 0;

    +our_frame:
    + unregister_framebuffer(info);
    out_reg:
    release_region(0x3c0, 32);
    out_unmap:
    --
    1.5.6.3

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

  2. Re: [Linux-fbdev-devel] [PATCH] drivers: process failure of sysfs_create_group()

    On Mon, 10 Nov 2008, Jianjun Kong wrote:
    > drivers: drivers/video/uvesafb.c:
    > When fail to call sysfs_create_group(), it should recycle resources and return the error.
    > This patch fix for processing failure of sysfs_create_group().


    IIRC, the reasoning behind the current code is that a failure to create sysfs
    entries is not critical, as it doesn't impact the correct functioning of the
    core of the driver.

    > Signed-off-by: Jianjun Kong
    > ---
    > drivers/video/uvesafb.c | 6 +++++-
    > 1 files changed, 5 insertions(+), 1 deletions(-)
    >
    > diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
    > index 6c2d37f..a78d4d9 100644
    > --- a/drivers/video/uvesafb.c
    > +++ b/drivers/video/uvesafb.c
    > @@ -1811,12 +1811,16 @@ static int __devinit uvesafb_probe(struct platform_device *dev)
    > info->fix.id);
    >
    > err = sysfs_create_group(&dev->dev.kobj, &uvesafb_dev_attgrp);
    > - if (err != 0)
    > + if (err != 0) {
    > printk(KERN_WARNING "fb%d: failed to register attributes\n",
    > info->node);
    > + goto out_frame;
    > + }
    >
    > return 0;
    >
    > +our_frame:
    > + unregister_framebuffer(info);
    > out_reg:
    > release_region(0x3c0, 32);
    > out_unmap:


    Gr{oetje,eeting}s,

    Geert

    --
    Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

    In personal conversations with technical people, I call myself a hacker. But
    when I'm talking to journalists I just say "programmer" or something like that.
    -- Linus Torvalds
    --
    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. Re: [Linux-fbdev-devel] [PATCH] drivers: process failure of sysfs_create_group()

    On Mon, Nov 10, 2008 at 22:30, Geert Uytterhoeven wrote:

    >> When fail to call sysfs_create_group(), it should recycle resources and return the error.
    >> This patch fix for processing failure of sysfs_create_group().

    >
    > IIRC, the reasoning behind the current code is that a failure to create sysfs
    > entries is not critical, as it doesn't impact the correct functioning of the
    > core of the driver.


    That's correct -- that was exactly my reasoning behind this code.

    --
    Michal Januszewski, Gentoo Linux Developer
    http://people.gentoo.org/spock
    --
    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