[LinuxPPS] [PATCH 09/11] pps_register_cdev: Obvious bugfix.

George Spelvin linux at horizon.com
Fri Feb 6 14:34:33 CET 2009


I spotted this.  It's actually independent of the rest of the patch series.

---
 drivers/pps/pps.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c
index d729946..1f0da51 100644
--- a/drivers/pps/pps.c
+++ b/drivers/pps/pps.c
@@ -254,19 +254,16 @@ int pps_register_cdev(struct pps_device *pps)
 	}
 	pps->dev = device_create(pps_class, pps->info.dev, pps->devno, NULL,
 							"pps%d", pps->id);
-	if (err)
-		goto del_cdev;
+	if (IS_ERR(pps->dev)) {
+		cdev_del(&pps->cdev);
+		return PTR_ERR(pps->dev);
+	}
 	dev_set_drvdata(pps->dev, pps);
 
 	pr_debug("source %s got cdev (%d:%d)\n", pps->info.name,
 			MAJOR(pps_devt), pps->id);
 
 	return 0;
-
-del_cdev:
-	cdev_del(&pps->cdev);
-
-	return err;
 }
 
 void pps_unregister_cdev(struct pps_device *pps)
-- 
1.6.0.6




More information about the LinuxPPS mailing list