lkml.org 
[lkml]   [2009]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] input/keyboard: new driver for ADP5520 MFD PMICs
    On Mon, 21 Sep 2009, Dmitry Torokhov wrote:

    > > + if (event & KP_INT) {
    > > + adp5520_read(dev->master, KP_INT_STAT_1, &reg_val_low);
    > > + adp5520_read(dev->master, KP_INT_STAT_2, &reg_val_high);
    > > +
    > > + keymask = (reg_val_high << 8) | reg_val_low;
    > > + /* Read twice to clear */
    > > + adp5520_read(dev->master, KP_INT_STAT_1, &reg_val_low);
    > > + adp5520_read(dev->master, KP_INT_STAT_2, &reg_val_high);
    > > + keymask |= (reg_val_high << 8) | reg_val_low;
    > > + adp5520_keys_report_event(dev, keymask, 1);
    > > + }
    > > +
    > > + if (event & KR_INT) {
    >
    > Why do you check the same condition twice?

    It actually doesn't seem to be the same condition (KP_INT vs. KR_INT), but
    it's difficult to say, as these constants are apparently added in some
    other patch I have no idea about.
    And the same for other constants used in the code ... the patch seems to
    be quite incomplete.

    --
    Jiri Kosina
    SUSE Labs, Novell Inc.



    \
     
     \ /
      Last update: 2009-09-22 09:35    [W:0.024 / U:62.064 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site