diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2006-12-15 21:08:51 (GMT) |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-16 15:45:28 (GMT) |
commit | 9825d73ceb6cad9b9c2ee2dc2971b58dbe8623cd (patch) | |
tree | d93e3349ee07705776addd62e4ec97d83a654ac8 /drivers/ata/pata_legacy.c | |
parent | 551c012d7eea3dc5ec063c7ff9c718d39e77634f (diff) | |
download | linux-fsl-qoriq-9825d73ceb6cad9b9c2ee2dc2971b58dbe8623cd.tar.xz |
[PATCH] ata: fix platform_device_register_simple() error check
The return value of platform_device_register_simple() should be checked
by IS_ERR().
Cc: Jeff Garzik <jgarzik@pobox.com>
Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/pata_legacy.c')
-rw-r--r-- | drivers/ata/pata_legacy.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c index c7d1738..e7bf9d8 100644 --- a/drivers/ata/pata_legacy.c +++ b/drivers/ata/pata_legacy.c @@ -698,8 +698,10 @@ static __init int legacy_init_one(int port, unsigned long io, unsigned long ctrl goto fail_io; pdev = platform_device_register_simple(DRV_NAME, nr_legacy_host, NULL, 0); - if (pdev == NULL) + if (IS_ERR(pdev)) { + ret = PTR_ERR(pdev); goto fail_dev; + } if (ht6560a & mask) { ops = &ht6560a_port_ops; |