stm class: Support devices with multiple instances
[firefly-linux-kernel-4.4.55.git] / drivers / hwtracing / stm / policy.c
index 94d3abfb737a1711541146bcdb733b8e84fb260f..1db189657b2b01b194a2e06aafbd79be872fb027 100644 (file)
@@ -332,10 +332,11 @@ stp_policies_make(struct config_group *group, const char *name)
 
        /*
         * node must look like <device_name>.<policy_name>, where
-        * <device_name> is the name of an existing stm device and
-        * <policy_name> is an arbitrary string
+        * <device_name> is the name of an existing stm device; may
+        *               contain dots;
+        * <policy_name> is an arbitrary string; may not contain dots
         */
-       p = strchr(devname, '.');
+       p = strrchr(devname, '.');
        if (!p) {
                kfree(devname);
                return ERR_PTR(-EINVAL);