From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH 2/3] tpm: Get rid of chip->pdev Date: Sun, 14 Feb 2016 00:06:23 -0700 Message-ID: <20160214070623.GE9551@obsidianresearch.com> References: <1455321871-28296-1-git-send-email-jgunthorpe@obsidianresearch.com> <1455321871-28296-3-git-send-email-jgunthorpe@obsidianresearch.com> <56BF4E1F.2030208@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <56BF4E1F.2030208-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Stefan Berger Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: tpmdd-devel@lists.sourceforge.net On Sat, Feb 13, 2016 at 10:39:11AM -0500, Stefan Berger wrote: > >@@ -347,8 +347,8 @@ static int i2c_nuvoton_recv(struct tpm_chip *chip, u8 *buf, size_t count) > > */ > > static int i2c_nuvoton_send(struct tpm_chip *chip, u8 *buf, size_t len) > > { > >- struct device *dev = chip->pdev; > >- struct i2c_client *client = to_i2c_client(dev); > >+ struct device *dev = &chip->dev; > This looks wrong or are you fixing a bug here? chip->dev.parent ? No, in this function dev is only used for dev_err/etc so it should be changed, like every other dev_err/etc call in this patch. Expect for this use: > >+ struct i2c_client *client = to_i2c_client(chip->dev.parent); > > Does this need to be replaced ? Which must stay as the parent. Jason ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751757AbcBNHG2 (ORCPT ); Sun, 14 Feb 2016 02:06:28 -0500 Received: from quartz.orcorp.ca ([184.70.90.242]:33188 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751410AbcBNHG1 (ORCPT ); Sun, 14 Feb 2016 02:06:27 -0500 Date: Sun, 14 Feb 2016 00:06:23 -0700 From: Jason Gunthorpe To: Stefan Berger Cc: Jarkko Sakkinen , tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [tpmdd-devel] [PATCH 2/3] tpm: Get rid of chip->pdev Message-ID: <20160214070623.GE9551@obsidianresearch.com> References: <1455321871-28296-1-git-send-email-jgunthorpe@obsidianresearch.com> <1455321871-28296-3-git-send-email-jgunthorpe@obsidianresearch.com> <56BF4E1F.2030208@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56BF4E1F.2030208@linux.vnet.ibm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 13, 2016 at 10:39:11AM -0500, Stefan Berger wrote: > >@@ -347,8 +347,8 @@ static int i2c_nuvoton_recv(struct tpm_chip *chip, u8 *buf, size_t count) > > */ > > static int i2c_nuvoton_send(struct tpm_chip *chip, u8 *buf, size_t len) > > { > >- struct device *dev = chip->pdev; > >- struct i2c_client *client = to_i2c_client(dev); > >+ struct device *dev = &chip->dev; > This looks wrong or are you fixing a bug here? chip->dev.parent ? No, in this function dev is only used for dev_err/etc so it should be changed, like every other dev_err/etc call in this patch. Expect for this use: > >+ struct i2c_client *client = to_i2c_client(chip->dev.parent); > > Does this need to be replaced ? Which must stay as the parent. Jason