diff options
author | avg <avg@FreeBSD.org> | 2016-12-14 15:38:28 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2016-12-14 15:38:28 +0000 |
commit | 6d3cdf0ab519f1b7bad6bd132eda48242f0ff7c8 (patch) | |
tree | 20b7781b8ad53fe3cd71ffb7629732e4b593a484 /sys | |
parent | daf577c69300e59c39951e95a3a17d08780a164c (diff) | |
download | FreeBSD-src-6d3cdf0ab519f1b7bad6bd132eda48242f0ff7c8.zip FreeBSD-src-6d3cdf0ab519f1b7bad6bd132eda48242f0ff7c8.tar.gz |
make smbus_get_addr() an ivar accessor
This is a direct commit to this branch.
smbus_get_addr() was declared as a funciton prototype, but the function
was never defined. read_ivar and write_ivar methods were unused.
This was exposed after jedec_ts driver was imported to this branch
as that driver turned out to be the first user of smbus_get_addr().
This change is a small subset of a larger change in r281985.
Reported by: jhb
Pointyhat to: avg
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/smbus/smbconf.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/smbus/smbconf.h b/sys/dev/smbus/smbconf.h index 0d57360..0797585 100644 --- a/sys/dev/smbus/smbconf.h +++ b/sys/dev/smbus/smbconf.h @@ -74,7 +74,9 @@ /* * ivars codes */ -#define SMBUS_IVAR_ADDR 0x1 /* slave address of the device */ +enum smbus_ivars { + SMBUS_IVAR_ADDR, /* slave address of the device */ +}; int smbus_request_bus(device_t, device_t, int); int smbus_release_bus(device_t, device_t); @@ -83,7 +85,12 @@ int smbus_error(int error); void smbus_intr(device_t, u_char, char low, char high, int error); -u_char smbus_get_addr(device_t); +#define SMBUS_ACCESSOR(var, ivar, type) \ + __BUS_ACCESSOR(smbus, var, SMBUS, ivar, type) + +SMBUS_ACCESSOR(addr, ADDR, int) + +#undef SMBUS_ACCESSOR extern driver_t smbus_driver; extern devclass_t smbus_devclass; |