Re: prevent swsusp from eating disks

From: Linus Torvalds (torvalds@transmeta.com)
Date: Tue Oct 29 2002 - 19:39:15 EST


On Wed, 30 Oct 2002, Pavel Machek wrote:
>
> Patrick broke IDE so it wanted to eat data, again. Fixed, please
> apply,

This is too ugly for words.

> --- clean/drivers/ide/ide-disk.c 2002-10-18 23:41:15.000000000 +0200
> +++ linux-swsusp/drivers/ide/ide-disk.c 2002-10-21 14:36:36.000000000 +0200
> @@ -1891,8 +1891,10 @@
>
> static int idedisk_init (void)
> {
> - ide_register_driver(&idedisk_driver);
> - return 0;
> + int status = ide_register_driver(&idedisk_driver);
> + idedisk_driver.gen_driver.suspend = idedisk_suspend;
> + idedisk_driver.gen_driver.resume = idedisk_resume;
> + return status;
> }

Why aren't those fields initialized explicitly in the static declaration
of idedisk_driver? And what are the do_idedisk_suspend/do_idedisk_resume
functions, that _are_ initialized explicitly?

I want to understand the madness, not add to it.

                Linus

-
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/



This archive was generated by hypermail 2b29 : Thu Oct 31 2002 - 22:00:45 EST