Date: Sun, 18 Feb 2018 19:33:28 +0000 (UTC) From: Ian Lepore <ian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329526 - head/sys/dev/iicbus Message-ID: <201802181933.w1IJXSAW041321@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ian Date: Sun Feb 18 19:33:28 2018 New Revision: 329526 URL: https://svnweb.freebsd.org/changeset/base/329526 Log: Allow i2c hardware drivers to declare their own relationships to ofw_iicbus rather than relying on a set of canned EARLY_DRIVER_MODULE() statements in the ofw_iicbus source. This means hw drivers will no longer be required to use one of a few predefined driver names. They will also now be able to decide themselves if they want to use DRIVER_MODULE or EARLY_DRIVER_MODULE and to set which pass to attach on for early modules. Mainly, this adds extern declarations for the driver and devclass variables. It also renames ofwiicbus_devclass to ofw_iicbus_devclass to be consistant with the way we use ofw_ prefixes on this stuff. Modified: head/sys/dev/iicbus/iicbus.h head/sys/dev/iicbus/ofw_iicbus.c Modified: head/sys/dev/iicbus/iicbus.h ============================================================================== --- head/sys/dev/iicbus/iicbus.h Sun Feb 18 19:19:36 2018 (r329525) +++ head/sys/dev/iicbus/iicbus.h Sun Feb 18 19:33:28 2018 (r329526) @@ -77,5 +77,7 @@ void iicbus_init_frequency(device_t dev, u_int bus_fre extern driver_t iicbus_driver; extern devclass_t iicbus_devclass; +extern driver_t ofw_iicbus_driver; +extern devclass_t ofw_iicbus_devclass; #endif Modified: head/sys/dev/iicbus/ofw_iicbus.c ============================================================================== --- head/sys/dev/iicbus/ofw_iicbus.c Sun Feb 18 19:19:36 2018 (r329525) +++ head/sys/dev/iicbus/ofw_iicbus.c Sun Feb 18 19:33:28 2018 (r329526) @@ -76,15 +76,15 @@ struct ofw_iicbus_devinfo { struct ofw_bus_devinfo opd_obdinfo; }; -devclass_t ofwiicbus_devclass; +devclass_t ofw_iicbus_devclass; DEFINE_CLASS_1(iicbus, ofw_iicbus_driver, ofw_iicbus_methods, sizeof(struct iicbus_softc), iicbus_driver); -EARLY_DRIVER_MODULE(ofw_iicbus, iicbb, ofw_iicbus_driver, ofwiicbus_devclass, +EARLY_DRIVER_MODULE(ofw_iicbus, iicbb, ofw_iicbus_driver, ofw_iicbus_devclass, 0, 0, BUS_PASS_BUS); -EARLY_DRIVER_MODULE(ofw_iicbus, iichb, ofw_iicbus_driver, ofwiicbus_devclass, +EARLY_DRIVER_MODULE(ofw_iicbus, iichb, ofw_iicbus_driver, ofw_iicbus_devclass, 0, 0, BUS_PASS_BUS); -EARLY_DRIVER_MODULE(ofw_iicbus, twsi, ofw_iicbus_driver, ofwiicbus_devclass, +EARLY_DRIVER_MODULE(ofw_iicbus, twsi, ofw_iicbus_driver, ofw_iicbus_devclass, 0, 0, BUS_PASS_BUS); MODULE_VERSION(ofw_iicbus, 1); MODULE_DEPEND(ofw_iicbus, iicbus, 1, 1, 1);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802181933.w1IJXSAW041321>