int extension_board_scan(struct list_head *extension_list)
{
- struct extension *dip;
- struct dip_w1_header w1_header;
struct udevice *bus, *dev;
- u32 vid;
- u16 pid;
- int ret;
-
int num_dip = 0;
+ int ret;
sunxi_gpio_set_pull(SUNXI_GPD(2), SUNXI_GPIO_PULL_UP);
}
for_each_w1_device(bus, &dev) {
+ struct dip_w1_header w1_header;
+ struct extension *dip;
+ u32 vid;
+ u16 pid;
+
if (w1_get_device_family(dev) != W1_FAMILY_DS2431)
continue;
snprintf(dip->overlay, sizeof(dip->overlay), "dip-%x-%x.dtbo",
vid, pid);
- strncpy(dip->name, w1_header.product_name, 32);
- strncpy(dip->owner, w1_header.vendor_name, 32);
+ strlcpy(dip->name, w1_header.product_name, sizeof(dip->name));
+ strlcpy(dip->owner, w1_header.vendor_name, sizeof(dip->owner));
list_add_tail(&dip->list, extension_list);
num_dip++;
}