Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1572591imw; Tue, 5 Jul 2022 11:47:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s8Qgk0JGW/px6FZQqHQlkpLv2pL58ILlzV4I0raVB1YJSpouj+EF4IZAmaTWt+3KTOq0XD X-Received: by 2002:a17:90b:682:b0:1e3:142:a562 with SMTP id m2-20020a17090b068200b001e30142a562mr46061887pjz.91.1657046837413; Tue, 05 Jul 2022 11:47:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657046837; cv=none; d=google.com; s=arc-20160816; b=lfeZQAFo7WSODlu/npCiFZxQUQPl8v4lwwAeN75qFjIB+WfrCMtvjj7i2s+4V7LZ2w o4hcKWA76UjVnn4AA2yRXz+P1UbrMlWHDbWIZdP67d8++wMqWDDO3z8puZAEP/3cKwUW dEy3sG/Obk/JnrXQfxdcq64/NwZ1zUKIdIl7T+1Qbts7pVaqTDkTBxvtFcQ1bTysaNUd gKQgm6vjet8JUWutvOHYXD/zAPj88rF6WFmMV3pet3RfPeZ85RGcApJv+TL63AVWhZy+ JB1YK5WX6tjhmJKWy1V4iwFnMv3jnGE0+T2MPj4HyIVjIaPqPsLEI/Mx7iBnbv9BrV9R LnOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=mb3NAzE8tCaJbKKNracmHJSjlDkiA4iYPh4Z9ceBAak=; b=1Bl7Lx2gWwbTmZoGSTsi0f7VI66mCY+UcCzqNcZpEdG+kH68CooNfUy/J+fdh9Lhtd Uz5Smc6feCGfOiXOL3o/hvKdT9nDcd68BrcnCYi/EE+6yv6/q8AfKd0RPT6DeBTl2PPy jZ6uc4VBVK8saG/LySQyy29DCVPvlurAGXutWj2WpMYrmrBrRaiRaWgUuDayX/E4jKpr DmoogH2UotXoKkxX3XeQPZzUL1l/1REueP4DZ5jDimZPsAKDZ/YKrx3EYLIBW56Z9BiG lmWjm3WTowZDlfRsMKx/JhUEWvtdBWEqosScV8bC9sd+TYHzJ69ZEFRtNGHGoTiX8g/C oZkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Xv32nHfA; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bj14-20020a056a00318e00b005289c0a0550si1967830pfb.278.2022.07.05.11.47.04; Tue, 05 Jul 2022 11:47:17 -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=@intel.com header.s=Intel header.b=Xv32nHfA; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231487AbiGESGF (ORCPT + 99 others); Tue, 5 Jul 2022 14:06:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229520AbiGESGE (ORCPT ); Tue, 5 Jul 2022 14:06:04 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EEC0E2D; Tue, 5 Jul 2022 11:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657044363; x=1688580363; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=dQ7CpIOtBJlN0Msqc+NPtDbr2+VNA+oYzyJ96WNcmaI=; b=Xv32nHfAuEQqz4NTdk7mutFx1pPgg2/bqBO5xUwOA5KBhT0ug12ylFWb xor8QHibARDS2VsHyg2+flkOirI/5GHWYrBxKUXc2tIvf/hjv9qM12zzL BoUxT9BHrf0Wh1V+V+uYEHt7DC3K0CTw1slCIYTZHAl4+3tD+WvYHHttd MEFw1J5Tn04V5Y/cPURN96TnpozJMj3dwoxLGV2itb10oeDveWvXdurjU raHf6NELl24mee5jVPVuZVlcqUwG5HTLuEiH7BcM+560z3ThmoNzr+BYf 6M6Fxoykt/bXAO9IN7lN1I5RchvMFgioAZxEzq64j8pUf9MJukCQbLb/B w==; X-IronPort-AV: E=McAfee;i="6400,9594,10399"; a="347414608" X-IronPort-AV: E=Sophos;i="5.92,247,1650956400"; d="scan'208";a="347414608" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2022 11:02:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,247,1650956400"; d="scan'208";a="660649549" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 05 Jul 2022 11:02:47 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 67E6E1A0; Tue, 5 Jul 2022 21:02:54 +0300 (EEST) From: Andy Shevchenko To: Dmitry Torokhov , Hans de Goede , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bastien Nocera , Andy Shevchenko Subject: [PATCH v1 1/1] Input: goodix - switch use of acpi_gpio_get_*_resource() APIs Date: Tue, 5 Jul 2022 21:02:51 +0300 Message-Id: <20220705180252.963-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 No need to open code functionality that is provided by the acpi_gpio_get_irq_resource() and acpi_gpio_get_io_resource(). Signed-off-by: Andy Shevchenko --- drivers/input/touchscreen/goodix.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c index 3ad9870db108..cc52f0d21dbb 100644 --- a/drivers/input/touchscreen/goodix.c +++ b/drivers/input/touchscreen/goodix.c @@ -822,22 +822,16 @@ static int goodix_resource(struct acpi_resource *ares, void *data) struct device *dev = &ts->client->dev; struct acpi_resource_gpio *gpio; - switch (ares->type) { - case ACPI_RESOURCE_TYPE_GPIO: - gpio = &ares->data.gpio; - if (gpio->connection_type == ACPI_RESOURCE_GPIO_TYPE_INT) { - if (ts->gpio_int_idx == -1) { - ts->gpio_int_idx = ts->gpio_count; - } else { - dev_err(dev, "More then one GpioInt resource, ignoring ACPI GPIO resources\n"); - ts->gpio_int_idx = -2; - } + if (acpi_gpio_get_irq_resource(ares, &gpio)) { + if (ts->gpio_int_idx == -1) { + ts->gpio_int_idx = ts->gpio_count; + } else { + dev_err(dev, "More then one GpioInt resource, ignoring ACPI GPIO resources\n"); + ts->gpio_int_idx = -2; } ts->gpio_count++; - break; - default: - break; - } + } else if (acpi_gpio_get_io_resource(ares, &gpio)) + ts->gpio_count++; return 0; } -- 2.35.1