public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Jon Smirl <jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Kay Sievers <kay.sievers-tD+1rO4QERM@public.gmane.org>,
	linuxppc-dev list
	<linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.org>,
	Paul Mundt <lethal-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org>,
	Linux I2C <i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org>,
	Scott Wood <scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Subject: Re: [PATCH 1/2] i2c: Add support for device alias names
Date: Mon, 28 Apr 2008 17:42:20 +0200	[thread overview]
Message-ID: <20080428174220.0860ab25@hyperion.delvare> (raw)
In-Reply-To: <9e4733910804280743q2de1da62m120c607b200cafa0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi Jon,

On Mon, 28 Apr 2008 10:43:35 -0400, Jon Smirl wrote:
> On 4/28/08, Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> wrote:
> >  One thing I am still not happy with is that the aliases created have a
> >  trailing "*":
> >
> >  $ /sbin/modinfo lm90
> >  filename:       /lib/modules/2.6.25-git11/kernel/drivers/hwmon/lm90.ko
> >  author:         Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
> >  description:    LM90/ADM1032 driver
> >  license:        GPL
> >  vermagic:       2.6.25-git11 mod_unload
> >  depends:        hwmon
> >  alias:          i2c:lm90*
> >  alias:          i2c:adm1032*
> >  alias:          i2c:lm99*
> >  alias:          i2c:lm86*
> >  alias:          i2c:max6657*
> >  alias:          i2c:adt7461*
> >  alias:          i2c:max6680*
> >  $
> >
> >  This would cause trouble if one I2C chip name matches the beginning of
> >  another I2C chip name and both chips are supported by different
> >  drivers. This has yet to be seen, but still, I'd like to see this
> >  problem fixed quickly.
> 
> 
> Trailing wildcard is always added by file2alias.c:
> 
>                 if (do_entry(mod->name, symval+i, alias)) {
>                         /* Always end in a wildcard, for future extension */
>                         if (alias[strlen(alias)-1] != '*')
>                                 strcat(alias, "*");
> 
> 
> Can't the match order be controlled in the makefile? For example if
> you had lm905* and lm90*, put lm905* into into the makefile first
> which will cause it to appear in the alias file first. But that would
> still cause problems if only lm90 was built and you had a lm905
> device.

That's too trickly and fragile - I'd rather make sure that wrong
matches just can't happen.

> 
> Alternatively you could change the code to append something like a
> period to the name string.
> 
> sprintf(alias, I2C_MODULE_PREFIX "%s.", id->name);

Similar to what Kay proposed. It works and we'll do that if we have to,
but if we can just get rid of the "*" I'd rather do that.

> 
> I was using macros to alter the name strings to move the PowerPC names
> into their own namespace.
> 


-- 
Jean Delvare

_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

  parent reply	other threads:[~2008-04-28 15:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-28  9:30 [PATCH 0/2] i2c: Add support for device alias names Jean Delvare
2008-04-28  9:39 ` [PATCH 1/2] " Jean Delvare
2008-04-28 14:43   ` Jon Smirl
     [not found]     ` <9e4733910804280743q2de1da62m120c607b200cafa0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-04-28 15:42       ` Jean Delvare [this message]
2008-04-28 15:07   ` Kay Sievers
     [not found]     ` <1209395245.3666.9.camel-YbU/o29LwNHN0uC3ymp8PA@public.gmane.org>
2008-04-28 15:40       ` Jean Delvare
2008-04-28 16:16         ` Kay Sievers
2008-05-01  8:04           ` Jean Delvare
     [not found]             ` <20080501100409.1b04fdb7-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-05-01 15:51               ` Kay Sievers
2008-04-28  9:53 ` [PATCH 2/2] i2c: Convert most new-style drivers to use module aliasing Jean Delvare
     [not found] ` <20080428113052.6d024bda-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-04-28 15:35   ` [PATCH 0/2] i2c: Add support for device alias names Wolfram Sang
     [not found]     ` <20080428153543.GB4353-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2008-04-28 20:24       ` Jochen Friedrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080428174220.0860ab25@hyperion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org \
    --cc=jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=kay.sievers-tD+1rO4QERM@public.gmane.org \
    --cc=lethal-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org \
    --cc=linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.org \
    --cc=scottwood-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox