* [PATCH] spi/spidev: remove BLK
@ 2009-09-10 13:04 Sebastian Andrzej Siewior
[not found] ` <20090910130409.GA23433-N26foeg2n7CSQxDm3FYtNwe+0vtP5+jfMa5aj3AfGnc@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2009-09-10 13:04 UTC (permalink / raw)
To: David Brownell; +Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
the BLK in open() is not required:
- device_list is protected by device_list_lock
- spidev->user is only access with device_list_lock locked
- spidev->buffer is protected by spidev->buf_lock. Allocation & free is done
by the first/last user with device_list_lock locked.
Signed-off-by: Sebastian Andrzej Siewior <sebastian-E0PNVn5OA6ohrxcnuTQ+TQ@public.gmane.org>
---
drivers/spi/spidev.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 606e7a4..f362c40 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -30,7 +30,6 @@
#include <linux/errno.h>
#include <linux/mutex.h>
#include <linux/slab.h>
-#include <linux/smp_lock.h>
#include <linux/spi/spi.h>
#include <linux/spi/spidev.h>
@@ -477,7 +476,6 @@ static int spidev_open(struct inode *inode, struct file *filp)
struct spidev_data *spidev;
int status = -ENXIO;
- lock_kernel();
mutex_lock(&device_list_lock);
list_for_each_entry(spidev, &device_list, device_entry) {
@@ -503,7 +501,6 @@ static int spidev_open(struct inode *inode, struct file *filp)
pr_debug("spidev: nothing for minor %d\n", iminor(inode));
mutex_unlock(&device_list_lock);
- unlock_kernel();
return status;
}
--
1.6.3.3
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] spi/spidev: remove BLK
[not found] ` <20090910130409.GA23433-N26foeg2n7CSQxDm3FYtNwe+0vtP5+jfMa5aj3AfGnc@public.gmane.org>
@ 2009-09-10 18:00 ` David Brownell
[not found] ` <200909101100.34332.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: David Brownell @ 2009-09-10 18:00 UTC (permalink / raw)
To: Sebastian Andrzej Siewior
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
On Thursday 10 September 2009, Sebastian Andrzej Siewior wrote:
> the BLK in open() is not required:
> - device_list is protected by device_list_lock
> - spidev->user is only access with device_list_lock locked
> - spidev->buffer is protected by spidev->buf_lock. Allocation & free is done
> by the first/last user with device_list_lock locked.
>
> Signed-off-by: Sebastian Andrzej Siewior <sebastian-E0PNVn5OA6ohrxcnuTQ+TQ@public.gmane.org>
In short: revert 609f9e92b570f390a457a81effe0af6b758dc582
which was not needed (and ISTR that it got a NAK so why it's
in the tree is a puzzle).
> ---
> drivers/spi/spidev.c | 3 ---
> 1 files changed, 0 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
> index 606e7a4..f362c40 100644
> --- a/drivers/spi/spidev.c
> +++ b/drivers/spi/spidev.c
> @@ -30,7 +30,6 @@
> #include <linux/errno.h>
> #include <linux/mutex.h>
> #include <linux/slab.h>
> -#include <linux/smp_lock.h>
>
> #include <linux/spi/spi.h>
> #include <linux/spi/spidev.h>
> @@ -477,7 +476,6 @@ static int spidev_open(struct inode *inode, struct file *filp)
> struct spidev_data *spidev;
> int status = -ENXIO;
>
> - lock_kernel();
> mutex_lock(&device_list_lock);
>
> list_for_each_entry(spidev, &device_list, device_entry) {
> @@ -503,7 +501,6 @@ static int spidev_open(struct inode *inode, struct file *filp)
> pr_debug("spidev: nothing for minor %d\n", iminor(inode));
>
> mutex_unlock(&device_list_lock);
> - unlock_kernel();
> return status;
> }
>
> --
> 1.6.3.3
>
>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] spi/spidev: remove BLK
[not found] ` <200909101100.34332.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
@ 2009-09-10 19:41 ` Sebastian Andrzej Siewior
0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2009-09-10 19:41 UTC (permalink / raw)
To: David Brownell; +Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
* David Brownell | 2009-09-10 11:00:34 [-0700]:
>On Thursday 10 September 2009, Sebastian Andrzej Siewior wrote:
>> the BLK in open() is not required:
>> - device_list is protected by device_list_lock
>> - spidev->user is only access with device_list_lock locked
>> - spidev->buffer is protected by spidev->buf_lock. Allocation & free is done
>> by the first/last user with device_list_lock locked.
>>
>> Signed-off-by: Sebastian Andrzej Siewior <sebastian-E0PNVn5OA6ohrxcnuTQ+TQ@public.gmane.org>
>
>In short: revert 609f9e92b570f390a457a81effe0af6b758dc582
yup
>which was not needed (and ISTR that it got a NAK so why it's
>in the tree is a puzzle).
It was for over an year in the tree without anyone noticing :)
Sebastian
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-09-10 19:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-10 13:04 [PATCH] spi/spidev: remove BLK Sebastian Andrzej Siewior
[not found] ` <20090910130409.GA23433-N26foeg2n7CSQxDm3FYtNwe+0vtP5+jfMa5aj3AfGnc@public.gmane.org>
2009-09-10 18:00 ` David Brownell
[not found] ` <200909101100.34332.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2009-09-10 19:41 ` Sebastian Andrzej Siewior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).