[asterisk-bugs] [DAHDI-linux 0014965]: [patch] xpp fails building with kernel 2.6.30-rc3: error: 'struct device' has no member named 'bus_id'

Asterisk Bug Tracker noreply at bugs.digium.com
Wed May 27 08:15:30 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=14965 
====================================================================== 
Reported By:                tzafrir
Assigned To:                tzafrir
====================================================================== 
Project:                    DAHDI-linux
Issue ID:                   14965
Category:                   Astribank (xpp)
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     closed
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2009-04-23 19:14 CDT
Last Modified:              2009-05-27 08:15 CDT
====================================================================== 
Summary:                    [patch] xpp fails building with kernel 2.6.30-rc3: 
error: 'struct device' has no member named 'bus_id'
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
====================================================================== 

---------------------------------------------------------------------- 
 (0105512) svnbot (reporter) - 2009-05-27 08:15
 https://issues.asterisk.org/view.php?id=14965#c105512 
---------------------------------------------------------------------- 
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.



More information about the asterisk-bugs mailing list