On Mon, Aug 12, 2019 at 07:07:32PM +0200, Hans de Goede wrote: > Hi, > > One more remark inline. > > On 8/8/19 11:55 PM, Yauhen Kharuzhy wrote: > > Existing intel_cht_int33fe ACPI pseudo-device driver assumes that > > hardware has TypeC connector and register related devices described as > > I2C connections in the _CRS resource. > > > > There at least one hardware (Lenovo Yoga Book YB1-91L/F) with microUSB > > connector exists. It has INT33FE device in the DSDT table but there are > > only two I2C connection described: PMIC and BQ27452 battery fuel gauge. > > > > Splitting existing INT33FE driver allow to maintain code for microUSB > > variant separately and make it simpler. > > > > Signed-off-by: Yauhen Kharuzhy <jekhor@xxxxxxxxx> > > --- > > <snip> > > + memset(&board_info, 0, sizeof(board_info)); > > + stracpy(board_info.type, "bq27542"); > > stracpy ? that does not compile for me, normally you would use: > > strlcpy(board_info.type, "bq27542", I2C_NAME_SIZE); > > here, I've used this for my testing. Yes, stracpy() is new function found in linux-next, is used to copy string to array. It is wrapper around of strscpy() str*cpy() mess :) I use strscpy(board_info.type, "bq27542", ARRAY_SIZE(board_info.type)) now for compiling with linus master branch. > > > + board_info.dev_name = "bq27542"; > > + board_info.properties = bq27xxx_props; > > + data->battery_fg = i2c_acpi_new_device(dev, 1, &board_info); > > + > > + if (IS_ERR(data->battery_fg)) { > > + dev_err(dev, "Failed to register battery fuel gauge: %ld\n", > > + PTR_ERR(data->battery_fg)); > > + return PTR_ERR(data->battery_fg); > > + } > > + > > + platform_set_drvdata(pdev, data); > > + > > + return 0; > > +} > > <snip> > > With that fixed, I can confirm that everything still works as it should on a > device which uses this driver combined with a Type-C connector. Thanks! -- Yauhen Kharuzhy