From: Dmitriy Monakhov <dmonakhov@sw.ru>
To: "Jesper Juhl" <jesper.juhl@gmail.com>
Cc: "Mikael Pettersson" <mikpe@it.uu.se>,
ak@suse.de, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
bzolnier@gmail.com, linux-kernel@vger.kernel.org,
trent.waddington@gmail.com
Subject: Re: [PATCH][5/5][resend] floppy.c: Fix device_create_file() warning
Date: Wed, 21 Mar 2007 10:11:35 +0300 [thread overview]
Message-ID: <87648vm5p4.fsf@sw.ru> (raw)
In-Reply-To: <9a8748490703200224v204ff9ebs5bd964abef61e9c6@mail.gmail.com> (Jesper Juhl's message of "Tue, 20 Mar 2007 10:24:44 +0100")
"Jesper Juhl" <jesper.juhl@gmail.com> writes:
> On 20/03/07, Mikael Pettersson <mikpe@it.uu.se> wrote:
>> On Mon, 19 Mar 2007 18:42:22 +0100, Jesper Juhl wrote:
>> > --- a/drivers/block/floppy.c
>> > +++ b/drivers/block/floppy.c
>> > @@ -4302,7 +4302,12 @@ static int __init floppy_init(void)
>> > if (err)
>> > goto out_flush_work;
>> >
>> > - device_create_file(&floppy_device[drive].dev,&dev_attr_cmos);
>> > + err = device_create_file(&floppy_device[drive].dev, &dev_attr_cmos);
>> > + if (err)
>> > + goto out_flush_work;
>> > +
>> > /* to be cleaned up... */
>> > disks[drive]->private_data = (void *)(long)drive;
>> > disks[drive]->queue = floppy_queue;
>>
>> The floppy driver's sysfs file just provides some auxiliary
>> information to user-space, none of which matters for most of
>> its users. It is IMO totally inappropriate to fail floppy
>> driver init in this case.
>>
>
> Which is why my original patch just output a warning to let the user
> know that creating the file had failed.
Ohh please... First of all you have to make you patch correct, and only
after this think about tiny shiny error massages.
Lets look at original code:
err = platform_device_register(&floppy_device[drive]);
if (err)
goto out_flush_work;
device_create_file(&floppy_device[drive].dev,&dev_attr_cmos);
<<<<<<<<< You propose "goto out_flush_work" here if device_create_file() failed
<<<<<<<<< ,as it was done if platform_device_register() failed. But at the
<<<<<<<<< moment we call device_create_file() platform_device_register()
<<<<<<<<< succeed, this means we have to unregister it first and only after
<<<<<<<<< this jumpto out_flush_work.
>
> --
> Jesper Juhl <jesper.juhl@gmail.com>
> Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
> Plain text mails only, please http://www.expita.com/nomime.html
> -
> 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/
next prev parent reply other threads:[~2007-03-21 7:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-20 8:32 [PATCH][5/5][resend] floppy.c: Fix device_create_file() warning Mikael Pettersson
2007-03-20 9:24 ` Jesper Juhl
2007-03-21 7:11 ` Dmitriy Monakhov [this message]
2007-03-20 11:29 ` Andreas Kleen
-- strict thread matches above, loose matches on Subject: below --
2007-03-20 11:56 Mikael Pettersson
2007-03-19 15:11 Jesper Juhl
2007-03-19 15:13 ` Andi Kleen
2007-03-19 15:16 ` Jesper Juhl
2007-03-19 15:20 ` Andi Kleen
2007-03-19 17:42 ` Jesper Juhl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87648vm5p4.fsf@sw.ru \
--to=dmonakhov@sw.ru \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=bzolnier@gmail.com \
--cc=jesper.juhl@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mikpe@it.uu.se \
--cc=trent.waddington@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox