ide: fix PowerMac bootup oops
commit5f4417a156a6e44359effa9492de3ed5638a9b13
authorHugh Dickins <hugh.dickins@tiscali.co.uk>
Wed, 10 Jun 2009 12:37:20 +0000 (10 14:37 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Wed, 10 Jun 2009 12:37:20 +0000 (10 14:37 +0200)
tree7868d60ce2c0b38b07727090c865d04fa93a622d
parenta20b2a44eca52818ef52a94959480b7e6ea2f528
ide: fix PowerMac bootup oops

PowerMac bootup with CONFIG_IDE=y oopses in ide_pio_cycle_time():
because "ide: try to use PIO Mode 0 during probe if possible" causes
pmac_ide_set_pio_mode() to be called before drive->id has been set.

Bart points out other places which now need drive->id set earlier,
so follow his advice to allocate it in ide_port_alloc_devices()
(using kzalloc_node, without error message, as when allocating drive)
and memset it for reuse in ide_port_init_devices_data().

Fixed in passing: ide_host_alloc() was missing ide_port_free_devices()
from an error path.

Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Joao Ramos <joao.ramos@inov.pt>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-probe.c