From patchwork Fri Mar 25 21:25:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Ricard X-Patchwork-Id: 8673091 Return-Path: X-Original-To: patchwork-tpmdd-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0FFD19F65E for ; Fri, 25 Mar 2016 21:26:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 34F7720340 for ; Fri, 25 Mar 2016 21:26:19 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 38ED420351 for ; Fri, 25 Mar 2016 21:26:18 +0000 (UTC) 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 1ajZFH-00027s-I7; Fri, 25 Mar 2016 21:26:15 +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 1ajZFG-00027j-Gt for tpmdd-devel@lists.sourceforge.net; Fri, 25 Mar 2016 21:26:14 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of gmail.com designates 74.125.82.67 as permitted sender) client-ip=74.125.82.67; envelope-from=christophe.ricard@gmail.com; helo=mail-wm0-f67.google.com; Received: from mail-wm0-f67.google.com ([74.125.82.67]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1ajZFF-0005UR-KW for tpmdd-devel@lists.sourceforge.net; Fri, 25 Mar 2016 21:26:14 +0000 Received: by mail-wm0-f67.google.com with SMTP id 139so456966wmn.2 for ; Fri, 25 Mar 2016 14:26:13 -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=SbawLWxE0EF+nedz6DyvEIrrMZFDnCf4OGN6DEnLaMI=; b=V3sG5vPDVvkOOLcYWW7DBtImbbTQfBeqrXV3B8wEcmYQRX0QqsSYeRatKJkX8eSHMh 9ZKns5WU4xI64mNbzizRP4DWFAweRgcgmVfsCwdlf1C0XVtLwqVpHgOgFshOk9pjeQJs C5An9fURcu2FXztUrriuzcMPrOIbhyiOodxX+QMgakTSKrIOIHq4krjCTJxoEt4Sn9on jn+F238qPabX1T4P/3OGfqwI5x3qIfLAFtdLhoBifm2LZQCTmwlX6cO0C6GvnzKFaPAy +YjKLn8hYSBDK1twHJVu7SApFO12B5d/g/BITT9Mn5tqyolBzLTTlDNAEHC2W0uCva1d LenQ== X-Gm-Message-State: AD7BkJLu2vygMxWW4PuLMmQmwLFke/UhhlmJuwxpjhl3GBBolf8iGDpVMmRjHO9azqtzmQ== X-Received: by 10.28.143.9 with SMTP id r9mr431975wmd.37.1458941167653; Fri, 25 Mar 2016 14:26:07 -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 jf6sm13562740wjb.2.2016.03.25.14.26.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Mar 2016 14:26:06 -0700 (PDT) From: Christophe Ricard X-Google-Original-From: Christophe Ricard To: jarkko.sakkinen@linux.intel.com Date: Fri, 25 Mar 2016 22:25:56 +0100 Message-Id: <1458941160-4437-3-git-send-email-christophe-h.ricard@st.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1458941160-4437-1-git-send-email-christophe-h.ricard@st.com> References: <1458941160-4437-1-git-send-email-christophe-h.ricard@st.com> X-Spam-Score: -1.6 (-) X-Headers-End: 1ajZFF-0005UR-KW 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 2/6] tpm/tpm_i2c_atmel: simplify patch to get tpm_chip from an i2c_client 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 X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,HK_RANDOM_ENVFROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP i2c_get_clientdata allows to simplify the current way to retrieve a tpm_chip structure. Signed-off-by: Christophe Ricard --- drivers/char/tpm/tpm_i2c_atmel.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/char/tpm/tpm_i2c_atmel.c b/drivers/char/tpm/tpm_i2c_atmel.c index f311aaf..5426c9d 100644 --- a/drivers/char/tpm/tpm_i2c_atmel.c +++ b/drivers/char/tpm/tpm_i2c_atmel.c @@ -191,8 +191,7 @@ static int i2c_atmel_probe(struct i2c_client *client, static int i2c_atmel_remove(struct i2c_client *client) { - struct device *dev = &(client->dev); - struct tpm_chip *chip = dev_get_drvdata(dev); + struct tpm_chip *chip = i2c_get_clientdata(client); tpm_chip_unregister(chip); return 0; }