Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751711AbdFOF0r (ORCPT ); Thu, 15 Jun 2017 01:26:47 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46680 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750791AbdFOF0q (ORCPT ); Thu, 15 Jun 2017 01:26:46 -0400 Date: Thu, 15 Jun 2017 07:26:36 +0200 From: Greg KH To: "Edward A. James" Cc: linux-kernel@vger.kernel.org, bradleyb@fuzziesquirrel.com, jk@ozlabs.org, cbostic@linux.vnet.ibm.com, joel@jms.id.au, andrew@aj.id.au Subject: Re: [PATCH linux] drivers/fsi: Add SBEFIFO FSI client device driver Message-ID: <20170615052636.GB29481@kroah.com> References: <1497469647-4608-1-git-send-email-eajames@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1497469647-4608-1-git-send-email-eajames@us.ibm.com> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 647 Lines: 23 On Wed, Jun 14, 2017 at 02:47:27PM -0500, Edward A. James wrote: > +struct sbefifo { > + struct timer_list poll_timer; > + struct fsi_device *fsi_dev; > + struct miscdevice mdev; > + wait_queue_head_t wait; > + struct list_head link; > + struct list_head xfrs; > + struct kref kref; > + spinlock_t lock; > + char name[32]; > + int idx; > + int rc; > +}; You have a misc device, a pointer to a fsi_device, and a kref in this structure. Which one actually does the reference counting? It seems there are 3 different ways it could happen. That's not right at all, and ripe for lots and lots of confusion. Only use one please. thanks, greg k-h