From kevin at tyndur.org Mon Mar 5 22:33:56 2012 From: kevin at tyndur.org (Kevin Wolf) Date: Mon, 5 Mar 2012 22:33:56 +0100 Subject: [cdi-devel] [PATCH] floppy: Fix initialisation Message-ID: <1330983236-30721-1-git-send-email-kevin@tyndur.org> Commit 10f8c755 broke the floppy driver by initialising the drives before the controller. This fix restores the right order. Additionally, floppy must assign the device's driver after 10f8c755 because it calls the device init function before generic CDI code can do the job. This could clearly need some cleanup so that CDI calls the device init functions again, but for now let's just fix the breakage. Signed-off-by: Kevin Wolf --- floppy/main.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/floppy/main.c b/floppy/main.c index c516a23..4e62e9f 100644 --- a/floppy/main.c +++ b/floppy/main.c @@ -68,7 +68,7 @@ static int floppy_driver_init(void) // Geraet nur eintragen wenn es existiert if (floppy_device_probe(device) != 0) { - floppy_init_device((struct cdi_device*) device); + device->dev.dev.driver = &floppy_driver.drv; cdi_list_push(floppy_driver.drv.devices, device); } else { free(device); @@ -86,6 +86,10 @@ static int floppy_driver_init(void) return -1; } + for (i = 0; (device = cdi_list_get(floppy_driver.drv.devices, i)); i++) { + floppy_init_device(&device->dev.dev); + } + return 0; } -- 1.7.7 From kevin at tyndur.org Sat Mar 31 10:10:59 2012 From: kevin at tyndur.org (Kevin Wolf) Date: Sat, 31 Mar 2012 10:10:59 +0200 Subject: [cdi-devel] [PATCH] floppy: Fix initialisation In-Reply-To: <1330983236-30721-1-git-send-email-kevin@tyndur.org> References: <1330983236-30721-1-git-send-email-kevin@tyndur.org> Message-ID: <20120331081059.GA3637@silvanus> On Mon, Mar 05, 2012 at 10:33:56PM +0100, Kevin Wolf wrote: > Commit 10f8c755 broke the floppy driver by initialising the drives > before the controller. This fix restores the right order. > > Additionally, floppy must assign the device's driver after 10f8c755 > because it calls the device init function before generic CDI code can do > the job. This could clearly need some cleanup so that CDI calls the > device init functions again, but for now let's just fix the breakage. > > Signed-off-by: Kevin Wolf There seem to be no objections. Pushed.