From: Sylvain Munaut <tnt@246tNt.com>
To: Hoang-Nam Nguyen <hnguyen@linux.vnet.ibm.com>
Cc: pmac@au1.ibm.com, fenkes@de.ibm.com,
linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
paulus@samba.org, johnrose@us.ibm.com
Subject: Re: [PATCH 2.6.21-rc1] ibmebus: Support dynamic addition and removal of adapters
Date: Thu, 15 Feb 2007 21:11:42 +0100 [thread overview]
Message-ID: <45D4BE7E.7000109@246tNt.com> (raw)
In-Reply-To: <200702151755.13009.hnguyen@linux.vnet.ibm.com>
Hoang-Nam Nguyen wrote:
> Additionally, the uevent interface is now implemented in the driver.
>
Mmmh, I posted a patch that added a common uevent interface for all
of_device based
bus. And that kinda clash with this one.
I think it's a much cleaner approach to make it as common as possible.
But as
"ibm,loc_code" is local to this bus it's not handled by my code. Is it
necessary
to match the correct driver ?
By the way you generate your uevent string is wrong imho:
- it doesn't account for the fact that there can be multiple strings in
"compatible".
- it can be a lot nicer if you use the helper add_uevent_var to fill
the event.
- you generate a string "ibmebus:T%s:S%s:L%s" but did you just invent that
string ? I see no support for the "ibmebus" marker in mod_devicetable.h, nor
in file2alias.c nor any where else for that matter.
Sylvain
>
> +static int ibmebus_uevent(struct device *dev, char **envp, int num_envp,
> + char *buffer, int buffer_size)
> +{
> + const struct ibmebus_dev *ebus_dev = to_ibmebus_dev(dev);
> + char *name, *cp, *loc_code;
> + int length;
> +
> + if (!num_envp)
> + return -ENOMEM;
> +
> + if (!ebus_dev->ofdev.node)
> + return -ENODEV;
> +
> + name = (char *)get_property(ebus_dev->ofdev.node, "name", NULL);
> + cp = (char *)get_property(ebus_dev->ofdev.node, "compatible", NULL);
> + loc_code = (char *)get_property(ebus_dev->ofdev.node,
> + "ibm,loc-code", NULL);
> + if (!(name && cp && loc_code))
> + return -ENODEV;
> +
> + envp[0] = buffer;
> + length = scnprintf(buffer, buffer_size,
> + "MODALIAS=ibmebus:T%s:S%s:L%s",
> + name, cp, loc_code);
> + if (buffer_size - length <= 0)
> + return -ENOMEM;
> + envp[1] = NULL;
> +
> + return 0;
> +}
> +
>
WARNING: multiple messages have this Message-ID (diff)
From: Sylvain Munaut <tnt@246tNt.com>
To: Hoang-Nam Nguyen <hnguyen@linux.vnet.ibm.com>
Cc: paulus@samba.org, linuxppc-dev@ozlabs.org,
linux-kernel@vger.kernel.org, johnrose@us.ibm.com,
fenkes@de.ibm.com, pmac@au1.ibm.com
Subject: Re: [PATCH 2.6.21-rc1] ibmebus: Support dynamic addition and removal of adapters
Date: Thu, 15 Feb 2007 21:11:42 +0100 [thread overview]
Message-ID: <45D4BE7E.7000109@246tNt.com> (raw)
In-Reply-To: <200702151755.13009.hnguyen@linux.vnet.ibm.com>
Hoang-Nam Nguyen wrote:
> Additionally, the uevent interface is now implemented in the driver.
>
Mmmh, I posted a patch that added a common uevent interface for all
of_device based
bus. And that kinda clash with this one.
I think it's a much cleaner approach to make it as common as possible.
But as
"ibm,loc_code" is local to this bus it's not handled by my code. Is it
necessary
to match the correct driver ?
By the way you generate your uevent string is wrong imho:
- it doesn't account for the fact that there can be multiple strings in
"compatible".
- it can be a lot nicer if you use the helper add_uevent_var to fill
the event.
- you generate a string "ibmebus:T%s:S%s:L%s" but did you just invent that
string ? I see no support for the "ibmebus" marker in mod_devicetable.h, nor
in file2alias.c nor any where else for that matter.
Sylvain
>
> +static int ibmebus_uevent(struct device *dev, char **envp, int num_envp,
> + char *buffer, int buffer_size)
> +{
> + const struct ibmebus_dev *ebus_dev = to_ibmebus_dev(dev);
> + char *name, *cp, *loc_code;
> + int length;
> +
> + if (!num_envp)
> + return -ENOMEM;
> +
> + if (!ebus_dev->ofdev.node)
> + return -ENODEV;
> +
> + name = (char *)get_property(ebus_dev->ofdev.node, "name", NULL);
> + cp = (char *)get_property(ebus_dev->ofdev.node, "compatible", NULL);
> + loc_code = (char *)get_property(ebus_dev->ofdev.node,
> + "ibm,loc-code", NULL);
> + if (!(name && cp && loc_code))
> + return -ENODEV;
> +
> + envp[0] = buffer;
> + length = scnprintf(buffer, buffer_size,
> + "MODALIAS=ibmebus:T%s:S%s:L%s",
> + name, cp, loc_code);
> + if (buffer_size - length <= 0)
> + return -ENOMEM;
> + envp[1] = NULL;
> +
> + return 0;
> +}
> +
>
next prev parent reply other threads:[~2007-02-15 20:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-15 16:55 [PATCH 2.6.21-rc1] ibmebus: Support dynamic addition and removal of adapters Hoang-Nam Nguyen
2007-02-15 16:55 ` Hoang-Nam Nguyen
2007-02-15 19:57 ` John Rose
2007-02-15 19:57 ` John Rose
2007-02-17 0:27 ` Joachim Fenkes
2007-02-17 0:27 ` Joachim Fenkes
2007-02-20 17:25 ` John Rose
2007-02-20 17:25 ` John Rose
2007-02-20 22:36 ` Joachim Fenkes
2007-02-20 22:36 ` Joachim Fenkes
2007-02-15 20:11 ` Sylvain Munaut [this message]
2007-02-15 20:11 ` Sylvain Munaut
2007-02-17 2:24 ` Joachim Fenkes
2007-02-17 2:24 ` Joachim Fenkes
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=45D4BE7E.7000109@246tNt.com \
--to=tnt@246tnt.com \
--cc=fenkes@de.ibm.com \
--cc=hnguyen@linux.vnet.ibm.com \
--cc=johnrose@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
--cc=pmac@au1.ibm.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.