Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754309AbbKYQhO (ORCPT ); Wed, 25 Nov 2015 11:37:14 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:51075 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754209AbbKYQhI (ORCPT ); Wed, 25 Nov 2015 11:37:08 -0500 Date: Wed, 25 Nov 2015 08:37:07 -0800 From: Greg KH To: Andy Lutomirski Cc: "linux-kernel@vger.kernel.org" Subject: Re: Releasing bus devices? Message-ID: <20151125163707.GA5363@kroah.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Content-Length: 1030 Lines: 24 On Wed, Nov 25, 2015 at 08:21:36AM -0800, Andy Lutomirski wrote: > I'm writing a bus driver, and I'm confused. Yeah, writing a new bus is a major pain, I keep meaning to work on the api every year or so when I have to write a new one, but then I just suffer through it and never get around to it :( > If I create a class and class devices, I can set a release method on > the class. But if I create a bus, there's no bus_type.dev_release. > Am I really supposed to manually set .release on each struct device > that I enumerate? If so, why? No, you shouldn't have to do that, the "struct device_type" that is assigned to your device has a .release callback, that is what will be called. Make sure you set that for each device you create for your bus. hope this helps, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/