OSDN Git Service

usb: phy: introduce usb_phy device type with its own uevent handler
authorGrzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
Mon, 31 May 2021 12:22:22 +0000 (14:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Jun 2021 11:55:00 +0000 (13:55 +0200)
commita8534cb092d7c19ab5ce9f2cd3f7fc1385a73664
tree8e4afd4b9e31d625a1fcdc35c09eb2976eed5736
parent309f5d7944627bd61550c880833a3e9c543018bb
usb: phy: introduce usb_phy device type with its own uevent handler

The USB charger type and status was already propagated to userspace
through kobject_uevent_env during charger notify work. Nevertheless the
uevent could be lost e.g. because it could be fired at an early kernel
boot stage, way before udev daemon or any other user-space app was able
to catch it. Registering uevent hook for introduced usb_phy_dev_type
will allow to query sysfs 'uevent' file to restore that information at
any time.

Reviewed-by: Peter Chen <peter.chen@kernel.org>
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
Link: https://lore.kernel.org/r/20210531122222.453628-1-grzegorz.jaszczyk@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/phy/phy.c