The errors disappear with the attached patch. No compilation error in
2.6.30.5 kernel but I have no mesa hardware, therefore I can't test it

acemi


On 9/9/09, Jeff Epler <[email protected]> wrote:
>> error: 'struct device' has no member named 'bus_id'
>
> The internet says it's due to the 2.6.30 kernel and suggest a general
> solution, which I haven't tried (I don't have 2.6.30 anywhere):
>     https://issues.asterisk.org/view.php?id=14965
>
> I'd welcome a patch that solves this problem while keeping compatability
> with pre-2.6.30 kernels.
>
> keff
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Emc-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>
--- emc2/src/hal/drivers/mesa-hostmot2/hostmot2.c	2009-09-08 21:45:41.000000000 +0300
+++ dev/src/hal/drivers/mesa-hostmot2/hostmot2.c	2009-09-12 14:19:03.000000000 +0300
@@ -30,6 +30,17 @@
 #include "hostmot2.h"
 #include "bitfile.h"
 
+#ifndef LINUX_VERSION_CODE
+#include <linux/version.h>
+#endif
+
+#ifndef KERNEL_VERSION
+#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+#endif
+
+#ifndef LINUX_VERSION_CODE
+#define LINUX_VERSION_CODE 0 
+#endif
 
 
 
@@ -839,8 +850,12 @@ int hm2_register(hm2_lowlevel_io_t *llio
         }
 
         memset(&dev, '\0', sizeof(dev));
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28)
+        dev_set_name(&dev, "%s", hm2->llio->name);
+#else
         strncpy(dev.bus_id, hm2->llio->name, BUS_ID_SIZE);
         dev.bus_id[BUS_ID_SIZE - 1] = '\0';
+#endif
         dev.release = hm2_release_device;
         r = device_register(&dev);
         if (r != 0) {
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to