From patchwork Sat Mar 26 07:00:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Ricard X-Patchwork-Id: 8674221 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 17E8C9F44D for ; Sat, 26 Mar 2016 07:00:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5173620260 for ; Sat, 26 Mar 2016 07:00:36 +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 6718A2025A for ; Sat, 26 Mar 2016 07:00:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ajiD2-0007uB-Kx; Sat, 26 Mar 2016 07:00:32 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ajiD1-0007u5-88 for tpmdd-devel@lists.sourceforge.net; Sat, 26 Mar 2016 07:00:31 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of gmail.com designates 74.125.82.66 as permitted sender) client-ip=74.125.82.66; envelope-from=christophe.ricard@gmail.com; helo=mail-wm0-f66.google.com; Received: from mail-wm0-f66.google.com ([74.125.82.66]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1ajiD0-000578-Fn for tpmdd-devel@lists.sourceforge.net; Sat, 26 Mar 2016 07:00:31 +0000 Received: by mail-wm0-f66.google.com with SMTP id p65so8210853wmp.1 for ; Sat, 26 Mar 2016 00:00:30 -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=AyFvtOZfo+XFmWGwTAZAw8ccbhH0qFAHLpx3sNtmmlQYW4IakxwauW3BEHsK/4c3jI ttO3v1T03GbHjb5NVW/ZUJa1wm2VZbQci0zjrPcBNyDMAwWx5NQfmPoSE3s2s5m88mm9 4JtpM2m4/xY78M34Mt6+m4PFrRVUU2LS9lTkBJ5T3H6eo9BHg6T4+ckI5H48UsfKtLKL s5VbUZWi7fDL0yciaf02/ffeRvYP1rO4FHpYO5XxHeapAA0gzAG7W88//2nnKf8Y6xya 75wzTRY7D3205dNJRa8yXE/DiqnudtmYNe+5oE3ACDhbpjUGGFgUb5T3eBPzdoIV+YnF bMhg== X-Gm-Message-State: AD7BkJIil0cTH4koRXMH0iZ5NZwOhRXt5V46y0AtlWXQh8CXY7JZX2YzeoWtIiAAv1PwyQ== X-Received: by 10.28.1.199 with SMTP id 190mr496107wmb.3.1458975624533; Sat, 26 Mar 2016 00:00:24 -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 lz5sm14978102wjb.5.2016.03.26.00.00.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 26 Mar 2016 00:00:23 -0700 (PDT) From: Christophe Ricard X-Google-Original-From: Christophe Ricard To: jarkko.sakkinen@linux.intel.com Date: Sat, 26 Mar 2016 08:00:11 +0100 Message-Id: <1458975615-8095-4-git-send-email-christophe-h.ricard@st.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1458975615-8095-1-git-send-email-christophe-h.ricard@st.com> References: <1458975615-8095-1-git-send-email-christophe-h.ricard@st.com> X-Spam-Score: -1.6 (-) X-Headers-End: 1ajiD0-000578-Fn 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 v2 3/7] 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; }