Skip to content

Commit b7ffedf

Browse files
Yaojen_Changalex3788
authored andcommitted
Add product name for lshw package (1/2)
Change-Id: I002b15260cd87c0f664d7995fb33f13bc3adbc31 Reviewed-on: https://tp-biosrd-v02/gerrit/80848 Reviewed-by: Alex Cheng(鄭富元) <[email protected]> Tested-by: Alex Cheng(鄭富元) <[email protected]>
1 parent 457a23c commit b7ffedf

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

arch/arm/boot/dts/rk3288-miniarm.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
/ {
4646
compatible = "rockchip,rk3288-miniarm", "rockchip,rk3288";
47-
model = "Tinker Board";
47+
model = " ";
4848
copyright = "ASUS";
4949
system-id = " "; /*For ASUS PPID*/
5050

drivers/of/base.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,14 @@ DEFINE_MUTEX(of_mutex);
5454
*/
5555
DEFINE_RAW_SPINLOCK(devtree_lock);
5656

57-
/*------------------ For ASUS write system-id---------------------*/
58-
static ssize_t asus_write_systemid(struct file *filp, struct kobject *kobj,
57+
/*-------------------- For ASUS write hwinfo----------------------*/
58+
static ssize_t asus_write_hwinfo(struct file *filp, struct kobject *kobj,
5959
struct bin_attribute *bin_attr, char *buf,
6060
loff_t offset, size_t count)
6161
{
6262
struct property *pp = container_of(bin_attr, struct property, attr);
63-
sscanf(buf, "%s", (char *)pp->value);
63+
memset((char *)pp->value, '\0', pp->length);
64+
memcpy((char *)pp->value, buf, strlen(buf));
6465
return count;
6566
}
6667
/*----------------------------------------------------------------*/
@@ -162,11 +163,11 @@ int __of_add_property_sysfs(struct device_node *np, struct property *pp)
162163

163164
sysfs_bin_attr_init(&pp->attr);
164165
pp->attr.attr.name = safe_name(&np->kobj, pp->name);
165-
//For ASUS PPID (system-id)
166-
if (!(strcmp(pp->attr.attr.name, "system-id"))) {
166+
//For ASUS hwinfo
167+
if (!(strcmp(pp->attr.attr.name, "system-id") && strcmp(pp->attr.attr.name, "model"))) {
167168
pp->attr.attr.mode = S_IRUGO|S_IWUSR;
168169
pp->attr.read = of_node_property_read;
169-
pp->attr.write = asus_write_systemid;
170+
pp->attr.write = asus_write_hwinfo;
170171
} else {
171172
pp->attr.attr.mode = secure ? S_IRUSR : S_IRUGO;
172173
pp->attr.size = secure ? 0 : pp->length;

0 commit comments

Comments
 (0)