From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shawn Guo Subject: Re: [06/10,V2] spi: Add SPI driver for mx233/mx28 Date: Wed, 1 Aug 2012 16:20:26 +0800 Message-ID: <20120801082024.GJ1672@S2100-06.ap.freescale.net> References: <1341555449-17507-6-git-send-email-marex@denx.de> <201208010810.37652.marex@denx.de> <20120801063936.GC2764@roeck-us.net> <201208010845.19361.marex@denx.de> <20120801074051.GG1672@S2100-06.ap.freescale.net> <20504.56543.699097.320114@ipc1.ka-ro> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: Fabio Estevam , Rob Herring , Marek Vasut , Stefano Babic , Dong, spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, Chris Ball , Aisheng , Guenter Roeck , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: Lothar =?iso-8859-1?Q?Wa=DFmann?= Return-path: Content-Disposition: inline In-Reply-To: <20504.56543.699097.320114-VjFSrY7JcPWvSplVBqRQBQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: linux-spi.vger.kernel.org On Wed, Aug 01, 2012 at 09:38:07AM +0200, Lothar Wa=DFmann wrote: > Shawn Guo writes: > > On Wed, Aug 01, 2012 at 08:45:19AM +0200, Marek Vasut wrote: > > > > I must be missing something. Why do almost all spi drivers call it= in the > > > > error path, even if there is no call to spi_master_get ? > > > = > > > To push the refcounting to 0, to deallocate the device, I'd say ... > > > = > > It's not going to work if spi_master_put is called without > > spi_master_get being called before that. > > = > spi_alloc_master() calls device_initialize() which resuires a > device_put() (called from spi_master_put()) to free the device. > = Ah, indeed. I missed that kref_init() will initialize the refcount to 1. Thanks, Shawn ---------------------------------------------------------------------------= --- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and = threat landscape has changed and how IT managers can respond. Discussions = will include endpoint security, mobile security and the latest in malware = threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/