Summary: | DAHLIN-00096: [patch] xpp fails building with kernel 2.6.30-rc3: error: 'struct device' has no member named 'bus_id' | ||
Reporter: | Tzafrir Cohen (tzafrir) | Labels: | |
Date Opened: | 2009-04-23 19:14:39 | Date Closed: | 2009-05-27 08:15:30 |
Priority: | Minor | Regression? | No |
Status: | Closed/Complete | Components: | Astribank (xpp) |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) xpp_2630_dev_name.diff | |
Description: | On kernel 2.6.30 struct device no longer has a member called bus_id. The information is available through dev_name() The attached patch provides a compatibility dev_name() macro for older versions. However there are still warnings because we write directly to that field. See: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1fa5ae857bb14f6046205171d98506d8112dd74e Error encountered: drivers/dahdi/xpp/card_fxo.c: In function 'fxo_xpd_probe': drivers/dahdi/xpp/card_fxo.c:1351: error: 'struct device' has no member named 'bus_id' make[3]: *** [/home/tzafrir/Proj/Asterisk/Svn/dahdi-linux/drivers/dahdi/xpp/card_fxo.o] Error 1 make[2]: *** [/home/tzafrir/Proj/Asterisk/Svn/dahdi-linux/drivers/dahdi/xpp] Error 2 make[1]: *** [_module_/home/tzafrir/Proj/Asterisk/Svn/dahdi-linux/drivers/dahdi] Error 2 make[1]: Leaving directory `/home/tzafrir/Proj/Kernel/linux-2.6' make: *** [modules] Error 2 Warnings with the patch applied: drivers/dahdi/xpp/xbus-sysfs.c: In function 'xpd_device_register': drivers/dahdi/xpp/xbus-sysfs.c:705: warning: passing argument 1 of 'snprintf' discards qualifiers from pointer target type drivers/dahdi/xpp/xbus-sysfs.c: In function 'xbus_sysfs_create': drivers/dahdi/xpp/xbus-sysfs.c:762: warning: passing argument 1 of 'snprintf' discards qualifiers from pointer target type | ||
Comments: | By: Tzafrir Cohen (tzafrir) 2009-04-30 09:47:45 snprintf into a dev_name() is not nice and will oops (if you actually have an Astribank). Use dev_set_name() . I'll update the patch later. By: Tzafrir Cohen (tzafrir) 2009-05-18 14:18:28 updated version, tested to build. By: Digium Subversion (svnbot) 2009-05-19 09:12:16 Repository: dahdi Revision: 6637 U linux/trunk/drivers/dahdi/xpp/Kbuild U linux/trunk/drivers/dahdi/xpp/card_bri.c U linux/trunk/drivers/dahdi/xpp/card_fxo.c U linux/trunk/drivers/dahdi/xpp/card_fxs.c U linux/trunk/drivers/dahdi/xpp/card_pri.c U linux/trunk/drivers/dahdi/xpp/mmapbus.c U linux/trunk/drivers/dahdi/xpp/mmapdrv.c U linux/trunk/drivers/dahdi/xpp/xbus-sysfs.c U linux/trunk/drivers/dahdi/xpp/xdefs.h ------------------------------------------------------------------------ r6637 | tzafrir | 2009-05-19 09:12:16 -0500 (Tue, 19 May 2009) | 11 lines Replaece member bus_id with dev_name() and set_dev_name() As of 2.6.26 the macros dev_name() and set_dev_name() are used to read and set (respectively) the bus_id member in sysfs. As of 2.6.30 bus_id is gone. This patch provides comaptiobility macros for older kernel versions and removes direct usage of bus_id. (closes issue DAHLIN-96) Patches: xpp_2630_dev_name.diff uploaded by tzafrir (license 46) ------------------------------------------------------------------------ http://svn.digium.com/view/dahdi?view=rev&revision=6637 By: Digium Subversion (svnbot) 2009-05-27 08:15:30 Repository: zaptel Revision: 4649 U branches/1.4/kernel/xpp/card_bri.c U branches/1.4/kernel/xpp/card_fxo.c U branches/1.4/kernel/xpp/card_fxs.c U branches/1.4/kernel/xpp/card_pri.c U branches/1.4/kernel/xpp/xbus-sysfs.c U branches/1.4/kernel/xpp/xdefs.h ------------------------------------------------------------------------ r4649 | tzafrir | 2009-05-27 08:15:30 -0500 (Wed, 27 May 2009) | 9 lines xpp: Replaece member bus_id with dev_name() and set_dev_name() As of 2.6.26 the macros dev_name() and set_dev_name() are used to read and set (respectively) the bus_id member in sysfs. As of 2.6.30 bus_id is gone. This patch provides comaptiobility macros for older kernel versions and removes direct usage of bus_id. From dahdi-linux r6637. Regarding issue DAHLIN-96 . ------------------------------------------------------------------------ http://svn.digium.com/view/zaptel?view=rev&revision=4649 |