From 91a92e12baf3c8cc2e353b3a70ddca9f9a59cf02 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 10 Sep 2013 18:55:20 +0900 Subject: spi: spidev: remove unnecessary spi_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Mark Brown diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index ca5bcfe..c53556a 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -629,7 +629,6 @@ static int spidev_remove(struct spi_device *spi) /* make sure ops on existing fds can abort cleanly */ spin_lock_irq(&spidev->spi_lock); spidev->spi = NULL; - spi_set_drvdata(spi, NULL); spin_unlock_irq(&spidev->spi_lock); /* prevent new opens */ -- cgit v0.10.2 From 95c63cfba777bf2154565abbdc61ea970aaa632c Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Mon, 14 Oct 2013 10:36:54 +0900 Subject: spi: spidev: Fix checkpatch issue Fix the following checkpatch warnings. WARNING: Use #include instead of WARNING: braces {} are not necessary for any arm of this statement Signed-off-by: Jingoo Han Signed-off-by: Mark Brown diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index c53556a..d7c6e36 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c @@ -37,7 +37,7 @@ #include #include -#include +#include /* @@ -206,9 +206,9 @@ spidev_write(struct file *filp, const char __user *buf, mutex_lock(&spidev->buf_lock); missing = copy_from_user(spidev->buffer, buf, count); - if (missing == 0) { + if (missing == 0) status = spidev_sync_write(spidev, count); - } else + else status = -EFAULT; mutex_unlock(&spidev->buf_lock); -- cgit v0.10.2