diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2013-07-14 21:50:32 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2013-07-14 21:55:01 -0400 |
commit | 8c6ffba0eddc8c110dbf444f51354ce42069abfc (patch) | |
tree | 1055a1cfdf7bd79d6e2c4b969d412780ff2d2209 /drivers | |
parent | 6e8b8726ad503214ba66e34aed69aff41de33489 (diff) |
PTR_RET is now PTR_ERR_OR_ZERO(): Replace most.
Sweep of the simple cases.
Cc: netdev@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/tile-srom.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/core/cma.c | 2 | ||||
-rw-r--r-- | drivers/net/appletalk/cops.c | 2 | ||||
-rw-r--r-- | drivers/net/appletalk/ltpc.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/amd/atarilance.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/amd/mvme147.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/amd/ni65.c | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/amd/sun3lance.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/debug.c | 2 | ||||
-rw-r--r-- | drivers/platform/x86/samsung-q10.c | 2 | ||||
-rw-r--r-- | drivers/regulator/fan53555.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi-fsl-spi.c | 2 | ||||
-rw-r--r-- | drivers/spi/spidev.c | 2 | ||||
-rw-r--r-- | drivers/video/omap2/dss/core.c | 2 |
15 files changed, 15 insertions, 15 deletions
diff --git a/drivers/char/tile-srom.c b/drivers/char/tile-srom.c index 7faeb1cde97d..ce04d6eb23d4 100644 --- a/drivers/char/tile-srom.c +++ b/drivers/char/tile-srom.c | |||
@@ -349,7 +349,7 @@ static int srom_setup_minor(struct srom_dev *srom, int index) | |||
349 | 349 | ||
350 | dev = device_create(srom_class, &platform_bus, | 350 | dev = device_create(srom_class, &platform_bus, |
351 | MKDEV(srom_major, index), srom, "%d", index); | 351 | MKDEV(srom_major, index), srom, "%d", index); |
352 | return PTR_RET(dev); | 352 | return PTR_ERR_OR_ZERO(dev); |
353 | } | 353 | } |
354 | 354 | ||
355 | /** srom_init() - Initialize the driver's module. */ | 355 | /** srom_init() - Initialize the driver's module. */ |
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index f1c279fabe64..4df360bede81 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c | |||
@@ -3205,7 +3205,7 @@ static int cma_join_ib_multicast(struct rdma_id_private *id_priv, | |||
3205 | id_priv->id.port_num, &rec, | 3205 | id_priv->id.port_num, &rec, |
3206 | comp_mask, GFP_KERNEL, | 3206 | comp_mask, GFP_KERNEL, |
3207 | cma_ib_mc_handler, mc); | 3207 | cma_ib_mc_handler, mc); |
3208 | return PTR_RET(mc->multicast.ib); | 3208 | return PTR_ERR_OR_ZERO(mc->multicast.ib); |
3209 | } | 3209 | } |
3210 | 3210 | ||
3211 | static void iboe_mcast_work_handler(struct work_struct *work) | 3211 | static void iboe_mcast_work_handler(struct work_struct *work) |
diff --git a/drivers/net/appletalk/cops.c b/drivers/net/appletalk/cops.c index cff6f023c03a..7f2a032c354c 100644 --- a/drivers/net/appletalk/cops.c +++ b/drivers/net/appletalk/cops.c | |||
@@ -996,7 +996,7 @@ static int __init cops_module_init(void) | |||
996 | printk(KERN_WARNING "%s: You shouldn't autoprobe with insmod\n", | 996 | printk(KERN_WARNING "%s: You shouldn't autoprobe with insmod\n", |
997 | cardname); | 997 | cardname); |
998 | cops_dev = cops_probe(-1); | 998 | cops_dev = cops_probe(-1); |
999 | return PTR_RET(cops_dev); | 999 | return PTR_ERR_OR_ZERO(cops_dev); |
1000 | } | 1000 | } |
1001 | 1001 | ||
1002 | static void __exit cops_module_exit(void) | 1002 | static void __exit cops_module_exit(void) |
diff --git a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c index b5782cdf0bca..01e2ac55c137 100644 --- a/drivers/net/appletalk/ltpc.c +++ b/drivers/net/appletalk/ltpc.c | |||
@@ -1243,7 +1243,7 @@ static int __init ltpc_module_init(void) | |||
1243 | "ltpc: Autoprobing is not recommended for modules\n"); | 1243 | "ltpc: Autoprobing is not recommended for modules\n"); |
1244 | 1244 | ||
1245 | dev_ltpc = ltpc_probe(); | 1245 | dev_ltpc = ltpc_probe(); |
1246 | return PTR_RET(dev_ltpc); | 1246 | return PTR_ERR_OR_ZERO(dev_ltpc); |
1247 | } | 1247 | } |
1248 | module_init(ltpc_module_init); | 1248 | module_init(ltpc_module_init); |
1249 | #endif | 1249 | #endif |
diff --git a/drivers/net/ethernet/amd/atarilance.c b/drivers/net/ethernet/amd/atarilance.c index e8d0ef508f48..10ceca523fc0 100644 --- a/drivers/net/ethernet/amd/atarilance.c +++ b/drivers/net/ethernet/amd/atarilance.c | |||
@@ -1147,7 +1147,7 @@ static struct net_device *atarilance_dev; | |||
1147 | static int __init atarilance_module_init(void) | 1147 | static int __init atarilance_module_init(void) |
1148 | { | 1148 | { |
1149 | atarilance_dev = atarilance_probe(-1); | 1149 | atarilance_dev = atarilance_probe(-1); |
1150 | return PTR_RET(atarilance_dev); | 1150 | return PTR_ERR_OR_ZERO(atarilance_dev); |
1151 | } | 1151 | } |
1152 | 1152 | ||
1153 | static void __exit atarilance_module_exit(void) | 1153 | static void __exit atarilance_module_exit(void) |
diff --git a/drivers/net/ethernet/amd/mvme147.c b/drivers/net/ethernet/amd/mvme147.c index a51497c9d2af..e108e911da05 100644 --- a/drivers/net/ethernet/amd/mvme147.c +++ b/drivers/net/ethernet/amd/mvme147.c | |||
@@ -188,7 +188,7 @@ static struct net_device *dev_mvme147_lance; | |||
188 | int __init init_module(void) | 188 | int __init init_module(void) |
189 | { | 189 | { |
190 | dev_mvme147_lance = mvme147lance_probe(-1); | 190 | dev_mvme147_lance = mvme147lance_probe(-1); |
191 | return PTR_RET(dev_mvme147_lance); | 191 | return PTR_ERR_OR_ZERO(dev_mvme147_lance); |
192 | } | 192 | } |
193 | 193 | ||
194 | void __exit cleanup_module(void) | 194 | void __exit cleanup_module(void) |
diff --git a/drivers/net/ethernet/amd/ni65.c b/drivers/net/ethernet/amd/ni65.c index 26fc0ce0faa3..1cf33addd15e 100644 --- a/drivers/net/ethernet/amd/ni65.c +++ b/drivers/net/ethernet/amd/ni65.c | |||
@@ -1238,7 +1238,7 @@ MODULE_PARM_DESC(dma, "ni6510 ISA DMA channel (ignored for some cards)"); | |||
1238 | int __init init_module(void) | 1238 | int __init init_module(void) |
1239 | { | 1239 | { |
1240 | dev_ni65 = ni65_probe(-1); | 1240 | dev_ni65 = ni65_probe(-1); |
1241 | return PTR_RET(dev_ni65); | 1241 | return PTR_ERR_OR_ZERO(dev_ni65); |
1242 | } | 1242 | } |
1243 | 1243 | ||
1244 | void __exit cleanup_module(void) | 1244 | void __exit cleanup_module(void) |
diff --git a/drivers/net/ethernet/amd/sun3lance.c b/drivers/net/ethernet/amd/sun3lance.c index 4375abe61da1..d6b20296b8e4 100644 --- a/drivers/net/ethernet/amd/sun3lance.c +++ b/drivers/net/ethernet/amd/sun3lance.c | |||
@@ -940,7 +940,7 @@ static struct net_device *sun3lance_dev; | |||
940 | int __init init_module(void) | 940 | int __init init_module(void) |
941 | { | 941 | { |
942 | sun3lance_dev = sun3lance_probe(-1); | 942 | sun3lance_dev = sun3lance_probe(-1); |
943 | return PTR_RET(sun3lance_dev); | 943 | return PTR_ERR_OR_ZERO(sun3lance_dev); |
944 | } | 944 | } |
945 | 945 | ||
946 | void __exit cleanup_module(void) | 946 | void __exit cleanup_module(void) |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.c index c37b9d68e458..0f9e9057e7dd 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.c | |||
@@ -50,7 +50,7 @@ int brcmf_debugfs_attach(struct brcmf_pub *drvr) | |||
50 | return -ENODEV; | 50 | return -ENODEV; |
51 | 51 | ||
52 | drvr->dbgfs_dir = debugfs_create_dir(dev_name(dev), root_folder); | 52 | drvr->dbgfs_dir = debugfs_create_dir(dev_name(dev), root_folder); |
53 | return PTR_RET(drvr->dbgfs_dir); | 53 | return PTR_ERR_OR_ZERO(drvr->dbgfs_dir); |
54 | } | 54 | } |
55 | 55 | ||
56 | void brcmf_debugfs_detach(struct brcmf_pub *drvr) | 56 | void brcmf_debugfs_detach(struct brcmf_pub *drvr) |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/debug.c b/drivers/net/wireless/brcm80211/brcmsmac/debug.c index 9761deb46204..a5d4add26f41 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/debug.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/debug.c | |||
@@ -56,7 +56,7 @@ int brcms_debugfs_attach(struct brcms_pub *drvr) | |||
56 | 56 | ||
57 | drvr->dbgfs_dir = debugfs_create_dir( | 57 | drvr->dbgfs_dir = debugfs_create_dir( |
58 | dev_name(&drvr->wlc->hw->d11core->dev), root_folder); | 58 | dev_name(&drvr->wlc->hw->d11core->dev), root_folder); |
59 | return PTR_RET(drvr->dbgfs_dir); | 59 | return PTR_ERR_OR_ZERO(drvr->dbgfs_dir); |
60 | } | 60 | } |
61 | 61 | ||
62 | void brcms_debugfs_detach(struct brcms_pub *drvr) | 62 | void brcms_debugfs_detach(struct brcms_pub *drvr) |
diff --git a/drivers/platform/x86/samsung-q10.c b/drivers/platform/x86/samsung-q10.c index 1a90b62a71c6..4430b8c1369d 100644 --- a/drivers/platform/x86/samsung-q10.c +++ b/drivers/platform/x86/samsung-q10.c | |||
@@ -176,7 +176,7 @@ static int __init samsungq10_init(void) | |||
176 | samsungq10_probe, | 176 | samsungq10_probe, |
177 | NULL, 0, NULL, 0); | 177 | NULL, 0, NULL, 0); |
178 | 178 | ||
179 | return PTR_RET(samsungq10_device); | 179 | return PTR_ERR_OR_ZERO(samsungq10_device); |
180 | } | 180 | } |
181 | 181 | ||
182 | static void __exit samsungq10_exit(void) | 182 | static void __exit samsungq10_exit(void) |
diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c index f0e1ae52bb05..192444a8dab0 100644 --- a/drivers/regulator/fan53555.c +++ b/drivers/regulator/fan53555.c | |||
@@ -219,7 +219,7 @@ static int fan53555_regulator_register(struct fan53555_device_info *di, | |||
219 | rdesc->owner = THIS_MODULE; | 219 | rdesc->owner = THIS_MODULE; |
220 | 220 | ||
221 | di->rdev = regulator_register(&di->desc, config); | 221 | di->rdev = regulator_register(&di->desc, config); |
222 | return PTR_RET(di->rdev); | 222 | return PTR_ERR_OR_ZERO(di->rdev); |
223 | 223 | ||
224 | } | 224 | } |
225 | 225 | ||
diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c index 41e89c3e3edc..ca0ddb8cef5c 100644 --- a/drivers/spi/spi-fsl-spi.c +++ b/drivers/spi/spi-fsl-spi.c | |||
@@ -901,7 +901,7 @@ static int plat_mpc8xxx_spi_probe(struct platform_device *pdev) | |||
901 | return -EINVAL; | 901 | return -EINVAL; |
902 | 902 | ||
903 | master = fsl_spi_probe(&pdev->dev, mem, irq); | 903 | master = fsl_spi_probe(&pdev->dev, mem, irq); |
904 | return PTR_RET(master); | 904 | return PTR_ERR_OR_ZERO(master); |
905 | } | 905 | } |
906 | 906 | ||
907 | static int plat_mpc8xxx_spi_remove(struct platform_device *pdev) | 907 | static int plat_mpc8xxx_spi_remove(struct platform_device *pdev) |
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index 911e9e0711d2..ca5bcfe874d0 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c | |||
@@ -603,7 +603,7 @@ static int spidev_probe(struct spi_device *spi) | |||
603 | dev = device_create(spidev_class, &spi->dev, spidev->devt, | 603 | dev = device_create(spidev_class, &spi->dev, spidev->devt, |
604 | spidev, "spidev%d.%d", | 604 | spidev, "spidev%d.%d", |
605 | spi->master->bus_num, spi->chip_select); | 605 | spi->master->bus_num, spi->chip_select); |
606 | status = PTR_RET(dev); | 606 | status = PTR_ERR_OR_ZERO(dev); |
607 | } else { | 607 | } else { |
608 | dev_dbg(&spi->dev, "no minor number available!\n"); | 608 | dev_dbg(&spi->dev, "no minor number available!\n"); |
609 | status = -ENODEV; | 609 | status = -ENODEV; |
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 1aeb274e30fc..a7ce26c090dd 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c | |||
@@ -189,7 +189,7 @@ int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *)) | |||
189 | d = debugfs_create_file(name, S_IRUGO, dss_debugfs_dir, | 189 | d = debugfs_create_file(name, S_IRUGO, dss_debugfs_dir, |
190 | write, &dss_debug_fops); | 190 | write, &dss_debug_fops); |
191 | 191 | ||
192 | return PTR_RET(d); | 192 | return PTR_ERR_OR_ZERO(d); |
193 | } | 193 | } |
194 | #else /* CONFIG_OMAP2_DSS_DEBUGFS */ | 194 | #else /* CONFIG_OMAP2_DSS_DEBUGFS */ |
195 | static inline int dss_initialize_debugfs(void) | 195 | static inline int dss_initialize_debugfs(void) |