From 6d3cdf0ab519f1b7bad6bd132eda48242f0ff7c8 Mon Sep 17 00:00:00 2001 From: avg Date: Wed, 14 Dec 2016 15:38:28 +0000 Subject: 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 --- sys/dev/smbus/smbconf.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'sys') 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; -- cgit v1.1