diff options
Diffstat (limited to 'v4l')
-rw-r--r-- | v4l/compat.h | 4 | ||||
-rwxr-xr-x | v4l/scripts/make_config_compat.pl | 20 |
2 files changed, 22 insertions, 2 deletions
diff --git a/v4l/compat.h b/v4l/compat.h index de192e8cf..22281f6f9 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -339,8 +339,8 @@ usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd) #define list_first_entry(ptr, type, member) \ list_entry((ptr)->next, type, member) -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28) -#define netdev_priv(dev) (dev->priv) +#ifdef NEED_NETDEV_PRIV +#define netdev_priv(dev) ((dev)->priv) #endif /* diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl index 3a8bdd81e..8fb7a9441 100755 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -197,6 +197,25 @@ sub check_algo_control() close INNET; } +sub check_net_dev() +{ + my $file = "$kdir/include/linux/netdevice.h"; + my $need_compat = 1; + + open INNET, "<$file" or die "File not found: $file"; + while (<INNET>) { + if (m/netdev_priv/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_NETDEV_PRIV 1\n"; + } + close INNET; +} + sub check_other_dependencies() { check_spin_lock(); @@ -209,6 +228,7 @@ sub check_other_dependencies() check_proc_create(); check_pcm_lock(); check_algo_control(); + check_net_dev(); } # Do the basic rules |