From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from outmx033.isp.belgacom.be (outmx033.isp.belgacom.be [195.238.6.170]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id 9F2D5DDEC9 for ; Wed, 28 Mar 2007 20:59:13 +1000 (EST) Received: from outmx033.isp.belgacom.be (localhost.localdomain [127.0.0.1]) by outmx033.isp.belgacom.be (8.13.4/8.13.4/Debian-3sarge3) with ESMTP id l2SAx5Zu012089 for ; Wed, 28 Mar 2007 12:59:06 +0200 Message-ID: <460A4A6C.1060309@246tNt.com> Date: Wed, 28 Mar 2007 12:58:52 +0200 From: Sylvain Munaut MIME-Version: 1.0 To: Johannes Berg Subject: Re: [PATCH 08/10] macintosh: Use the new of_device common uevent handler References: <11713184081457-git-send-email-tnt@246tNt.com> <11713184091057-git-send-email-tnt@246tNt.com> <11713184101239-git-send-email-tnt@246tNt.com> <11713184112187-git-send-email-tnt@246tNt.com> <11713184132161-git-send-email-tnt@246tNt.com> <11713184141191-git-send-email-tnt@246tNt.com> <11713184152189-git-send-email-tnt@246tNt.com> <11713184171985-git-send-email-tnt@246tNt.com> <11713184182928-git-send-email-tnt@246tNt.com> <1174977009.14065.0.camel@localhost.localdomain> <4608C390.5080205@246tNt.com> <1175077759.5151.48.camel@johannes.berg> In-Reply-To: <1175077759.5151.48.camel@johannes.berg> Content-Type: text/plain; charset=ISO-8859-1 Cc: Paul Mackerras , Linux PPC Dev ML List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Johannes Berg wrote: > On Tue, 2007-03-27 at 09:11 +0200, Sylvain Munaut wrote: > >> I had a look at sound/aoa/soundbus/i2sbus/i2sbus-core.c , which is the >> only part of aoa with of_device_id and I see that it uses the >> MODULE_ALIAS directly : >> MODULE_ALIAS("of:Ni2sTi2sC"); >> instead of using >> MODULE_DEVICE_TABLE(of, i2sbus_match); >> and letting modpost do the job. Because that module alias is not the one >> that's gonna be generated by modpost. > > Can you elaborate on that for me? If that's the incorrect thing to do I > should probably change that :) To avoid to the driver writer the burden of writing the module_alias himself, there is a mechanism to do it automatically. You just add MODULE_DEVICE_TABLE(of, i2sbus_match); to your driver, with "of" being the bus type and i2sbus_match the match table used when registering the driver. And during the modpost step of module compilation, the module_device_table will be use to magically generate the module_alias string. This also has the advantages that if the format of that string changes, you don't have to go change all the driver code but just the "of" bus handler in modpost. Sylvain