From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752813AbcICGW3 (ORCPT ); Sat, 3 Sep 2016 02:22:29 -0400 Received: from mga03.intel.com ([134.134.136.65]:60178 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751360AbcICGW1 (ORCPT ); Sat, 3 Sep 2016 02:22:27 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,274,1470726000"; d="scan'208";a="1045173217" Date: Sat, 3 Sep 2016 09:22:22 +0300 From: Jarkko Sakkinen To: Jason Gunthorpe Cc: Peter Huewe , Marcel Selhorst , "moderated list:TPM DEVICE DRIVER" , open list Subject: Re: [PATCH] tpm: move struct tpm_class_ops to drivers/char/tpm/tpm.h Message-ID: <20160903062221.GA2061@intel.com> References: <1472852886-7640-1-git-send-email-jarkko.sakkinen@linux.intel.com> <20160902221122.GA1897@obsidianresearch.com> <20160902223522.GA27454@intel.com> <20160902224531.GC1897@obsidianresearch.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160902224531.GC1897@obsidianresearch.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 02, 2016 at 04:45:31PM -0600, Jason Gunthorpe wrote: > On Sat, Sep 03, 2016 at 01:35:22AM +0300, Jarkko Sakkinen wrote: > > On Fri, Sep 02, 2016 at 04:11:22PM -0600, Jason Gunthorpe wrote: > > > On Sat, Sep 03, 2016 at 12:48:03AM +0300, Jarkko Sakkinen wrote: > > > > The struct tpm_class_ops is not used outside the TPM driver. Thus, > > > > it can be safely move to drivers/char/tpm/tpm.h. > > > > > > No, this is the wrong direction. > > > > > > The goal is to make things more like other subsystems, so we should be > > > moving struct tpm_chip into the public header, and that requires ops > > > to be in the public header. > > > > > > This is why I put ops here in the first place. > > > > I'm OK with it as long as you explain why this is necessary. I see no > > use for them outside the TPM subsystem. > > That is because the users out side the subsystem are Doing it Wrong. > > eg this: > > extern int tpm_is_tpm2(u32 chip_num); > > Should be: > > extern int tpm_is_tpm2(struct tpm_chip *chip); > > And same for all other examples. > > The 'chip_num' thing is bonkers. OK, how would one get the chip instance? /Jarkko