From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753088AbbHCLF4 (ORCPT ); Mon, 3 Aug 2015 07:05:56 -0400 Received: from mx2.suse.de ([195.135.220.15]:38420 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752249AbbHCLFy (ORCPT ); Mon, 3 Aug 2015 07:05:54 -0400 Date: Mon, 3 Aug 2015 13:05:50 +0200 From: Jean Delvare To: Javier Martinez Canillas Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH 06/27] misc: eeprom: Export I2C module alias information in missing drivers Message-ID: <20150803130550.12487244@endymion.delvare> In-Reply-To: <1438273132-20926-7-git-send-email-javier@osg.samsung.com> References: <1438273132-20926-1-git-send-email-javier@osg.samsung.com> <1438273132-20926-7-git-send-email-javier@osg.samsung.com> Organization: SUSE Linux X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.23; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Javier, On Thu, 30 Jul 2015 18:18:31 +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. 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. > > Signed-off-by: Javier Martinez Canillas > > --- > > drivers/misc/eeprom/eeprom.c | 1 + > drivers/misc/eeprom/max6875.c | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/drivers/misc/eeprom/eeprom.c b/drivers/misc/eeprom/eeprom.c > index b432873def96..4bb54e1c40a7 100644 > --- a/drivers/misc/eeprom/eeprom.c > +++ b/drivers/misc/eeprom/eeprom.c > @@ -203,6 +203,7 @@ static const struct i2c_device_id eeprom_id[] = { > { "eeprom", 0 }, > { } > }; > +MODULE_DEVICE_TABLE(i2c, eeprom_id); > > static struct i2c_driver eeprom_driver = { > .driver = { I seem to recall this one is missing on purpose. The legacy eeprom driver is deprecated in favor of the at24 driver, so no one should declare "eeprom" i2c devices and thus the module alias is useless. So I would leave the legacy eeprom driver alone. The only feature the at24 driver is missing is device auto-detection as far as I know. Maybe it should be added to ease the transition. Or maybe not, I admit I'm not sure. > diff --git a/drivers/misc/eeprom/max6875.c b/drivers/misc/eeprom/max6875.c > index 580ff9df5529..c74920cc3d18 100644 > --- a/drivers/misc/eeprom/max6875.c > +++ b/drivers/misc/eeprom/max6875.c > @@ -197,6 +197,7 @@ static const struct i2c_device_id max6875_id[] = { > { "max6875", 0 }, > { } > }; > +MODULE_DEVICE_TABLE(i2c, max6875_id); > > static struct i2c_driver max6875_driver = { > .driver = { That one is needed, I agree. Reviewed-by: Jean Delvare -- Jean Delvare SUSE L3 Support