2013-03-14 09:19:00

by Alexandru Gheorghiu

[permalink] [raw]
Subject: [PATCH] drivers: spi: Use PTR_RET function

Replaced calls to IS_ERR and PTR_ERR with PTR_RET function.
Patch found using coccinelle.

Signed-off-by: Alexandru Gheorghiu <[email protected]>
---
drivers/spi/spidev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 2e0655d..911e9e0 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -603,7 +603,7 @@ static int spidev_probe(struct spi_device *spi)
dev = device_create(spidev_class, &spi->dev, spidev->devt,
spidev, "spidev%d.%d",
spi->master->bus_num, spi->chip_select);
- status = IS_ERR(dev) ? PTR_ERR(dev) : 0;
+ status = PTR_RET(dev);
} else {
dev_dbg(&spi->dev, "no minor number available!\n");
status = -ENODEV;
--
1.7.9.5


2013-04-01 13:33:29

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] drivers: spi: Use PTR_RET function

On Thu, Mar 14, 2013 at 11:18:18AM +0200, Alexandru Gheorghiu wrote:
> Replaced calls to IS_ERR and PTR_ERR with PTR_RET function.
> Patch found using coccinelle.

Applied, but please always use subject lines appropraite for the
subsystem.


Attachments:
(No filename) (241.00 B)
signature.asc (836.00 B)
Digital signature
Download all attachments