[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
Tue May 19 09:12:16 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:                     assigned
====================================================================== 
Date Submitted:             2009-04-23 19:14 CDT
Last Modified:              2009-05-19 09:12 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
====================================================================== 

---------------------------------------------------------------------- 
 (0104998) svnbot (reporter) - 2009-05-19 09:12
 https://issues.asterisk.org/view.php?id=14965#c104998 
---------------------------------------------------------------------- 
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 https://issues.asterisk.org/view.php?id=14965)
Patches:
      xpp_2630_dev_name.diff uploaded by tzafrir (license 46)

------------------------------------------------------------------------

http://svn.digium.com/view/dahdi?view=rev&revision=6637 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-05-19 09:12 svnbot         Checkin                                      
2009-05-19 09:12 svnbot         Note Added: 0104998                          
======================================================================




More information about the asterisk-bugs mailing list