Messages in this thread | | | Date | Fri, 12 Mar 2010 21:57:43 +0100 | From | Florian Mickler <> | Subject | Re: [PATCH 2/2] enhance sysfs rfkill interface |
| |
On Fri, 12 Mar 2010 10:22:09 -0800 Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> On Fri, Mar 12, 2010 at 07:03:08PM +0100, florian@mickler.org wrote: > > > > +static ssize_t rfkill_hard_show(struct device *dev, > > + struct device_attribute *attr, > > + char *buf) > > +{ > > + struct rfkill *rfkill = to_rfkill(dev); > > + unsigned long flags; > > + u32 state; > > + > > + spin_lock_irqsave(&rfkill->lock, flags); > > + state = rfkill->state; > > + spin_unlock_irqrestore(&rfkill->lock, flags); > > Why exactly is this lock needed?
The rfkill state is updated from multiple contexts... Am I overlooking smth obvious here?
cheers, Flo
| |