From patchwork Wed Mar 23 07:55:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Ricard X-Patchwork-Id: 601130 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qVMLy332xz9s5l for ; Wed, 23 Mar 2016 18:55:54 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1aiddt-0005qd-BJ; Wed, 23 Mar 2016 07:55:49 +0000 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1aidds-0005qS-7B for tpmdd-devel@lists.sourceforge.net; Wed, 23 Mar 2016 07:55:48 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of gmail.com designates 74.125.82.68 as permitted sender) client-ip=74.125.82.68; envelope-from=christophe.ricard@gmail.com; helo=mail-wm0-f68.google.com; Received: from mail-wm0-f68.google.com ([74.125.82.68]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1aiddr-0006rn-Ay for tpmdd-devel@lists.sourceforge.net; Wed, 23 Mar 2016 07:55:48 +0000 Received: by mail-wm0-f68.google.com with SMTP id r129so2201614wmr.2 for ; Wed, 23 Mar 2016 00:55:47 -0700 (PDT) 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:in-reply-to :references; bh=9K0Ba0Z24j5EBQbj9/NIVZmfLPSEAvhmD6Ut0OxLj1o=; b=gjOG/JxcyPv64Oz75mxm4zSI6IofK4v0WZVNR+CxpRSslmj7fucw/kYGakNZhGU4XF C9pFX6t5mfpdAriKaJJiIXx5yr+PYw6Qq2PJGZYF2uW8EpQyryUx8C6cgMyc/m1B0HRR piM3lB9eJof6qYpQj1Y40VhetTGMehS5GBRQh3jRGQg5VELiNpX0bOokQw53f411f2Gd vRKHVLvVWlX1SvvErR5rYmiNPCIhgFR1dBcc8SYpEl5UAR/2r9+5MLrZkEO9jluryVKS ViXdkZuz8Q7INFEe9Bx8Ybg8WZRdXRULATf32pCOJXI2hcMAjZawAzgyZKKUEFV1hOr7 tvoQ== X-Gm-Message-State: AD7BkJJFIQV5cXNsZqo48sxSe1K7HpRY8LdYR1lhSywFV9YM1E3AGNl0fQG5yRx6VmLpjA== X-Received: by 10.194.60.100 with SMTP id g4mr1698325wjr.30.1458719741363; Wed, 23 Mar 2016 00:55:41 -0700 (PDT) Received: from localhost.localdomain (ax113-6-78-236-204-66.fbx.proxad.net. [78.236.204.66]) by smtp.gmail.com with ESMTPSA id bg1sm1196194wjc.27.2016.03.23.00.55.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Mar 2016 00:55:40 -0700 (PDT) From: Christophe Ricard X-Google-Original-From: Christophe Ricard To: jarkko.sakkinen@linux.intel.com Date: Wed, 23 Mar 2016 08:55:32 +0100 Message-Id: <1458719734-13752-2-git-send-email-christophe-h.ricard@st.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1458719734-13752-1-git-send-email-christophe-h.ricard@st.com> References: <1458719734-13752-1-git-send-email-christophe-h.ricard@st.com> X-Spam-Score: -1.6 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (christophe.ricard[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-Headers-End: 1aiddr-0006rn-Ay Cc: jean-luc.blanc@st.com, ashley@ashleylai.com, tpmdd-devel@lists.sourceforge.net, christophe-h.ricard@st.com, benoit.houyere@st.com Subject: [tpmdd-devel] [PATCH 1/3] tpm/st33zp24/i2c: Drop two useless checks in ACPI probe path X-BeenThere: tpmdd-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Tpm Device Driver maintainance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: tpmdd-devel-bounces@lists.sourceforge.net When st33zp24_i2c_acpi_request_resources() gets called we already know that the entries in ->acpi_match_table have matched ACPI ID of the device. In addition I2C client pointer cannot be NULL in any case (otherwise I2C core would not call ->probe() for the driver in the first place). Drop the two useless checks from the driver. Signed-off-by: Christophe Ricard Reviewed-by: Jarkko Sakkinen --- drivers/char/tpm/st33zp24/i2c.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/char/tpm/st33zp24/i2c.c b/drivers/char/tpm/st33zp24/i2c.c index f179aad..f8e8123 100644 --- a/drivers/char/tpm/st33zp24/i2c.c +++ b/drivers/char/tpm/st33zp24/i2c.c @@ -113,19 +113,8 @@ static const struct st33zp24_phy_ops i2c_phy_ops = { static int st33zp24_i2c_acpi_request_resources(struct i2c_client *client) { struct st33zp24_i2c_phy *phy = i2c_get_clientdata(client); - const struct acpi_device_id *id; struct gpio_desc *gpiod_lpcpd; - struct device *dev; - - if (!client) - return -EINVAL; - - dev = &client->dev; - - /* Match the struct device against a given list of ACPI IDs */ - id = acpi_match_device(dev->driver->acpi_match_table, dev); - if (!id) - return -ENODEV; + struct device *dev = &client->dev; /* Get LPCPD GPIO from ACPI */ gpiod_lpcpd = devm_gpiod_get_index(dev, "TPM IO LPCPD", 1,