Skip to contentSkip to conversation

acore: deprecated function in wrappers.c

PATCH In review Grzegorz Daniluk 2 participants 6 messages Feb 25, 2011 – Feb 28, 2011

lore
Share & tools
lore
#0 lore raw

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.

---

acore/wrappers.c 2011-02-25 13:41:46.000000000 +0000 renamed from acore/wrappers.c 2011-01-27 12:09:20.000000000 +0000 +1 -1
diff -uprN a/acore/wrappers.c b/acore/wrappers.c
@@ -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++;
     }
#1 lore raw

At Fri, 25 Feb 2011 16:35:18 +0100,

Quoted 4 lines · Grzegorz Daniluk

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

Quoted 21 lines

---

diff -uprN a/acore/wrappers.c b/acore/wrappers.c

acore/wrappers.c 2011-02-25 13:41:46.000000000 +0000 renamed from acore/wrappers.c 2011-01-27 12:09:20.000000000 +0000 +1 -1
@@ -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
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#2 lore raw
Quoted 7 lines · Takashi Iwai

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

Quoted 23 lines
Quoted 21 lines

---

diff -uprN a/acore/wrappers.c b/acore/wrappers.c

acore/wrappers.c 2011-02-25 13:41:46.000000000 +0000 renamed from acore/wrappers.c 2011-01-27 12:09:20.000000000 +0000 +1 -1
@@ -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
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#3 lore raw

At Fri, 25 Feb 2011 16:51:53 +0100,

Quoted 14 lines · Grzegorz Daniluk
Quoted 7 lines · Takashi Iwai

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):

Quoted 5 lines

/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

Quoted 27 lines

Greg

Quoted 23 lines
Quoted 21 lines

---

diff -uprN a/acore/wrappers.c b/acore/wrappers.c

acore/wrappers.c 2011-02-25 13:41:46.000000000 +0000 renamed from acore/wrappers.c 2011-01-27 12:09:20.000000000 +0000 +1 -1
@@ -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
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#4 lore raw
Quoted 6 lines · Takashi Iwai

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

#5 lore raw

At Mon, 28 Feb 2011 12:43:00 +0100,

Quoted 10 lines · Grzegorz Daniluk
Quoted 6 lines · Takashi Iwai

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