hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/lib/kobject_uevent.c
....@@ -200,7 +200,7 @@
200200
201201 r = kobject_action_type(buf, count, &action, &action_args);
202202 if (r) {
203
- msg = "unknown uevent action string\n";
203
+ msg = "unknown uevent action string";
204204 goto out;
205205 }
206206
....@@ -212,7 +212,7 @@
212212 r = kobject_action_args(action_args,
213213 count - (action_args - buf), &env);
214214 if (r == -EINVAL) {
215
- msg = "incorrect uevent action arguments\n";
215
+ msg = "incorrect uevent action arguments";
216216 goto out;
217217 }
218218
....@@ -224,7 +224,7 @@
224224 out:
225225 if (r) {
226226 devpath = kobject_get_path(kobj, GFP_KERNEL);
227
- printk(KERN_WARNING "synth uevent: %s: %s",
227
+ pr_warn("synth uevent: %s: %s\n",
228228 devpath ?: "unknown device",
229229 msg ?: "failed to send uevent");
230230 kfree(devpath);
....@@ -240,6 +240,7 @@
240240 ops = kobj_ns_ops(kobj);
241241 if (ops) {
242242 const void *init_ns, *ns;
243
+
243244 ns = kobj->ktype->namespace(kobj);
244245 init_ns = ops->initial_ns();
245246 return ns != init_ns;
....@@ -391,6 +392,7 @@
391392 ops = kobj_ns_ops(kobj);
392393 if (!ops && kobj->kset) {
393394 struct kobject *ksobj = &kobj->kset->kobj;
395
+
394396 if (ksobj->parent != NULL)
395397 ops = kobj_ns_ops(ksobj->parent);
396398 }
....@@ -518,21 +520,6 @@
518520 return 0;
519521 }
520522
521
- if (IS_ENABLED(CONFIG_ARCH_ROCKCHIP) &&
522
- IS_ENABLED(CONFIG_FREEZER) &&
523
- IS_ENABLED(CONFIG_ANDROID)) {
524
- /*
525
- * Android healthd try to listen power_supply subsystem uevent,
526
- * but which will block system from suspend on big.LITTLE system
527
- * because thermal_cooling_device_unregister will called when
528
- * cpufreq_exit. So ignore this uevent when suspend.
529
- */
530
- extern bool pm_freezing;
531
-
532
- if (pm_freezing && !strcmp(subsystem, "thermal"))
533
- return 0;
534
- }
535
-
536523 /* environment buffer */
537524 env = kzalloc(sizeof(struct kobj_uevent_env), GFP_KERNEL);
538525 if (!env)
....@@ -598,7 +585,7 @@
598585
599586 mutex_lock(&uevent_sock_mutex);
600587 /* we will send an event, so request a new sequence number */
601
- retval = add_uevent_var(env, "SEQNUM=%llu", (unsigned long long)++uevent_seqnum);
588
+ retval = add_uevent_var(env, "SEQNUM=%llu", ++uevent_seqnum);
602589 if (retval) {
603590 mutex_unlock(&uevent_sock_mutex);
604591 goto exit;
....@@ -782,8 +769,7 @@
782769
783770 ue_sk->sk = netlink_kernel_create(net, NETLINK_KOBJECT_UEVENT, &cfg);
784771 if (!ue_sk->sk) {
785
- printk(KERN_ERR
786
- "kobject_uevent: unable to create netlink socket!\n");
772
+ pr_err("kobject_uevent: unable to create netlink socket!\n");
787773 kfree(ue_sk);
788774 return -ENODEV;
789775 }