Re: [tpmdd-devel] [PATCH] tpm: fix rollback/cleanup before tpm_chip_register()

2016-02-05 Thread Jarkko Sakkinen
On Wed, Feb 03, 2016 at 05:34:37PM -0700, Jason Gunthorpe wrote: > On Wed, Feb 03, 2016 at 08:02:35AM -0800, Jarkko Sakkinen wrote: > > > Would s/the platform device/the parent device/ be better? > > Yes > > > > > + /* Associate character device with the platform device only > > > >

Re: [tpmdd-devel] [PATCH] tpm: fix rollback/cleanup before tpm_chip_register()

2016-02-05 Thread Jarkko Sakkinen
On Wed, Feb 03, 2016 at 05:34:37PM -0700, Jason Gunthorpe wrote: > On Wed, Feb 03, 2016 at 08:02:35AM -0800, Jarkko Sakkinen wrote: > > > Would s/the platform device/the parent device/ be better? > > Yes > > > > > + /* Associate character device with the platform device only > > > >

Re: [tpmdd-devel] [PATCH] tpm: fix rollback/cleanup before tpm_chip_register()

2016-02-03 Thread Jason Gunthorpe
On Wed, Feb 03, 2016 at 08:02:35AM -0800, Jarkko Sakkinen wrote: > Would s/the platform device/the parent device/ be better? Yes > > > + /* Associate character device with the platform device only after > > > + * it is properly initialized. > > > + */ > > > + dev_set_drvdata(pdev, chip); > >

Re: [tpmdd-devel] [PATCH] tpm: fix rollback/cleanup before tpm_chip_register()

2016-02-03 Thread Jarkko Sakkinen
On Tue, Feb 02, 2016 at 04:13:53PM -0700, Jason Gunthorpe wrote: > On Sat, Jan 30, 2016 at 06:05:42PM -0800, Jarkko Sakkinen wrote: > > The release-callback is not used before the device is attached to the > > device hierarchy. This caused resources not to cleanup properly if the > > device driver

Re: [tpmdd-devel] [PATCH] tpm: fix rollback/cleanup before tpm_chip_register()

2016-02-03 Thread Jason Gunthorpe
On Wed, Feb 03, 2016 at 08:02:35AM -0800, Jarkko Sakkinen wrote: > Would s/the platform device/the parent device/ be better? Yes > > > + /* Associate character device with the platform device only after > > > + * it is properly initialized. > > > + */ > > > + dev_set_drvdata(pdev, chip); > >

Re: [tpmdd-devel] [PATCH] tpm: fix rollback/cleanup before tpm_chip_register()

2016-02-03 Thread Jarkko Sakkinen
On Tue, Feb 02, 2016 at 04:13:53PM -0700, Jason Gunthorpe wrote: > On Sat, Jan 30, 2016 at 06:05:42PM -0800, Jarkko Sakkinen wrote: > > The release-callback is not used before the device is attached to the > > device hierarchy. This caused resources not to cleanup properly if the > > device driver

Re: [tpmdd-devel] [PATCH] tpm: fix rollback/cleanup before tpm_chip_register()

2016-02-02 Thread Jason Gunthorpe
On Sat, Jan 30, 2016 at 06:05:42PM -0800, Jarkko Sakkinen wrote: > The release-callback is not used before the device is attached to the > device hierarchy. This caused resources not to cleanup properly if the > device driver initialization failed before tpm_chip_register(). This commentary is

Re: [tpmdd-devel] [PATCH] tpm: fix rollback/cleanup before tpm_chip_register()

2016-02-02 Thread Jason Gunthorpe
On Sat, Jan 30, 2016 at 06:05:42PM -0800, Jarkko Sakkinen wrote: > The release-callback is not used before the device is attached to the > device hierarchy. This caused resources not to cleanup properly if the > device driver initialization failed before tpm_chip_register(). This commentary is