Skip to content

Commit

Permalink
Add product name for lshw package (1/2)
Browse files Browse the repository at this point in the history
Change-Id: I002b15260cd87c0f664d7995fb33f13bc3adbc31
Reviewed-on: https://tp-biosrd-v02/gerrit/80848
Reviewed-by: Alex Cheng(鄭富元) <Alex_Cheng@asus.com>
Tested-by: Alex Cheng(鄭富元) <Alex_Cheng@asus.com>
  • Loading branch information
Yaojen_Chang authored and alex3788 committed Sep 22, 2017
1 parent 457a23c commit b7ffedf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion arch/arm/boot/dts/rk3288-miniarm.dts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

/ {
compatible = "rockchip,rk3288-miniarm", "rockchip,rk3288";
model = "Tinker Board";
model = " ";
copyright = "ASUS";
system-id = " "; /*For ASUS PPID*/

Expand Down
13 changes: 7 additions & 6 deletions drivers/of/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,14 @@ DEFINE_MUTEX(of_mutex);
*/
DEFINE_RAW_SPINLOCK(devtree_lock);

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

sysfs_bin_attr_init(&pp->attr);
pp->attr.attr.name = safe_name(&np->kobj, pp->name);
//For ASUS PPID (system-id)
if (!(strcmp(pp->attr.attr.name, "system-id"))) {
//For ASUS hwinfo
if (!(strcmp(pp->attr.attr.name, "system-id") && strcmp(pp->attr.attr.name, "model"))) {
pp->attr.attr.mode = S_IRUGO|S_IWUSR;
pp->attr.read = of_node_property_read;
pp->attr.write = asus_write_systemid;
pp->attr.write = asus_write_hwinfo;
} else {
pp->attr.attr.mode = secure ? S_IRUSR : S_IRUGO;
pp->attr.size = secure ? 0 : pp->length;
Expand Down

0 comments on commit b7ffedf

Please sign in to comment.