lkml.org 
[lkml]   [2017]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v3 03/19] HID: logitech-hidpp: make sure we only register one battery per device
    Date
    Simple check to add, huge improvement :)

    Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

    ---

    no changes in v3

    no changes in v2
    ---
    drivers/hid/hid-logitech-hidpp.c | 3 +++
    1 file changed, 3 insertions(+)

    diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
    index 4aaf237..1cda29e 100644
    --- a/drivers/hid/hid-logitech-hidpp.c
    +++ b/drivers/hid/hid-logitech-hidpp.c
    @@ -828,6 +828,9 @@ static int hidpp_initialize_battery(struct hidpp_device *hidpp)
    {
    int ret;

    + if (hidpp->battery.ps)
    + return 0;
    +
    if (hidpp->protocol_major >= 2) {
    ret = hidpp20_initialize_battery(hidpp);
    if (ret == 0)
    --
    2.9.3
    \
     
     \ /
      Last update: 2017-03-27 17:03    [W:2.737 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site