From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Buesch Subject: Re: [PATCH 1/3] Blackfin ethernet driver: on chip ethernet MAC controller driver Date: Sun, 15 Jul 2007 11:36:04 +0200 Message-ID: <200707151136.05223.mb@bu3sch.de> References: <1184438993.3140.23.camel@roc-laptop> <200707142138.36619.mb@bu3sch.de> <1184491016.3140.52.camel@roc-laptop> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Cc: Jeff Garzik , LKML , netdev@vger.kernel.org, Andrew Morton To: bryan.wu@analog.com Return-path: Received: from static-ip-62-75-166-246.inaddr.intergenia.de ([62.75.166.246]:42538 "EHLO vs166246.vserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756672AbXGOJhW (ORCPT ); Sun, 15 Jul 2007 05:37:22 -0400 In-Reply-To: <1184491016.3140.52.camel@roc-laptop> Content-Disposition: inline Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Sunday 15 July 2007 11:16:56 Bryan Wu wrote: > In current Blackfin DMA allocation/free, the return value from > bfin_mac_alloc() is used as the dma_handle, here it is the > tx_desc/rx_desc. > The "dma_handle" is useless in the following code. I think a comment has to be added, at least, as it's very confusing. > This is some magic code for PHY ID. In the future, we will rewrite some > code based on kernel phy abstraction layer to support more phy device. Ok, nice idea. > > Unwind the allocations above, if registering fails. > > > > In fact, it is safe. Because if registering fails, bf537mac_probe will > return none zero to bfin_mac_probe which will do free_netdev. Hm, weren't there some DMA allocations, too? Are they free'd properly? -- Greetings Michael.