From: Christophe Ricard Subject: [PATCH v2 3/7] tpm/tpm_i2c_atmel: simplify patch to get tpm_chip from an i2c_client Date: Sat, 26 Mar 2016 08:00:11 +0100 Message-ID: <1458975615-8095-4-git-send-email-christophe-h.ricard@st.com> References: <1458975615-8095-1-git-send-email-christophe-h.ricard@st.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1458975615-8095-1-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org Cc: jean-luc.blanc-qxv4g6HH51o@public.gmane.org, ashley-fm2HMyfA2y6tG0bUXCXiUA@public.gmane.org, tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, christophe-h.ricard-qxv4g6HH51o@public.gmane.org, benoit.houyere-qxv4g6HH51o@public.gmane.org List-Id: tpmdd-devel@lists.sourceforge.net 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; } -- 2.5.0 ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140