[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6E21E5352C11B742B20C142EB499E048081B359F@TK5EX14MBXC126.redmond.corp.microsoft.com>
Date: Thu, 25 Aug 2011 22:20:32 +0000
From: KY Srinivasan <kys@...rosoft.com>
To: Greg KH <greg@...ah.com>
CC: "devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
"Haiyang Zhang" <haiyangz@...rosoft.com>,
"gregkh@...e.de" <gregkh@...e.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"virtualization@...ts.osdl.org" <virtualization@...ts.osdl.org>
Subject: RE: [PATCH 12/59] Staging: hv: vmbus: Cleanup vmbus_uevent() code
> -----Original Message-----
> From: Greg KH [mailto:greg@...ah.com]
> Sent: Thursday, August 25, 2011 5:15 PM
> To: KY Srinivasan
> Cc: devel@...uxdriverproject.org; Haiyang Zhang; gregkh@...e.de; linux-
> kernel@...r.kernel.org; virtualization@...ts.osdl.org
> Subject: Re: [PATCH 12/59] Staging: hv: vmbus: Cleanup vmbus_uevent() code
>
> On Thu, Aug 25, 2011 at 01:59:30PM -0700, Greg KH wrote:
> > On Thu, Aug 25, 2011 at 09:48:38AM -0700, K. Y. Srinivasan wrote:
> > > Now generate appropriate uevent based on the modalias string. As part of
> this,
> > > cleanup the existing uevent code.
> > >
> > > Signed-off-by: K. Y. Srinivasan <kys@...rosoft.com>
> > > Signed-off-by: Haiyang Zhang <haiyangz@...rosoft.com>
> > > ---
> > > drivers/staging/hv/vmbus_drv.c | 60 ++++++++--------------------------------
> > > 1 files changed, 12 insertions(+), 48 deletions(-)
> > >
> > > diff --git a/drivers/staging/hv/vmbus_drv.c
> b/drivers/staging/hv/vmbus_drv.c
> > > index b651968..a6e7dc5 100644
> > > --- a/drivers/staging/hv/vmbus_drv.c
> > > +++ b/drivers/staging/hv/vmbus_drv.c
> > > @@ -237,58 +237,22 @@ static struct device_attribute vmbus_device_attrs[]
> = {
> > > * This routine is invoked when a device is added or removed on the vmbus
> to
> > > * generate a uevent to udev in the userspace. The udev will then look at its
> > > * rule and the uevent generated here to load the appropriate driver
> > > + *
> > > + * The alias string will be of the form vmbus:guid where guid is the string
> > > + * representation of the device guid (each byte of the guid will be
> > > + * represented with two hex characters.
> > > */
> > > static int vmbus_uevent(struct device *device, struct kobj_uevent_env
> *env)
> > > {
> > > struct hv_device *dev = device_to_hv_device(device);
> > > - int ret;
> > > -
> > > - ret = add_uevent_var(env, "VMBUS_DEVICE_CLASS_GUID={"
> > > - "%02x%02x%02x%02x-%02x%02x-%02x%02x-"
> > > - "%02x%02x%02x%02x%02x%02x%02x%02x}",
> > > - dev->dev_type.b[3],
> > > - dev->dev_type.b[2],
> > > - dev->dev_type.b[1],
> > > - dev->dev_type.b[0],
> > > - dev->dev_type.b[5],
> > > - dev->dev_type.b[4],
> > > - dev->dev_type.b[7],
> > > - dev->dev_type.b[6],
> > > - dev->dev_type.b[8],
> > > - dev->dev_type.b[9],
> > > - dev->dev_type.b[10],
> > > - dev->dev_type.b[11],
> > > - dev->dev_type.b[12],
> > > - dev->dev_type.b[13],
> > > - dev->dev_type.b[14],
> > > - dev->dev_type.b[15]);
> > > -
> > > - if (ret)
> > > - return ret;
> > > + int i, ret;
> > > + char alias_name[((sizeof(struct hv_vmbus_device_id) + 1)) * 2];
> > >
> > > - ret = add_uevent_var(env, "VMBUS_DEVICE_DEVICE_GUID={"
> > > - "%02x%02x%02x%02x-%02x%02x-%02x%02x-"
> > > - "%02x%02x%02x%02x%02x%02x%02x%02x}",
> > > - dev->dev_instance.b[3],
> > > - dev->dev_instance.b[2],
> > > - dev->dev_instance.b[1],
> > > - dev->dev_instance.b[0],
> > > - dev->dev_instance.b[5],
> > > - dev->dev_instance.b[4],
> > > - dev->dev_instance.b[7],
> > > - dev->dev_instance.b[6],
> > > - dev->dev_instance.b[8],
> > > - dev->dev_instance.b[9],
> > > - dev->dev_instance.b[10],
> > > - dev->dev_instance.b[11],
> > > - dev->dev_instance.b[12],
> > > - dev->dev_instance.b[13],
> > > - dev->dev_instance.b[14],
> > > - dev->dev_instance.b[15]);
> > > - if (ret)
> > > - return ret;
> > > + for (i = 0; i < (sizeof(struct hv_vmbus_device_id) * 2); i += 2)
> > > + sprintf(&alias_name[i], "%02x", dev->dev_type.b[i/2]);
> >
> > I have to edit this to get it to work properly with the fact that I
> > added the driver_data field to hv_vmbus_device_id.
>
> You should have a copy of the patch I applied in your inbox now, can you
> verify I didn't mess it up?
Greg,
I don't think I got this mail. Could you resend the mail.
Regards,
K. Y
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists