|
@@ -249,6 +249,7 @@ static void pwm_export_release(struct device *child)
|
|
|
static int pwm_export_child(struct device *parent, struct pwm_device *pwm)
|
|
|
{
|
|
|
struct pwm_export *export;
|
|
|
+ char *pwm_prop[2];
|
|
|
int ret;
|
|
|
|
|
|
if (test_and_set_bit(PWMF_EXPORTED, &pwm->flags))
|
|
@@ -276,6 +277,10 @@ static int pwm_export_child(struct device *parent, struct pwm_device *pwm)
|
|
|
export = NULL;
|
|
|
return ret;
|
|
|
}
|
|
|
+ pwm_prop[0] = kasprintf(GFP_KERNEL, "EXPORT=pwm%u", pwm->hwpwm);
|
|
|
+ pwm_prop[1] = NULL;
|
|
|
+ kobject_uevent_env(&parent->kobj, KOBJ_CHANGE, pwm_prop);
|
|
|
+ kfree(pwm_prop[0]);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -288,6 +293,7 @@ static int pwm_unexport_match(struct device *child, void *data)
|
|
|
static int pwm_unexport_child(struct device *parent, struct pwm_device *pwm)
|
|
|
{
|
|
|
struct device *child;
|
|
|
+ char *pwm_prop[2];
|
|
|
|
|
|
if (!test_and_clear_bit(PWMF_EXPORTED, &pwm->flags))
|
|
|
return -ENODEV;
|
|
@@ -296,6 +302,11 @@ static int pwm_unexport_child(struct device *parent, struct pwm_device *pwm)
|
|
|
if (!child)
|
|
|
return -ENODEV;
|
|
|
|
|
|
+ pwm_prop[0] = kasprintf(GFP_KERNEL, "UNEXPORT=pwm%u", pwm->hwpwm);
|
|
|
+ pwm_prop[1] = NULL;
|
|
|
+ kobject_uevent_env(&parent->kobj, KOBJ_CHANGE, pwm_prop);
|
|
|
+ kfree(pwm_prop[0]);
|
|
|
+
|
|
|
/* for device_find_child() */
|
|
|
put_device(child);
|
|
|
device_unregister(child);
|