diff options
author | Joel Stanley <joel@jms.id.au> | 2017-11-23 14:22:15 +1030 |
---|---|---|
committer | Alistair Popple <alistair@popple.id.au> | 2017-11-24 11:33:12 +1100 |
commit | f97b554064f4c7c37edf4dd6eae1ddf56df746da (patch) | |
tree | 54732f59c471ab620e802448eb639a53aabdde5b | |
parent | 782f893c0349e40e14a27c9d829506c3c3008ed1 (diff) | |
download | pdbg-f97b554064f4c7c37edf4dd6eae1ddf56df746da.tar.gz pdbg-f97b554064f4c7c37edf4dd6eae1ddf56df746da.zip |
lipdbg/i2c: Get bus path from device tree
This was not implemented, so the user always got the default /dev/i2c4
no matter what the device tree specified.
Signed-off-by: Joel Stanley <joel@jms.id.au>
-rw-r--r-- | libpdbg/i2c.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libpdbg/i2c.c b/libpdbg/i2c.c index 3e98c1b..6169e3c 100644 --- a/libpdbg/i2c.c +++ b/libpdbg/i2c.c @@ -129,7 +129,7 @@ int i2c_target_probe(struct target *target) const char *bus; int addr; - bus = "/dev/i2c4"; + bus = dt_prop_get_def(pib->target.dn, "bus", "/dev/i2c4"); addr = dt_get_address(pib->target.dn, 0, NULL); assert(addr); |