arm64: dts: rockchip: add touscreen for excavator linux
[firefly-linux-kernel-4.4.55.git] / drivers / media / media-device.c
index 73a432934bd8d1ee8bad5c2e07689cca9ed1a1d3..7b39440192d61a7f91b0896c406beea751d8d515 100644 (file)
@@ -103,10 +103,8 @@ static long media_device_enum_entities(struct media_device *mdev,
                return -EINVAL;
 
        u_ent.id = ent->id;
-       if (ent->name) {
-               strncpy(u_ent.name, ent->name, sizeof(u_ent.name));
-               u_ent.name[sizeof(u_ent.name) - 1] = '\0';
-       }
+       if (ent->name)
+               strlcpy(u_ent.name, ent->name, sizeof(u_ent.name));
        u_ent.type = ent->type;
        u_ent.revision = ent->revision;
        u_ent.flags = ent->flags;