From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Berger Subject: Re: [PATCH 2/3] tpm: Get rid of chip->pdev Date: Sat, 13 Feb 2016 10:39:11 -0500 Message-ID: <56BF4E1F.2030208@linux.vnet.ibm.com> References: <1455321871-28296-1-git-send-email-jgunthorpe@obsidianresearch.com> <1455321871-28296-3-git-send-email-jgunthorpe@obsidianresearch.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1455321871-28296-3-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Jason Gunthorpe , Jarkko Sakkinen , tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: tpmdd-devel@lists.sourceforge.net On 02/12/2016 07:04 PM, Jason Gunthorpe wrote: > This is a hold over from before the struct device conversion. > > - All prints should be using &chip->dev, which is the Linux > standard. This changes prints to use tpm0 as the device name, > not the PnP/etc ID. > - The few places involving sysfs/modules that really do need the > parent just use chip->dev.parent instead > - We no longer need to get_device(pdev) in any places since it is no > longer used by any of the code. The kref on the parent is held > by the device core during device_add and dropped in device_del > > Signed-off-by: Jason Gunthorpe > --- > @@ -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 ? > + struct i2c_client *client = to_i2c_client(chip->dev.parent); Does this need to be replaced ? Stefan ------------------------------------------------------------------------------ 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 S1751059AbcBMPjQ (ORCPT ); Sat, 13 Feb 2016 10:39:16 -0500 Received: from e33.co.us.ibm.com ([32.97.110.151]:45170 "EHLO e33.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750890AbcBMPjP (ORCPT ); Sat, 13 Feb 2016 10:39:15 -0500 X-IBM-Helo: d03dlp02.boulder.ibm.com X-IBM-MailFrom: stefanb@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Subject: Re: [tpmdd-devel] [PATCH 2/3] tpm: Get rid of chip->pdev To: Jason Gunthorpe , Jarkko Sakkinen , tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <1455321871-28296-1-git-send-email-jgunthorpe@obsidianresearch.com> <1455321871-28296-3-git-send-email-jgunthorpe@obsidianresearch.com> From: Stefan Berger Message-ID: <56BF4E1F.2030208@linux.vnet.ibm.com> Date: Sat, 13 Feb 2016 10:39:11 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1455321871-28296-3-git-send-email-jgunthorpe@obsidianresearch.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16021315-0009-0000-0000-000012580794 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/12/2016 07:04 PM, Jason Gunthorpe wrote: > This is a hold over from before the struct device conversion. > > - All prints should be using &chip->dev, which is the Linux > standard. This changes prints to use tpm0 as the device name, > not the PnP/etc ID. > - The few places involving sysfs/modules that really do need the > parent just use chip->dev.parent instead > - We no longer need to get_device(pdev) in any places since it is no > longer used by any of the code. The kref on the parent is held > by the device core during device_add and dropped in device_del > > Signed-off-by: Jason Gunthorpe > --- > @@ -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 ? > + struct i2c_client *client = to_i2c_client(chip->dev.parent); Does this need to be replaced ? Stefan