From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout3.w1.samsung.com (mailout3.w1.samsung.com [210.118.77.13]) by ozlabs.org (Postfix) with ESMTP id 14E21B70CD for ; Sat, 31 Jul 2010 01:25:24 +1000 (EST) MIME-version: 1.0 Content-type: text/plain; charset=utf-8; format=flowed; delsp=yes Received: from eu_spt2 ([210.118.77.13]) by mailout3.w1.samsung.com (Sun Java(tm) System Messaging Server 6.3-8.04 (built Jul 29 2009; 32bit)) with ESMTP id <0L6D0055SMDHNA80@mailout3.w1.samsung.com> for linuxppc-dev@ozlabs.org; Fri, 30 Jul 2010 16:15:17 +0100 (BST) Received: from linux.samsung.com ([106.116.38.10]) by spt2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0L6D00AJMMDFZH@spt2.w1.samsung.com> for linuxppc-dev@ozlabs.org; Fri, 30 Jul 2010 16:15:17 +0100 (BST) Date: Fri, 30 Jul 2010 17:16:46 +0200 From: =?utf-8?B?TWljaGHFgiBOYXphcmV3aWN6?= Subject: Re: [PATCH RFC] usb gadget: introduce usb_gadget_probe_driver In-reply-to: <1280501361-13410-1-git-send-email-u.kleine-koenig@pengutronix.de> To: linux-usb@vger.kernel.org, =?utf-8?Q?Uwe_Kleine-K=C3=B6nig?= Message-id: References: <1280501361-13410-1-git-send-email-u.kleine-koenig@pengutronix.de> Cc: Cliff Cai , Mark Brown , Dan Carpenter , Tony Lindgren , Nicolas Ferre , linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org, Julia Lawall , Philipp Zabel , Felipe Balbi , Andrea Gelmini , Robert Jarzmik , Fabien Chouteau , Dinh Nguyen , David Brownell , Vladimir Zapolskiy , Sergei Shtylyov , Vincent Sanders , Marc Singer , =?utf-8?Q?Andr=C3=A9_Goddard_Rosa?= , Alan Stern , Sean MacLennan , Russell King , Tobias Klauser , Anatolij Gustschin , Marc Kleine-Budde , Eirik Aanonsen , Mike Frysinger , Thomas Dahlmann , linux-geode@lists.infradead.org, Ben Dooks , Magnus Damm , Anton Vorontsov , Andrew Victor , linux-arm-kernel@lists.infradead.org, Eric Miao , =?utf-8?Q?N=C3=A9meth_M=C3=A1rton?= , Jiri Kosina , Yoshihiro Shimoda , Greg Kroah-Hartman , Harro Haan , FUJITA Tomonori , H Hartley Sweeten , Paul Mundt , Tejun Heo , Andrew Morton , Cory Maccarrone List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Fri, 30 Jul 2010 16:49:14 +0200, Uwe Kleine-K=C3=B6nig wrote: > This is like usb_gadget_register_driver with the only difference that = it > gets the bind function as parameter instead of using driver->bind. Th= is > allows fixing section mismatches like > > WARNING: drivers/usb/gadget/g_printer.o(.data+0xc): Section mismatch = in > reference from the variable printer_driver to the function > .init.text:printer_bind() > The variable printer_driver references > the function __init printer_bind() > > by using usb_gadget_probe_driver with driver->bind =3D NULL. When all= > drivers are fixed to use the new function the bind member of struct > usb_gadget_driver can go away. > > Signed-off-by: Uwe Kleine-K=C3=B6nig > Cc: Michal Nazarewicz > Cc: Greg Kroah-Hartman > --- > Hello, > > there is an alternative patch in Greg's tree [1], but IMHO mine is > better as it doesn't need __ref. > > Thoughts? Personally I don't see advantage of this over changing the __init to __r= ef. Or am I missing something? I see your patch as an unnecessary API chang= e. The way I understand it, __ref was introduced exactly for cases like thi= s one where function is referenced from "normal" data but used only during= init. Could you try to clarify for me why you think your solution is better then mine? -- = Best regards, _ _ | Humble Liege of Serenely Enlightened Majesty of o' \,=3D./ `o | Computer Science, Micha=C5=82 "mina86" Nazarewicz (o o) +----[mina86*mina86.com]---[mina86*jabber.org]----ooO--(_)--Ooo--