Matt DeVillier has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47782 )
Change subject: drivers/i2c/hid: Use ACPI device name if provided by config ......................................................................
drivers/i2c/hid: Use ACPI device name if provided by config
Follow model of drivers/i2c/generic and use user-supplied device name if specified in the chip config.
Change-Id: Ia783bac2797e239989c03a3421b9293a055db3d0 Signed-off-by: Matt DeVillier matt.devillier@puri.sm --- M src/drivers/i2c/hid/hid.c 1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/82/47782/1
diff --git a/src/drivers/i2c/hid/hid.c b/src/drivers/i2c/hid/hid.c index 0755852..2d213eb 100644 --- a/src/drivers/i2c/hid/hid.c +++ b/src/drivers/i2c/hid/hid.c @@ -28,6 +28,10 @@ static const char *i2c_hid_acpi_name(const struct device *dev) { static char name[5]; + struct drivers_i2c_hid_config *config = dev->chip_info; + if (config->generic.name) + return config->generic.name; + snprintf(name, sizeof(name), "H%03.3X", dev->path.i2c.device); name[4] = '\0'; return name;
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47782 )
Change subject: drivers/i2c/hid: Use ACPI device name if provided by config ......................................................................
Patch Set 1: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/47782/1/src/drivers/i2c/hid/hid.c File src/drivers/i2c/hid/hid.c:
https://review.coreboot.org/c/coreboot/+/47782/1/src/drivers/i2c/hid/hid.c@3... PS1, Line 32: config-> Do we need a 'config &&'
Matt DeVillier has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47782 )
Change subject: drivers/i2c/hid: Use ACPI device name if provided by config ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/47782/1/src/drivers/i2c/hid/hid.c File src/drivers/i2c/hid/hid.c:
https://review.coreboot.org/c/coreboot/+/47782/1/src/drivers/i2c/hid/hid.c@3... PS1, Line 32: config->
Do we need a 'config &&'
I can't see how we'd end up here in the first place if config were null. I also just copied it verbatim from drivers/i2c/generic.c ;)
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47782 )
Change subject: drivers/i2c/hid: Use ACPI device name if provided by config ......................................................................
Patch Set 1:
(1 comment)
https://review.coreboot.org/c/coreboot/+/47782/1/src/drivers/i2c/hid/hid.c File src/drivers/i2c/hid/hid.c:
https://review.coreboot.org/c/coreboot/+/47782/1/src/drivers/i2c/hid/hid.c@3... PS1, Line 32: config->
I can't see how we'd end up here in the first place if config were null. […]
Agreed. We typically have a check for NULL in lot of drivers. Also, I think coverity complains about it. But, it shouldn't be the case that dev->chip_info is NULL.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47782 )
Change subject: drivers/i2c/hid: Use ACPI device name if provided by config ......................................................................
Patch Set 1: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/47782 )
Change subject: drivers/i2c/hid: Use ACPI device name if provided by config ......................................................................
drivers/i2c/hid: Use ACPI device name if provided by config
Follow model of drivers/i2c/generic and use user-supplied device name if specified in the chip config.
Change-Id: Ia783bac2797e239989c03a3421b9293a055db3d0 Signed-off-by: Matt DeVillier matt.devillier@puri.sm Reviewed-on: https://review.coreboot.org/c/coreboot/+/47782 Reviewed-by: Furquan Shaikh furquan@google.com Reviewed-by: Angel Pons th3fanbus@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/drivers/i2c/hid/hid.c 1 file changed, 4 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Furquan Shaikh: Looks good to me, approved Angel Pons: Looks good to me, approved
diff --git a/src/drivers/i2c/hid/hid.c b/src/drivers/i2c/hid/hid.c index 0755852..2d213eb 100644 --- a/src/drivers/i2c/hid/hid.c +++ b/src/drivers/i2c/hid/hid.c @@ -28,6 +28,10 @@ static const char *i2c_hid_acpi_name(const struct device *dev) { static char name[5]; + struct drivers_i2c_hid_config *config = dev->chip_info; + if (config->generic.name) + return config->generic.name; + snprintf(name, sizeof(name), "H%03.3X", dev->path.i2c.device); name[4] = '\0'; return name;