From 29d1acb7e146c9e262f211516d5205809c8c90b6 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 10 Apr 2003 19:38:42 +0200 Subject: [PATCH] ALSA and PnP update - compilation fixes - enhanced linux/pnp.h: pnp_device_is_isapnp(dev) pnp_device_is_pnpbios(dev) isapnp_card_number(dev) isapnp_csn_number(dev) --- drivers/pnp/isapnp/core.c | 2 -- drivers/pnp/pnpbios/core.c | 2 +- include/linux/pnp.h | 19 +++++++++++++++++++ sound/isa/es18xx.c | 3 ++- sound/pci/ac97/ac97_codec.c | 2 +- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c index 018385275a61c..867b31dc3d00b 100644 --- a/drivers/pnp/isapnp/core.c +++ b/drivers/pnp/isapnp/core.c @@ -106,8 +106,6 @@ static int isapnp_detected; /* some prototypes */ -extern struct pnp_protocol isapnp_protocol; - static inline void write_data(unsigned char x) { outb(x, _PNPWRP); diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c index a530fe61c7731..3e4de85188f67 100644 --- a/drivers/pnp/pnpbios/core.c +++ b/drivers/pnp/pnpbios/core.c @@ -869,7 +869,7 @@ static int pnpbios_disable_resources(struct pnp_dev *dev) /* PnP Layer support */ -static struct pnp_protocol pnpbios_protocol = { +struct pnp_protocol pnpbios_protocol = { .name = "Plug and Play BIOS", .get = pnpbios_get_resources, .set = pnpbios_set_resources, diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 73d74d0e52a73..d0249ab406761 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h @@ -274,12 +274,31 @@ struct pnp_fixup { #define pnp_can_configure(dev) ((!(dev)->active) && ((dev)->config_mode & PNP_CONFIG_AUTO) && \ ((dev)->capabilities & PNP_CONFIGURABLE)) +#ifdef CONFIG_ISAPNP +extern struct pnp_protocol isapnp_protocol; +#define pnp_device_is_isapnp(dev) ((dev)->protocol == (&isapnp_protocol)) +#else +#define pnp_device_is_isapnp(dev) 0 +#endif + +#ifdef CONFIG_PNPBIOS +extern struct pnp_protocol pnpbios_protocol; +#define pnp_device_is_pnpbios(dev) ((dev)->protocol == (&pnpbios_protocol)) +#else +#define pnp_device_is_pnpbios(dev) 0 +#endif + + /* status */ #define PNP_READY 0x0000 #define PNP_ATTACHED 0x0001 #define PNP_BUSY 0x0002 #define PNP_FAULTY 0x0004 +/* isapnp specific macros */ + +#define isapnp_card_number(dev) ((dev)->card ? (dev)->card->number : -1) +#define isapnp_csn_number(dev) ((dev)->number) /* * Driver Management diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c index dd6b6bc40f127..04f2c1834bfcc 100644 --- a/sound/isa/es18xx.c +++ b/sound/isa/es18xx.c @@ -71,6 +71,7 @@ #include #include #include +#include #include #include #include @@ -1987,7 +1988,7 @@ static int __devinit snd_audiodrive_pnp(int dev, struct snd_audiodrive *acard, snd_printk(KERN_ERR PFX "PnP control configure failure (out of resources?)\n"); return -EAGAIN; } - snd_printdd("pnp: port=0x%lx\n", acard->devc->resource[0].start); + snd_printdd("pnp: port=0x%lx\n", pnp_port_start(acard->devc, 0)); /* PnP initialization */ pdev = acard->dev; pnp_init_resource_table(cfg); diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index bbd9f0a507c0a..1271f24bf67a1 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c @@ -2908,7 +2908,7 @@ int snd_ac97_tune_hardware(ac97_t *ac97, struct ac97_quirk *quirk) for (; quirk->vendor; quirk++) { if (quirk->vendor == ac97->subsystem_vendor && quirk->device == ac97->subsystem_device) { - snd_printdd("ac97 quirk for %s (%04x:%04x)\n", quirk->name, vendor, device); + snd_printdd("ac97 quirk for %s (%04x:%04x)\n", quirk->name, ac97->subsystem_vendor, ac97->subsystem_device); switch (quirk->type) { case AC97_TUNE_HP_ONLY: return swap_headphone(ac97, 1); -- 2.53.0