From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753212AbbHCLno (ORCPT ); Mon, 3 Aug 2015 07:43:44 -0400 Received: from lb1-smtp-cloud6.xs4all.net ([194.109.24.24]:55241 "EHLO lb1-smtp-cloud6.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752203AbbHCLnm (ORCPT ); Mon, 3 Aug 2015 07:43:42 -0400 Message-ID: <1438602218.3726.45.camel@tiscali.nl> Subject: Re: [PATCH 15/27] regulator: fan53555: Export I2C module alias information From: Paul Bolle To: Javier Martinez Canillas Cc: Liam Girdwood , Mark Brown , linux-kernel@vger.kernel.org Date: Mon, 03 Aug 2015 13:43:38 +0200 In-Reply-To: <1438273132-20926-16-git-send-email-javier@osg.samsung.com> References: <1438273132-20926-1-git-send-email-javier@osg.samsung.com> <1438273132-20926-16-git-send-email-javier@osg.samsung.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.4 (3.16.4-2.fc22) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Javier, (Mark already applied this patch. Still, I couldn't wrap my head around it. So maybe you'd still like to answer a question or two, basically to educate me.) On do, 2015-07-30 at 18:18 +0200, Javier Martinez Canillas wrote: > The I2C core always reports the MODALIAS uevent as "i2c: regardless if the driver was matched using the I2C id_table or the > of_match_table. It's the other way round, I think. Both MODULE_DEVICE_TABLE() macros add a set of aliases to this module. These aliases are used by userspace to load the fan53555 module if it notices a uevent that contains the proper "MODALIAS=" string. Only after this module is loaded by userspace will the I2C id_table and the of_match_table be available to match this driver to the hardware found in the machine and, if matching hardware is found, call fan53555_regulator_probe() to get this module to actually do something. That being said, before this patch the fan53555 module contained these aliases: alias: of:N*T*Csilergy,syr828* alias: of:N*T*Csilergy,syr827* alias: of:N*T*Cfcs,fan53555* While this patch ad these two aliases: alias: i2c:syr82x alias: i2c:fan53555 Now I don't have an "of" or "i2c" capable machine at hand, which makes it a bit hard to figure out how all of this is supposed to fit together. But I'm guessing that parsing a device tree blob that contains strings like compatible = "silergy,syr828" would add strings like MODALIAS=of:N[...]T[...]Csilergy,syr828 to the related uevents. (Likewise for the two other aliases.) Doesn't that happen here? > So the driver needs to export the I2C table and this > be built into the module or udev won't have the necessary information > to auto load the correct module when the device is added. s/the correct module/this module/, right? > --- a/drivers/regulator/fan53555.c > +++ b/drivers/regulator/fan53555.c > +MODULE_DEVICE_TABLE(i2c, fan53555_id); As I said above this patch adds two aliases to the fan53555 module: alias: i2c:syr82x alias: i2c:fan53555 But neither the string "fan53555" nor the string "syr82x" generate interesting hits in current linux-next. Are these strings perhaps only used in out of tree device tree source files? Thanks, Paul Bolle