Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9825d73ceb6cad9b9c2ee2dc2971b58dbe8623cd
Commit:     9825d73ceb6cad9b9c2ee2dc2971b58dbe8623cd
Parent:     551c012d7eea3dc5ec063c7ff9c718d39e77634f
Author:     Akinobu Mita <[EMAIL PROTECTED]>
AuthorDate: Fri Dec 15 13:08:51 2006 -0800
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Sat Dec 16 10:45:28 2006 -0500

    [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 <[EMAIL PROTECTED]>
    Acked-by: Alan Cox <[EMAIL PROTECTED]>
    Signed-off-by: Akinobu Mita <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/pata_legacy.c  |    4 +++-
 drivers/ata/pata_qdi.c     |    4 ++--
 drivers/ata/pata_winbond.c |    4 ++--
 3 files changed, 7 insertions(+), 5 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;
diff --git a/drivers/ata/pata_qdi.c b/drivers/ata/pata_qdi.c
index 36f621a..afc0d99 100644
--- a/drivers/ata/pata_qdi.c
+++ b/drivers/ata/pata_qdi.c
@@ -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);
diff --git a/drivers/ata/pata_winbond.c b/drivers/ata/pata_winbond.c
index 3ea345c..5d1f518 100644
--- a/drivers/ata/pata_winbond.c
+++ b/drivers/ata/pata_winbond.c
@@ -206,8 +206,8 @@ static __init int winbond_init_one(unsigned long port)
                         */
 
                        pdev = platform_device_register_simple(DRV_NAME, 
nr_winbond_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);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to