[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>
This commit is contained in:
committed by
Jeff Garzik
parent
551c012d7e
commit
9825d73ceb
@@ -247,8 +247,8 @@ static __init int qdi_init_one(unsigned long port, int type, unsigned long io, i
|
||||
*/
|
||||
|
||||
pdev = platform_device_register_simple(DRV_NAME, nr_qdi_host, NULL, 0);
|
||||
if (pdev == NULL)
|
||||
return -ENOMEM;
|
||||
if (IS_ERR(pdev))
|
||||
return PTR_ERR(pdev);
|
||||
|
||||
memset(&ae, 0, sizeof(struct ata_probe_ent));
|
||||
INIT_LIST_HEAD(&ae.node);
|
||||
|
Reference in New Issue
Block a user