From patchwork Wed Aug 17 13:22:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 9285959 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4A80B60459 for ; Wed, 17 Aug 2016 13:22:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E88F29AD3 for ; Wed, 17 Aug 2016 13:22:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3301529AD9; Wed, 17 Aug 2016 13:22:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CEF0129AD3 for ; Wed, 17 Aug 2016 13:22:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752554AbcHQNWa (ORCPT ); Wed, 17 Aug 2016 09:22:30 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:32964 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752106AbcHQNW3 (ORCPT ); Wed, 17 Aug 2016 09:22:29 -0400 Received: by mail-wm0-f66.google.com with SMTP id o80so24145901wme.0; Wed, 17 Aug 2016 06:22:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=G6xeK5jhABNZVt5Q5gLiD3VIu+b6FFTriVnxPmCbmA8=; b=LTL8U+tfCv6Wg7tUiOt2wlioLW9J53dNxxFohYkv2azFuvc/fB043JFkgL5Dlt0Cl1 sIAl/6hzExNgF0DskcolitH6zFFYkfEM/335VvMdtQt03kagUqYTdNkOq2Gdj6/H33Xn QvgH37IQp2T5sD3jyYmS8UwsRWymuB/+tdEW2P+q3iv4hJAUU2vr4RIshP/4topZC2bT z15LEb9+vMte5Bu14VmjcoxqQd6P4pLeeiNCyuBFY1OPNjRE5jH3gAyAr8g0rVCMhh85 vCgRWkAtTRgs1FJB+MEEtl/M7Z1jley7b45QD4+fJf4nxAtBRGaWwRDAAMfL1shd6l2i rv0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=G6xeK5jhABNZVt5Q5gLiD3VIu+b6FFTriVnxPmCbmA8=; b=JcRIQ06U7INy02P18PcGLNTNj7cOotXSK4tYsyJ/Ak5ioc+3PzkwRPUKxiFBa2DERx cXMF34VobLekEouMWRZhFtO9g4FlINAWHy231NTFcfu/5Equmv0OvYtQBLSF0JKZW+kv Qx9ER5OGvoBh4izIF66WvKw/k4k8DXVojcusfKXmWu/nvBdhWvt7X14JiEdEb052WqNk ngfR0aY24nnIR1EasDYZhHi0dzBbgjk5S9CfuN7wMqQPeftc2CI11SU4K6a6/qkpUlcl QLrf2GaK9jGdSNbHJSHPsaa6cTlRLPw7y37q7B21/BBW+9QzmMqoqbfvQ+37IWAzybGw e36Q== X-Gm-Message-State: AEkoouttS+4i9BmEsGMvs1LAZAGqtkJug/Eej/nOpLNJXjvHKOMytJl90hWNx0ODKXjiAA== X-Received: by 10.194.38.166 with SMTP id h6mr42547138wjk.101.1471440148077; Wed, 17 Aug 2016 06:22:28 -0700 (PDT) Received: from Red.local (ANice-651-1-11-220.w86-203.abo.wanadoo.fr. [86.203.162.220]) by smtp.googlemail.com with ESMTPSA id c8sm31649303wjm.19.2016.08.17.06.22.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 17 Aug 2016 06:22:27 -0700 (PDT) From: LABBE Corentin To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, LABBE Corentin Subject: [PATCH 1/3] input: pixcir_i2c_ts: simplify code with of_device_get_match_data Date: Wed, 17 Aug 2016 15:22:12 +0200 Message-Id: <1471440134-23896-1-git-send-email-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.7.3 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The usage of of_device_get_match_data reduce the code size a bit. Furthermore, it is better to use a standard function for getting the match data. Signed-off-by: LABBE Corentin --- drivers/input/touchscreen/pixcir_i2c_ts.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c index d159e14..b0a2dc2 100644 --- a/drivers/input/touchscreen/pixcir_i2c_ts.c +++ b/drivers/input/touchscreen/pixcir_i2c_ts.c @@ -431,13 +431,7 @@ static const struct of_device_id pixcir_of_match[]; static int pixcir_parse_dt(struct device *dev, struct pixcir_i2c_ts_data *tsdata) { - const struct of_device_id *match; - - match = of_match_device(of_match_ptr(pixcir_of_match), dev); - if (!match) - return -EINVAL; - - tsdata->chip = (const struct pixcir_i2c_chip_data *)match->data; + tsdata->chip = of_device_get_match_data(dev); if (!tsdata->chip) return -EINVAL;