Re: [PATCH] usb: udc: add gadget state kobject uevent

From: Rong Wang
Date: Thu Jul 18 2013 - 06:54:45 EST


Hi Felipe,

Here's the patch. If you are OK with it, I'll send it to the list formally.
Thanks.

-------------------------------------------------------------------------------------------------

usb: gadget: udc-core: make udc state attribute name consistent

The name of udc state attribute file under sysfs is
registered as "state", while usb_gadget_set_state
take it as "status" when it's going to update.
Here it is made consistent as "state".

Signed-off-by: Rong Wang <Rong.Wang@xxxxxxx>

diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
index ffd8fa5..5514822 100644
--- a/drivers/usb/gadget/udc-core.c
+++ b/drivers/usb/gadget/udc-core.c
@@ -105,7 +105,7 @@ void usb_gadget_set_state(struct usb_gadget *gadget,
enum usb_device_state state)
{
gadget->state = state;
- sysfs_notify(&gadget->dev.kobj, NULL, "status");
+ sysfs_notify(&gadget->dev.kobj, NULL, "state");
}
EXPORT_SYMBOL_GPL(usb_gadget_set_state);

On Thu, Jul 18, 2013 at 6:10 PM, Felipe Balbi <balbi@xxxxxx> wrote:
> On Thu, Jul 18, 2013 at 05:28:19PM +0800, Rong Wang wrote:
>> Hi Felipe,
>>
>> Thanks, I'll test the patch.
>>
>> But sysfs_notify(&gadget->dev.kobj, NULL, "status"), status or state ?
>> I notice that DEVICE_ATTR(state, S_IRUGO, usb_gadget_state_show, NULL)
>
> good eyes, please send a patch which I'll queue on this -rc and Cc:
> <stable@xxxxxxxxxxxxxxx>.
>
> I'll rewrite my patch on top of the patched -rc later.
>
> --
> balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/