[alsa-devel] [PATCH 1/2] acore: deprecated function in wrappers.c
This patch replace the call of pci_find_device() to pci_get_device(). The function pci_find_device() was deprecated for quite a long time, and now it is no longer in the kernel.
Signed-off-by: Grzegorz Daniluk g.daniluk@elproma.com.pl ---
diff -uprN a/acore/wrappers.c b/acore/wrappers.c --- a/acore/wrappers.c 2011-01-27 12:09:20.000000000 +0000 +++ b/acore/wrappers.c 2011-02-25 13:41:46.000000000 +0000 @@ -197,7 +197,7 @@ EXPORT_SYMBOL(snd_compat_devfs_mk_cdev); int snd_pci_dev_present(const struct pci_device_id *ids) { while (ids->vendor || ids->subvendor) { - if (pci_find_device(ids->vendor, ids->subvendor, NULL)) + if (pci_get_device(ids->vendor, ids->subvendor, NULL)) return 1; ids++; }
At Fri, 25 Feb 2011 16:35:18 +0100, Grzegorz Daniluk wrote:
This patch replace the call of pci_find_device() to pci_get_device(). The function pci_find_device() was deprecated for quite a long time, and now it is no longer in the kernel.
Erm... this code is defined _only_ for very old kernels just for compatible wrapper, so following the rule for new kernels doesn't make sense.
Takashi
Signed-off-by: Grzegorz Daniluk g.daniluk@elproma.com.pl
diff -uprN a/acore/wrappers.c b/acore/wrappers.c --- a/acore/wrappers.c 2011-01-27 12:09:20.000000000 +0000 +++ b/acore/wrappers.c 2011-02-25 13:41:46.000000000 +0000 @@ -197,7 +197,7 @@ EXPORT_SYMBOL(snd_compat_devfs_mk_cdev); int snd_pci_dev_present(const struct pci_device_id *ids) { while (ids->vendor || ids->subvendor) {
if (pci_find_device(ids->vendor, ids->subvendor, NULL))
}if (pci_get_device(ids->vendor, ids->subvendor, NULL)) return 1; ids++;
Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Takashi Iwai wrote:
Erm... this code is defined _only_ for very old kernels just for compatible wrapper, so following the rule for new kernels doesn't make sense.
Then something else is wrong, since this code caused the compilation error(attached below) when I was doing the cross-compilation for the system without PCI for the 2.6.35 kernel (the kernel version was correctly recognized during ./configure):
/root/alsa-driver-1.0.24/acore/wrappers.c: In function 'snd_pci_dev_present': /root/alsa-driver-1.0.24/acore/wrappers.c:200: error: implicit declaration of function 'pci_find_device' make[3]: *** [/root/alsa-driver-1.0.24/acore/wrappers.o] Error 1
Greg
Signed-off-by: Grzegorz Daniluk g.daniluk@elproma.com.pl
diff -uprN a/acore/wrappers.c b/acore/wrappers.c --- a/acore/wrappers.c 2011-01-27 12:09:20.000000000 +0000 +++ b/acore/wrappers.c 2011-02-25 13:41:46.000000000 +0000 @@ -197,7 +197,7 @@ EXPORT_SYMBOL(snd_compat_devfs_mk_cdev); int snd_pci_dev_present(const struct pci_device_id *ids) { while (ids->vendor || ids->subvendor) {
if (pci_find_device(ids->vendor, ids->subvendor, NULL))
}if (pci_get_device(ids->vendor, ids->subvendor, NULL)) return 1; ids++;
Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
At Fri, 25 Feb 2011 16:51:53 +0100, Grzegorz Daniluk wrote:
Takashi Iwai wrote:
Erm... this code is defined _only_ for very old kernels just for compatible wrapper, so following the rule for new kernels doesn't make sense.
Then something else is wrong, since this code caused the compilation error(attached below) when I was doing the cross-compilation for the system without PCI for the 2.6.35 kernel (the kernel version was correctly recognized during ./configure):
/root/alsa-driver-1.0.24/acore/wrappers.c: In function 'snd_pci_dev_present': /root/alsa-driver-1.0.24/acore/wrappers.c:200: error: implicit declaration of function 'pci_find_device' make[3]: *** [/root/alsa-driver-1.0.24/acore/wrappers.o] Error 1
Then configure script didn't detect the condition properly. Check CONFIG_HAVE_PCI_DEV_PRESENT in you config.log. Most likely a wrong gcc option or path is given, and the check is screwed up.
Takashi
Greg
Signed-off-by: Grzegorz Daniluk g.daniluk@elproma.com.pl
diff -uprN a/acore/wrappers.c b/acore/wrappers.c --- a/acore/wrappers.c 2011-01-27 12:09:20.000000000 +0000 +++ b/acore/wrappers.c 2011-02-25 13:41:46.000000000 +0000 @@ -197,7 +197,7 @@ EXPORT_SYMBOL(snd_compat_devfs_mk_cdev); int snd_pci_dev_present(const struct pci_device_id *ids) { while (ids->vendor || ids->subvendor) {
if (pci_find_device(ids->vendor, ids->subvendor, NULL))
}if (pci_get_device(ids->vendor, ids->subvendor, NULL)) return 1; ids++;
Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Takashi Iwai wrote:
Then configure script didn't detect the condition properly. Check CONFIG_HAVE_PCI_DEV_PRESENT in you config.log. Most likely a wrong gcc option or path is given, and the check is screwed up.
Takashi
ok, but still, something is wrong if it tries to compile the wrapper code even if new kernel was detected (2.6.35)...
Greg
At Mon, 28 Feb 2011 12:43:00 +0100, Grzegorz Daniluk wrote:
Takashi Iwai wrote:
Then configure script didn't detect the condition properly. Check CONFIG_HAVE_PCI_DEV_PRESENT in you config.log. Most likely a wrong gcc option or path is given, and the check is screwed up.
Takashi
ok, but still, something is wrong if it tries to compile the wrapper code even if new kernel was detected (2.6.35)...
As I wrote, it's a problem in configure script. It didn't detect the presence of pci_dev_present() properly with your system. You tried to fix a wrong place.
Takashi
participants (2)
-
Grzegorz Daniluk
-
Takashi Iwai