Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp539651iob; Wed, 4 May 2022 02:33:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXrH4ALLaAtvm3h2aK7HzwIFoZ2ljP6VBTwyco8klR6MAqw1UPIAdIr3UwyqJliwJMGX+Z X-Received: by 2002:a17:907:a06f:b0:6f4:d336:6baa with SMTP id ia15-20020a170907a06f00b006f4d3366baamr412050ejc.638.1651656805925; Wed, 04 May 2022 02:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651656805; cv=none; d=google.com; s=arc-20160816; b=UDx8xqXv+93yicFoZ/k5f4ku8GU96GZ3Ylh0JM55X8U6F3GMx9p12O/OumFigLvQvO 3uu8rjjsIC4N28DXQ3fXALOlkjj36oen8FMQbUIQer7vIgDGD8pH18cR5Qz/quPCSsqS iS+jVYF7mzdRizm16pbTN0UQYVpUZY9u7dOnMKpqgL1gLGbc/g0kIUi8wl+JLKUjWIee rN/P4SN69rC64ojxn5bfNR4HphAPdZsB820HGxGAabnuEXVetv8jPsvCTfaI6OPgPqu1 RAzMR4BFizsjNkprYqnAZf2yfri9bBhoG8cGNX15odJYUGnGFXWQa84Cn7nZ02Wroujo e4nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:user-agent:from :references:in-reply-to:mime-version:dkim-signature; bh=84DT2KN71CBoOLaIwfBUH1VIJvywBdMYoVKhebNA7Z0=; b=uz5LImYxqlOrldAdOnWQgAmRHXjax01YIFML2vLSvYtGRUqDhDT8Qo1QV4tM/NSGoT KBfi6NOuk8RPwAupag2glropvAQMU/QJJhblym0OL9bLpo+vnKR+exEeAE58dnfw0tJT fKx7VM+08quP3WVrxgBK1dSI17tiU9PBhnGkYubL7XaPHfjY/SmZGyAn+niQt6C2697w Ij0Dn2sMdWLjw7rrP2+p/ihnEa3dip3CXFU8KqmeQfBGpTJxAE4gHIL5fGZC8oVIIlR/ SBSSxy2ItwKBUPbulO4pGwJywq9t10YzV90ZaonhdO/mKFSGFq1+7M6Uy/yn9qvqwIWx tOAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=e+2jsHN+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dz9-20020a0564021d4900b00427d0e5c909si6211182edb.414.2022.05.04.02.33.02; Wed, 04 May 2022 02:33:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=e+2jsHN+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242036AbiECTrJ (ORCPT + 99 others); Tue, 3 May 2022 15:47:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240224AbiECTrH (ORCPT ); Tue, 3 May 2022 15:47:07 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C883D35DC5 for ; Tue, 3 May 2022 12:43:33 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id m23so23286159ljb.8 for ; Tue, 03 May 2022 12:43:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:user-agent:date:message-id :subject:to:cc; bh=84DT2KN71CBoOLaIwfBUH1VIJvywBdMYoVKhebNA7Z0=; b=e+2jsHN+LGeoxthUIsOCFTpN/YQD1tLtP5DXh+qPTs7i1ROxuVi1Ik9l9Le5Ad3BEw ZkY+XGJkfzyXZtHOt4X3XeSMKy0RejAPjrlNsBVyynuEh4IpJav8ULo1pZO0q7fmC7NW 5PlZapfM2xTIY/rc03QCq+CdtM6iTB0VRcVwk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from :user-agent:date:message-id:subject:to:cc; bh=84DT2KN71CBoOLaIwfBUH1VIJvywBdMYoVKhebNA7Z0=; b=pi9xKuTesNfjtspGqIlUQdTGPQ5ETvzc/grkNNR/zUo8x+Mzz2hr1Wo0HFxBIWJLrl PjCbXNOkM62PrWNTPtT8q8Betie4wCkhB4C9YkoioP/FZ/HPQBoFxh9+dqIlp93dRfmq ruy2lznlze28JLx/qWEdgxrqCkOYk5oVDLewLcw2lXU8RUge8jGOlySQ2hP4D09dA6Dc w5EVG2mV+7VL3FVZ7nCyFHKqtV+HZx4paXuYto5Juw61ob5eesNZPpjdJ+df7bHJZO3D QQNEzQP8a4ZR88bscMml2TQbOxN2ND3Q9DcL1D6g4PkFbYAI5pBb9JmGcNn2xOLL/wHw TmCg== X-Gm-Message-State: AOAM532ec9tgiBrYF70l9+sjjSieDmBUb9JTyruWqJXaE0+oogOCL4R2 F92zoIc8GAItKeU7hRlWDeTJdp+jBRwmPiTMHCuRJw== X-Received: by 2002:a2e:b8c2:0:b0:250:61c6:8398 with SMTP id s2-20020a2eb8c2000000b0025061c68398mr4466282ljp.378.1651607012174; Tue, 03 May 2022 12:43:32 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 3 May 2022 12:43:31 -0700 MIME-Version: 1.0 In-Reply-To: References: <20220503042242.3597561-1-swboyd@chromium.org> <20220503042242.3597561-3-swboyd@chromium.org> From: Stephen Boyd User-Agent: alot/0.10 Date: Tue, 3 May 2022 12:43:31 -0700 Message-ID: Subject: Re: [PATCH v3 2/2] Input: cros-ec-keyb - skip keyboard registration w/o cros-ec-keyb compatible To: Doug Anderson Cc: Dmitry Torokhov , LKML , patches@lists.linux.dev, chrome-platform@lists.linux.dev, Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, Benson Leung , Guenter Roeck , Hsin-Yi Wang , "Joseph S. Barrera III" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Doug Anderson (2022-05-03 08:09:11) > On Mon, May 2, 2022 at 9:22 PM Stephen Boyd wrote: > > > > diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c > > index eef909e52e23..04c550aaf897 100644 > > --- a/drivers/input/keyboard/cros_ec_keyb.c > > +++ b/drivers/input/keyboard/cros_ec_keyb.c > > @@ -536,14 +536,11 @@ static int cros_ec_keyb_register_matrix(struct cros_ec_keyb *ckdev) > > u32 *physmap; > > u32 key_pos; > > unsigned int row, col, scancode, n_physmap; > > + bool register_keyboard; > > > > - /* > > - * No rows and columns? There isn't a matrix but maybe there are > > - * switches to register in cros_ec_keyb_register_bs() because > > - * this is a detachable device. > > - */ > > - if (!device_property_present(dev, "keypad,num-rows") && > > - !device_property_present(dev, "keypad,num-cols")) > > + /* Skip matrix registration if no keyboard */ > > + register_keyboard = device_get_match_data(dev); > > + if (!register_keyboard) > > return 0; > > I'm a little on the fence about the local variable. It could have been > shorter as: > > /* Skip matrix registration if no keyboard */ > if (!device_get_match_data(dev)) > > ...but I guess the "register_keyboard" maybe makes it more a little > more obvious? Yes, the idea is to make it more obvious to the point that the comment isn't needed. I'll change it to 'has_keyboard' and then drop the comment! > > In any case, I'm happy either way: > > Reviewed-by: Douglas Anderson